Ebook Kỹ thuật số - Lý thuyết và ứng dụng: Phần 1

Chia sẻ: Co đơn Trăm Năm | Ngày: | Loại File: PDF | Số trang:178

0
73
lượt xem
29
download

Ebook Kỹ thuật số - Lý thuyết và ứng dụng: Phần 1

Mô tả tài liệu
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Cuốn sách "Kỹ thuật số - Lý thuyết và ứng dụng" giới thiệu những kiến thức cơ bản về kỹ thuật số và một số ứng dụng của kỹ thuật số trong đời sống. Phần 1 cuốn sách trình bày các nội dung từ chương 1 đến chương 6. Mời các bạn cùng tham khảo nội dung chi tiết.

Chủ đề:
Lưu

Nội dung Text: Ebook Kỹ thuật số - Lý thuyết và ứng dụng: Phần 1

  1. i C H U B IE N : PTS D 6 K IM B A N G / A / LY THUYET & UNG DUNG r \ / i 1010101010101010100101010101 01 O lo I M - N H A m J A T B A N LA O D O N G / X A H 0 r " \ w —
  2. M ' PTS. DO KIM BANG Bien soan g f -1 k y m m s o Z7 nr mJ □ Ky m □ B
  3. LQ1 H 0 3 B & I Ngay nay, ky thuat digital dUOc ap dung rong rai trong nhieu ITnh virc. Cac mach digital dude dira vao sirdung trong hang loat cac san pham dien tif, nhi/ cac thiet bi vien thong, may ti'nh, ti_r dong hoa, cac do choi co mach dien tCr, cac he thong nghe nhin, do gia dung, dung cu do luting, dung cu y te va quan sir, cac tur dien dien tCr_ Sach Ky thuat digital - ly thuyet va Crng dung gidi thieu nhCrng kien thud co ban ve ky thuat digital va mot so irng dung trong doi song. Be tiep thu cac kien thud de cap trong cuon sach nay, ban doc can co nhCrng kien thud pho thong ve toan va ve mach dien tir. Ky thuat digital dude nghien ciru trutic hoac nghien cuti song song v 6 i mon hoc dien tir co ban vi cac kien thud ve linh kien ti'ch cifc rdi rac khong phai la dieu kien doi hoi trutic het. Co the noi, cuon sach nay la ngirdi ban dong hanh cua cac ban ham thich dien ti!r digital, cua cac cong nhan nganh dien tu” - vien thong va may ti'nh cGng nhif cua cac cong nhan lanh nghe thuoc cac ITnh vu t co lien quan den cac mach dien tu1digital. Cuon sach nay dirpc xem nhir la tai lieu tham khao hCru dung vi ti'nh thut dung va de hieu cua no doi vdi cac sinh vien cao dang va dai hoc nganh dien tCr - vien thong va may ti'nh. Sach Ky thuat digital - ly thuyet va u"ng dung co 11 chirong. Chi/ong 1 khai quat ve cac he thong so nhi phan, bat phan va thap luc phan, moi lien quan giCra cac he thong nay vdi he thong so thap phan, chi/Ong nay cGng gidi thieu tong quan cac ma diroc sCr dung trong ITnh vi/c vien thong va may tfnh. Chutfng 2 gidi thieu ve dai so logic, phan tich va tong hop mach logic, cac djnh ly De Morgan, cac phifOng phap toi gian mach bang bang Karnaugh, bang cac dinh ly va dinh luat cua dai so logic. Chi/dng 3 gidi thieu cac mach xir ly so lieu, de cap den cac bo ghep kenh, phan kenh, cac bo giai ma, ma hoa, bo tao va kiem tra bit chan le. Noi dung Chi/ong 4 noi ve phep cong, phep trif so hoc, cac phep bu 1, bu 2 va cac bo niTa cong va cong day du, de tirdo, ta hieu di/Oc can ke cac bo cong va bo trir. ChiTOng 5 gidi thieu cac ho IC TTL va CMOS, noi dung de cap trong phan nay giup ta co cac kien th u t co ban de sCr dung co hieu qua va phoi ket hop di/oc cac ho IC TTL va CMOS trong cac mach digital. Noi dung cac Chuting 6 , ChiTOng 7 va ChGOng 8 di/oc u'ng dung nhieu trong cac mach dien tu1 digital thong thuting. ChifOng 6 gidi thieu cac loai flip flop RS, RS dong bo tTnh, flip flop D, flip flop JK va flip flop JK Master-Slave; ngoai ra, con gidi thieu trigo Schmitt, loai trigo co dac ti'nh quan trong, dude su' dung de tao nen cac xung nhip; Chudng nay cung gidi thieu cac loai mach dao dong, mach tao xung nhip. Noi dung ChUdng 7 thirc chat la cac u’ng 3
  4. dung dac ti'nh cua cac flip flop diroc ti'ch hap trong cac IC de thirc hien cac phep di chuyen so lieu. Trong chirong 8 , noi dung diroc de cap la cac loai bo dem va cac Mod dem; tir chirong nay, ta thay diroc cac cau true va cac iru nhiroc diem cua cac loai bo dem. Chirong 9, bo nho ban dan va chirong 10, chuyen doi A/D va chuyen doi D/A, hai chirong nay gidi thieu ve nhCrng nguyen ly cau tao co ban va cac dac ti'nh cua cac bo nho ban dan, cac bo chuyen doi A/D va chuyen doi D/A, giup ta co the Crng dung cac bo kien nay trong cac mach dien tir digital. Chirong 11 dira ra mot so mach Crng dung ky thuat digital, nhir trong dung cu dem tan, do do rong xung va trong dong ho digital... Co the xem chirong 11 nhir la mot so bai tap Ion, Crng dung ky thuat digital, tir do, ta co the van dung ky thuat digital vao cac Crng dung khac trong doi song hang ngay. Voi dung y cuon sach Ky thuat digital - ly thuyet va Crng dung diroc viet de pho cap rong rai kien thCrc ve digital, voi cach trinh bay de hieu, co nhieu vi du, nhieu bai tap va loi giai. Tac gia rat mong cuon sach diroc dong dao cac cong nhan lanh nghe cung nhir cac sinh vien cao d in g va dai hoc nganh dien tir - vien thong va may ti'nh, cac ban yeu thi'ch ky thuat dien tir digital rut ra diroc nhCrng dieu bo ich tu” cuon sach nay. Trong qua trinh bien soan va in an, cuon sach khong the tranh khoi con nhCrng thieu sot. Chung toi rat mong ban doc thong cam va gop y xay diing, de trong Ian tai ban, cuon sach diroc hoan thien hon. Chung toi xin gCri toi Ban Bien tap Nha Xuat ban Lao dong - Xa hoi loi cam on chan thanh ve sir giup do qui bau cua Qui Ban, de cuon sach s 6 m dGOc ra m§t ban doc. DO KIM BANG 4
  5. CHUONG 1 HE THONG SO VA M A ■ Hoc xong chuang nay, hoc vien co kha nang: □ Hieu dwoc cac he dem thap phan, nhi phan, bat phan va thap luc phan. □ Chuyen doi d'uoc cac so tit he thap phan sang cac he nhi phan, bat phan va thap luc phan va ngwoc lai. □ Tinh d'L/oc cac gia tri cua cac so phan nguyen va phan phan tit cac he nhi phan, bat phan va thap luc phan sang cac so tuong ditong cua he thap phan va ngitdc lai. □ Hieu diroc cac cau true mot so ma thong thudng dung trong ky thuat digital. TONG QUAN Khi noi den so dem, moi ngirdi deu nghT ngay den he thap phan v 6 i 10 con so: 0, 1,2, 3, 4, 5, 6 , 7, 8 , 9. May vi tinh hien dai khong xir ly so thap phan. Thay vao do la he thong so nhi phan sir dung 2 con so: 1 va 0. Nhi/ng khi sir dung so nhi phan, muon the hien mot so thap phan co tri so tirong doi Ion bang so nhi phan thi so nhi phan do kha dai. Do do, ngirdi ta thirdng sir dung cac so bat phan va thap luc phan de rut ngan chuoi so nhi phan. Chirong nay trinh bay cac he nhi phan, bat phan va thap luc phan v 6 i muc di'ch khong chi dem diroc cac so theo cac he dem tren day ma con nghien ciru each chuyen doi tir he dem thap phan sang cac he dem nhi phan, bat phan va thap luc phan va ngiroc lai. Chu’Ong nay cung de cap den cac ma nhi phan thirdng diroc su' dung trong cac he thong digital. 5
  6. 1.1. SO NHj PHAN Cac may vi ti'nh va cac he thong digital deu dira tren co so hoat dong nhi phan (2 trang thai). Vi du, khoa chuyen mach trong Hinh 1.1a co the diroc dong lai hoac mo ra. Do do, khoa chuyen mach la mot vi du ve thiet bi nhi phan don gian nhat. Tranzito trong cac mach dien tir dung trong cac he thong va cac may tinh digital diroc thiet ke de hoat dong tirong hop v 6 i he thong nhi phan, do la hien tirong ngirng dan hoac dan bao hoa cua tranzito. Ket qua la 6 ngo ra cua mach tranzito co mot trong hai trang thai mire dien ap cao hoac mire dien ap thap. Khi quan sat tin hieu digital tren may hien song thay dien ap hoac 6 m ut thap hoac 6 mire cao. Cac tin hieu digital nay thay doi mire dien ap khi may vi ti'nh hoat dong, cac dien ap nay xuat hien nhir la cac xung (Hinh1.1b) 5V 5V +v cy +5v o
  7. Cac luy thi/a co so 10 :103, 102, 101, 10° la cac trong so. Cac so 2, 9, 4 va 5 la cac he so. Ti'ch trong so va he so cho gia tri cua moi vi tri con so. Tong tat ca cac ti'ch cho gia tri cua so thap phan do. 6 vi du tren, 2 nhan vdi trong so 1000, 9 nhan v6 i trong so 100, 4 nhan vdi trong so 1 , tong so la: 2000 + 900 + 40 + 5 = 2945 - Trong so nhj phan Bang cach tirong tir, ta co the viet lai mot so nhi phan nao do voi cac trong so. Vi du: so nhi phan 111 diroc viet la: 111 = 100 + 10 + 1 (1.3) Bieu thirc (1.3) viet dirdi dang thap phan: 7=4 +2 + 1 (1.4) Khi viet so nhi phan nhir trong bieu thirc (1.3) ta se lam mot viec tirong tir phan doan so thap phan thanh don vi, 2s va 4s nhir trong bieu thirc (1.4). So co trong so nho nhat diroc goi la LSD, so 1 6 ben phai, co trong so nho nhat; so co trong so I6 n nhat diroc goi la MSD, so 4 6 ben trai day so co trong so Idn nhat. Noi cach khac, moi vi tri so cua so nhi phan co mot trong so. Vi tri thCr nhat 6 ben trai, so 1, (trong so nhoi nhat. Vi tri thCr hai tir ben phai co trong so 2, so ben trai lien ben co trong so 4. Cac trong so nay co so mu cua luy thira 2 tang len, do do, co the viet phirong trinh (1.4) nhir sau: 7 = 1. 22 + 1. 2 1 + 1. 2° Moi khi gap so nhi phan ta co the xac dinh diroc mot so thap phan tirong dirong nhir sau: 1. Khi co so 1 6 mot vi tri con so, hay cong trong so cua vi tri do. 2. Khi co so 0 6 mot vi tri con so, bo qua trong so cua vi tri do. Vi du, so nhi phan 101 tirong dirong vdi so thap phan la: 4 + 0 + 1 =5 Mot vi du khac, so nhi phan 1011 tirong dirong voi so thap phan la: 8 + 0 + 2 + 1=11
  8. Phi/dng phap doi so nhj phan ra thap phan theo thu tuc sau: 1. Viet so nhi phan. 2. Viet tri/c tiep dirdi so nhi phan cac so 1, 2,4, 8 , 16...va viet tu1phai qua trai. 3. Neu co so 0 0 mot vi tri con so, xoa bo trong so 0 vi tri do. 4. Cong cac trong so con lai ta diroc so thap phan tirong dirong. Vi du: Hay chuyen doi so nhi phan 101 thanh so thap phan tirong dirong: B l/ oc 1: 1 0 1 B l/ oc 2:4 2 1 Bade 3: 4 (2) 1 B l/Oc 4: 4 + 1 =5. Vi du: Hay chuyen doi nhanh so nhi phan dirdi day thanh so thap phan ti/Ong dirong: 1 0 1 0 1 16 (8 ) 4 (2) 1 = 21 - Phan phan cua so nhj phan Ta da nghien ciTu phan nguyen. Vay phan phan cua so nhi phan diroc chuyen doi thanh so thap phan tirong dirong nhir the nao? Vi du, so thap phan nao tirong dirong vdi so nhi phan 0, 101? Trong trirdng hop nay cac trong so cua cac vi tri tir phia phai dau phay cua so nhi phan la: 1 / 2 ; 1/4, 1/8, 1/16 v.v... Neu viet diroi dang luy thira cua 2, cac trong so la: 2"1 , 2 "2 , 2 '3, , v.v... hoac dirdi dang thap phan la: 0,5; 0,25; 0,125; 0,0625; v.v... -> ^ f O vi du nay, phan phan cua so nhi phan 0,101 la: 0 , 1 0 1 0,5 (0) 0,125 = 0,625 Vi du khac, so thap phan tirong dirong cua 0,1101 la: 0, 1 1 0 1 0,5 0,25 0 0,0625 = 0,8125 - So nhj phan hon hop Doi vdi cac so hon ho'p (cac so co ca phan nguyen Ian phan phan) ta thirc hien cac quy t§c chuyen doi da thao luan 6 tren cho cac phan nguyen va phan phan. Cac trong so cua cac so hon hop la:
  9. v V....23 22 21 2°, 2~1 2 "2 2“3 / dau phay nhi phan 9 , - Bieu do may vi tinh Khi nghien cifu cac so nhi phan, ta hieu biet sau sac them ve cau tao ben trong cua mot may vi tinh. Hinh 1.2 la cac phan co ban cua mot may vi ti'nh diroc gidi thieu nhir sau: Ngo vao: la noi dira chirong trinh va so lieu vao may, 6 may vi tinh ngo vao bao gom ban phim de chuyen doi ky tir (chCr va so) thanh chuoi cac so lieu nhi phan. Bo nhd: la noi chirong trinh va so lieu diroc liru trir trudc khi tinh toan. Cung vay, khi ti'nh toan, bo nhd liru tru” cac tra loi trung gian, tirong ti/ nhir cach ta v ln lam khi ti'nh toan. Bo nhd cua may vi tinh gom co ROM (bo nhd chi doc) va RAM (bo nhd viet va doc). Dieu khien: phan nay cua may vi ti'nh trong qua trinh ti'nh toan khong nhd con ngirdi can thiep vao. Phan dieu khien noi cho cac phan cua may vi ti'nh cach xir ly so lieu nhir the nao. ^ Phep tinh so hoc va logic: phan nay la cong, trCr, nhan va chia. Phan nay cGng thirc hien cac phep tinh logic nhir OR, AND, NOR, NAND v.v... Ngo ra: la phan de chuyen Idi giai cuoi cung ra ben ngoai. Phan ngo ra cua may vi ti'nh la man hinh cho phep ngirdi sir dung thay diroc cac so lieu da diroc xir iy- BO DIEU KHIEN NGO VAO BO NH0 KHOI SO HOC VA LOGIC NGO RA rr Tt v Hinh 1.2: Cac phan co ban cua mot may vi ti'nh 9
  10. Trong bang dirdi day thong ke cac luy thira cua 2 va so thap phan tirong dirong cua chung, cung cac so K. Ky hieu K thay cho 1024. Do do, 1K bln g 1024. 2K bang 2048. 4K b ln g 4096 v.v... Nhieu may vi tinh ca nhan (PC) co cac bo nho 64K, dieu do co nghla la chung co the liru trir 65.536 byte trong phan bo nhd chi ra 6 Hinh 1.2 Bang 1.1. Cac luy thira cua 2 CAC LUY THUA SO THAP PHAN CAC LUY THUTA SO THAP PHAN KY HIEU TUUNG OUtfNG TUtfNG BlTCfNG CUA 2 CUA 2 2° 1. 28 256 21 2 29 512 22 4 2'o 1024 1K 23 8 2i ’ 2048 2K 24 16 2« 4096 4K 25 32 2 1S 8192 8K 2 14 2s 64 16384 16K 27 128 215 65536 32K 1.3. CHUYEN DOI THAP PHAN - NHj PHAN Cach chuyen doi so thap phan thanh so nhi phan tirong dirong la cach tien hanh ngiroc vdi cach chuyen doi da di/oc mo ta 0 tren. + Vi du, muon chuyen doi so thap phan 9 thanh so nhi phan tirong dirong, dieu can thirc hien la bieu thi diroc 9 la tong cua cac luy thira cua 2, roi viet 1 va 0 0 cac vi tri cua cac con so: So thap phan ^ 9 = 8 + 0 + 0 + 1 So nhi phan ► 1 0 0 1 + Mot vi du khac: Chuyen doi so thap phan 25 thanh so nhi phan tirong dirong: So thap phan: ^ 25 = 16 + 8 + 0 + 1 So nhi phan: ► 1 1 0 1 - Phirong phap chia tuan tir cho 2 Phirong phap pho bien de chuyen doi cac so thap phan sang nhi phan la cach chia tuan tir so thap phan cho 2. viet so du” sau moi phep chia. Cac so dir du'o'c slip xep theo thir tu ngu'dc se cho ta so nhi phan tuong dirong. Cach tot nhat de hieu phirong phap nay la thirc hien vi du dudi day: Cach chuyen doi so thap phan 53 ra so nhi phan nhir the nao? 10
  11. Thi/c hien chia Phan dir 53:2 = 26 1 So co trong so nho nhat (LSD) 26:2 = 13 0 o 13:2 = 6 1 ♦o-o 0 '
  12. Vi du: Chuyen doi so 0,95 ra so nhi phan nhir sau: 0,95 X 2 - 1,9 = 0,9 vdi so nh6 la 1 0,9 X 2 = 1,8 = 0,8 1 O) c '
  13. - Sir chuyen doi bat phan - thap phan Sir chuyen doi tir bat phan sang thap phan nhir the nao? Trong he bat phan moi vi tri con so tirong ung voi luy thtia co so 8 nhir sau: 83 82 81 8° , 8“ 1 8‘‘2 8~3 dau phay bat phan Do do, de chuyen tu" bat phan sang thap phan, ta nhan moi so bat phan vdi trong so cua no va cong tat ca cac ti'ch iai: Vi du: so bat phan 23 chuyen doi sang thap phan nhir sau: 2 x (8 1) + 3 x (8 °) = 16 + 3 = 19 Mot vi du khac, doi so bat phan 257 thanh thap phan: 2 x (8 2) + 5 x (8 1) + 7 x (8 °) = 128 + 40 + 7 = 175 - Chuyen doi thap phan sang bat phan Sir chuyen doi thap phan - bat phan diroc thirc hien nhir the nao? 6 day, thay the cho phep chia cho 2 , ta chia cho 8 (co so 8 ), ghi lai phan dir sau moi phep chia. Cac so dir theo mot trat tir ngiroc tao nen so bat phan. Vi du, chuyen doi sang bat phan so thap phan 175 nhir sau: 0 2 (so dir thu* 3) 8) 2 5 (so du1 thu* 2) 8)21 7 (so du* thu* nhat) 8)175 Viet gon lai nhir sau: 0 2 21 8) 175 Ket qua la: 17810 = 2578 - Phan phan Voi cac so phan cua he bat phan, phep nhan thay the cho phep chia va viet so nho vao phan nguyen. Vi du, chuyen doi phan phan cua so thap phan 0,23 thanh phan phan cua so bat phan: 13
  14. 0,23 x 8 = 1,84 = 0,84 vdi so nh6 la 1 o o- 0,84 x 8 = 6,72 = 0, 72 vdi so nhd la 6 *o '«D 0,72 x 8 = 5,76 = 0,76 vdi so nhd la 5 o V. V. . . Cac so nhd doc theo chieu xuong cho phan phan cua so bat phan. Neu doi hoi co do chi'nh xac cao hon, ta tiep tuc nhan se diroc nhieu con so bat phan hon. Ket qua la: 0,2310 = 0,1658 ? 9 - Chuyen doi bat phan - nhj phan Vi 8 (co so cua he bat phan) la luy thira 3 cua 2 (co so cua he nhi phan), nen ta co the chuyen doi tir bat phan sang nhi phan bang cach chuyen moi so bat phan sang so nhi phan tirong dirong. + Vi du, chuyen so bat phan 43 thanh so nhi phan tirong dirong nhir sau: So bat phan ► 4 l i So nhi phan -----► 100 011 O day, moi so bat phan chuyen sang nhi phan tirong dirong (4 tro thanh 100, 3 tro thanh 011). So nhi phan 100 011 tirong dirong voi so bat phan 43. thirdng thi bo khoang trong giira cac nhom 3 bit, dieu do lam cho viec doc so nhi phan de dang hon. + Mot vi du khac, mot so bat phan diroc chuyen thanh nhi phan nhir sau: So bat phan — ► 3 5 7 4 1 1 So nhi phan — ► 011 101 111 100 Ket qua la: 3574 8 = 01 11 011 1 1 1 002. + Mot vi du khac: khong kho khan gi khi chuyen so bat phan hdn hop (ca phan nguyen Ian phan phan) sang so nhi phan tirong dirong. So bat phan 34.562 trd thanh: So bat phan -----► 3 4 5 6 2 I 1 1 1 1 -----► 011 100 101 110 So nhi phan 010 Ket qua la: 34,5628 = 01 1 100.101 1 100102 - Chuyen doi nhi phan - bat phan Chuyen doi tir nhi phan sang bat phan la thirc hien ngiroc lai thu tuc trirdc day. De dang nhd lai rang moi nhom gom 3 bit, b£t dau tinh tir dau phay nhi phan roi chuyen moi nhom thanh so bat phan tu'Ong dirong (them so 0 vao moi dau cua 14
  15. day nhi phan cho day nhom neu can thiet). Vi du, so nhi phan 1011,01101 chuyen nhir sau: 1011 ,01101 "► 001 011 011 010 1 1 1 So bat phan hon hop -> 1 3 3 2 Bat dau tif dau phay nhi phan, thu’c hien theo hai hirdng, tach cac bit thanh nhom 3. Trong trirdng hop nay, them cac so 0 de cac nhom ben ngoai cung diroc day 3 bit. Chuyen moi nhom thanh so bat phan tuting di/Ong. Ket qua la: 1011,011012 = 13,328 Viec chuyen doi de dang tis bat phan thanh nhi phan va ngiroc lai co nhieu iru viet vi lay tin ra hoac cho tin vao he thong digital it doi hoi ve cau true mach vi chung de dang doc va in ra so bat phan hon la so nhi phan. Mot iru viet khac nira la cac so thap phan Idn diroc chuyen doi de dang sang nhi phan neu trirdc het chuyen sang bat phan, roi sau do chuyen sang nhi phan. Vi du: chuyen doi so thap phan 363 thanh so nhi phan. Tri/dc het doi sang bat phan 0 5 o 5 5 o- *o =3 45 3 -
  16. - Chuyen doi thap luc phan - nhj phan Muon chuyen doi mot so thap luc phan sang so nhi phan, ta chuyen doi moi con so thap luc phan thanh 4 bit tirong di/Cng khi dung ma ghi trong Bang 1.2: So thap luc phan va cac so thap phan, nhi phan tirong dirong" Vi du, chuyen so thap luc phan 9 A F thanh nhi phan, ta thirc hien nhir sau: 9 A F ------ so thap luc phan i i i 1001 1010 1111 * so nhiphan - Chuyen doi nhj phan - thap luc phan Chuyen doi ngiroc lai, tir nhi phan sang thap luc phan, ta lai dung ma trong Bang 1.2. O day co 2 vi du, + So nhi phan 1000 1100 chuyen sang thap luc phan nhir sau: D00 1100 ▼ ▼ 8 C + So nhi phan: 1110 1000 0110 chuyen sang thap luc phan nhir sau: 1110 1000 1101 0110 I I I I E 8 D 6 Trong 2 vi du tren, ta deu bat dau bang so nhi phan va ket thuc bang so thap luc phan tirong dirong. Bang 1.2: So thap phan va cac so thap luc phan, nhi phan tirong dirong s6 th Ap phan s6 th Ap luc ph An s6 NHI ph An 0 0 0 0 0 0 1 1 0 0 0 1 2 2 0 0 10 3 3 0 0 11 4 4 0 10 0 5 5 0 10 1 6 6 0 110 7 7 0 111 8 8 10 0 0 9 9 10 0 1 10 A 10 10 11 B 1 0 11 12 C 110 0 13 D 1 1 0 1 14 E 1 1 1 0 15 F 1 1 1 1 16
  17. - Chuyen doi thap luc phan - thap phan: Chuyen doi so thap luc phan sang thap phan nhir the nao? Trong he thap luc phan, moi vi tri con so ti/Ong ifng vdi luy thira c0 16. trong so cua cac vi tri so trong he thap luc phan nhir sau: 163 162 161 16° , 16“ 1 16~2 16-3 Dau phay thap luc phan Do do, de chuyen doi tir thap luc phan sang thap phan, ta nhan moi con so thap luc phan vdi trong so cua no, roi cong tat ca cac ti'ch lai vdi nhau. Vi du, so thap luc phan F 8 E 6 , 3 9 chuyen sang thap phan nhir sau: F 8 E 6 , 3 9 = Fx (163) + 8 x (162) + E x (161) + 6 x (16°)+ 3 x (16~1)+ 9 x (16“2) = 15 x (163) + 8 x (162) +14 x (161)+ 6 x (16°)+ 3 x (16~1)+ 9 x (16~2) = 61.440 + 2048 + 224 + 6 + 0,1875 + 0,0352 = 63.718,2227 - Chuyen doi thap phan - thap luc phan Cach chuyen doi thap phan - thap luc phan bang cach chia lien tiep cho 16, ghi lai cac so dir tirong tir nhir cac cach doi thap phan sang nhi phan va bat phan tren day. Vi du, chuyen doi so thap phan 2479 thanh so thap luc phan nhir sau: 0 9 — >• 9 o 9 10 —> A Xo- D 13 154 15 “ > F ▼ •
  18. - Sur dung ma ASCII Ma ASCII (doc la as-ki) la ma 7 bit x6, x5, x4, x5, x4, x3, x2, x1t x0, trong do. x la so 0 hoac so 1. Vi du, chCr A di/pc ma hoa la: 1000001, de de doc, ta viet 100 0001 . Bang 1.3 gi6 i thieu ma ASCII. Doc Bang 1.3. tirong tir nhir doc bang graph. Vi du, chCr A co day bit x 6 x5 x4 la 100 va day bit x3 x2 x1 xO la 0001. Do do, ma ASCII la: 100 0001 (A) Bang 1.3 co so ma cho chCr thirdng. ChCr a co ma la: 110 0001 (chuf a) Cac vi du khac la: 110 0010 (chCr b); 110 0011 (chCr c) v.v.... Trong BANG 1.3 cum SP thay cho khoang trang (space). Go vao thanh SP cua ban phi'm ASCII la nap vao may vi tinh ma 010 0000 (space) - Bit chin le Ma ASCII diroc dung de truyen tren dirong day dien thoai. Nhir vay co the khi truyen dan gay ra sai loi. Mot bit ch in le thirdng diroc sir dung de truyen dan cung vdi cac bit goc de phat hien cac sai loi. Mot bo kiem tra bit chan le d dau thu co the kiem tra bit chan va bit le xem co trung hop vdi bit c h in bit le da dirpc sap xep trirdc d may phat va may thu hay khong. Vi ma ASCII co 7 bit, them mot bit chan le de tao nen so lieu diroc truyen di la 8 bit, co ki'ch cd sau: x7 X6 X5 X4 X3 X2 Xt x0 /* bit chin, bit le Day la do dai ly tirong vi hau het thiet bi digital diroc xac lap de truyen di cac byte (8 bit) so lieu. 1.7. MA D J 3 Ma dir 3 la ma 4 bit quan trong, thirdng dupe dung vdi ma BCD. De chuyen doi so thap phan nao do thanh dang ma dir 3, them 3 vao mdi con so thap phan, roi chuyen do’i tong do thanh so nhi phan 4 bit. Vi du, chuyen do’i so thap phan 12 thanh ma du13. Trirdc het cong them 3 vao moi con so thap phan: 1 2 +3 + 3 4 5 18
  19. BANG 1.3: MA ASCII X*X,X4 W A 010 011 100 101 110 111 0 0 0 0 SP 0 @ p P 0 0 0 1 1 1 A Q a q 0 0 10 " 2 B R b r 0 0 11 # 3 C S c s 0 10 0 $ 4 D T d t 0 10 1 % 5 E U e u 0 1 1 0 & 6 F V f V 0 111 7 G w w 10 0 0 ( 8 H X h X 10 0 1 ) 9 I Y i V 10 10 * J Z z .i 1 0 11 + K k 110 0 1 < L I 110 1 - = M m 1 1 1 0 > N n 1 1 1 1 / 7 O o Sau do, chuyen doi cac tong nay thanh ma BCD 4 5 ^ I 0100 0101 Nhir vay, 0100 001 la ma dir 3 thay the cho so thap phan 12. Mot vi du khac, chuyen doi so 29 thanh ma du" 3: 2 9 +3 +3 5 12 1 0101 1100 Sau khi da cong 9 vdi 3, khong nho 1 vao cot ben ma chuyen doi nhir da tien hanh d tren. Do do, 0101 1100 la ma dir 3 thay the cho so thap phan 29. Mach ti'ch hop dung de chuyen doi ma dir 3 thanh thap phan thirdng dirpc dung la 7443. IC TTL nay co 4 ngo vao cho ma dir 3 va 10 ngo ra cho so thap phan (xem thong so cua IC 7443) 1.8. MA GRAY Bang 1.4 gidi thieu ma GRAY, tirong Crng vdi so nhi phan. Moi so cua ma GRAY khac vdi so trudc 1 bit. Vi du, d so thap phan tir 7 den 8 , so ma GRAY thay 19
  20. doi tir 0100 den 1100, cac so nay chi khac 6 bit co trong so Idn nhat (MSB). Nhi/ trong mot vi du khac, so thap phan 13 va 14 dupe chuyen doi thanh ma GRAY la 1011 va 1001; cac so nay chi khac mot vi tri so (vi tri thu1 hai ke tir ben phai). Nhir vay, trong toan bo ma GRAY, moi so chi khac 1 bit v 6 i so trirdc. Ngoai ma du” 3 va ma GRAY, con co nhieu loai dang ma nhi phan, nhir ma BCD, ma nay con dirpc goi la ma 8 4 2 1. Bang 1.4: Ma Gray THAP PHAN MA GRAY NH|PHAN THAP PHAN MAGRAY NHI PHAN 0 0000 0000 8 1100 1000 1 0001 0001 9 1101 1001 2 0011 0010 10 1111 1010 3 0010 0011 11 1110 1011 4 0110 0100 12 1010 1100 5 0111 0101 13 1011 1101 6 0101 0110 14 1001 1110 7 0100 0111 15 1000 1111 20

CÓ THỂ BẠN MUỐN DOWNLOAD

Đồng bộ tài khoản