1. Trang chủ
  2. » Mẫu Slide

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

178 19 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 178
Dung lượng 15,33 MB

Nội dung

Trong cong nghiep tin hoc, ngirdi ta da thong nhat dung ma ASCII (ASCII: American Standard Code for Information Interchange)... tirong tir nhir doc bang graph..[r]

(1)

C H U B IE N : PTS D K I M B A N G

i

/ A /

LY THUYET & UNG DUNG

1010101010101010100101010101

r \ / i

0 O l o I

M

-N H A m J A T B A -N L A O D O -N G / X A H r "

(2)

PTS DO KIM BANG

Bien soan

'M

g f -1

k y m m s o

Z7

n r mJ

K y

m

B< i i: ys; i iiA i K’jfljS M

1EUKG TAM HQC U f 0

(3)

LQ1 H B & I

Ngay nay, ky thuat digital dUOc ap dung rong rai nhieu ITnh virc Cac mach digital dude dira vao sirdung hang loat cac san pham dien tif, nhi/ cac thiet bi vien thong, may ti'nh, ti_r dong hoa, cac choi co mach dien tCr, cac he thong nghe nhin, gia dung, dung cu 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 doi song Be tiep thu cac kien thud de cap cuon sach nay, ban doc can co nhCrng kien thud thong ve toan va ve mach dien tir Ky thuat digital dude nghien ciru trutic hoac nghien cuti song song v6i 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 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 tu1 digital Cuon sach dirpc xem nhir la tai lieu tham khao hCru dung vi ti'nh th u t 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 khai quat ve cac he thong so nhi phan, bat phan va thap luc phan, moi lien quan giCra cac he thong vdi he thong so thap phan, chi/Ong cGng gidi thieu tong quan cac ma diroc sCr dung ITnh vi/c vien thong va may tfnh Chutfng 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 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 noi ve phep cong, phep trif so hoc, cac phep bu 1, bu va cac bo niTa cong va cong day du, de tirdo, ta hieu di/Oc can ke cac bo cong va bo trir ChiTOng gidi thieu cac ho IC TTL va CMOS, noi dung de cap phan 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 cac mach digital Noi dung cac Chuting 6, ChiTOng va ChGOng 8 di/oc u'ng dung nhieu 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, gidi thieu trigo Schmitt, loai trigo co dac ti'nh quan trong, dude su' dung de tao nen cac xung nhip; Chudng cung gidi thieu cac loai mach dao dong, mach tao xung nhip Noi dung ChUdng thirc chat la cac u’ng

(4)

dung dac ti'nh cua cac flip flop diroc ti'ch hap 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 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 cac mach dien tir digital Chirong 11 dira mot so mach Crng dung ky thuat digital, nhir dung cu dem tan, do rong xung va 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 doi song hang

Voi dung y cuon sach Ky thuat digital - ly thuyet va Crng dung diroc viet de 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 diroc nhCrng dieu bo ich tu” cuon sach

Trong qua trinh bien soan va in an, cuon sach khong the tranh khoi nhCrng thieu sot Chung toi rat mong ban doc thong cam va gop y xay diing, de 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 ve sir giup qui bau cua Qui Ban, de cuon sach s6m dGOc m§t ban doc

(5)

CHUONG 1

HE THONG SO V A 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 ky thuat digital.

TONG QUAN

Khi noi den so dem, moi ngirdi deu nghT den he thap phan v6i 10 so: 0, 1,2, 3, 4, 5, 6, 7, 8, May vi tinh hien dai khong xir ly so thap phan Thay vao la he thong so nhi phan sir dung so: va Nhi/ng 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 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 trinh bay cac he nhi phan, bat phan va thap luc phan v6i muc di'ch khong chi dem diroc cac so theo cac he dem tren day ma 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 cung de cap den cac ma nhi phan thirdng diroc su' dung cac he thong digital

(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 Hinh 1.1a co the diroc dong lai hoac mo Do do, khoa chuyen mach la mot vi du ve thiet bi nhi phan don gian nhat

Tranzito cac mach dien tir dung cac he thong va cac may tinh digital diroc thiet ke de hoat dong tirong hop v6i he thong nhi phan, la hien tirong ngirng dan hoac dan bao hoa cua tranzito Ket qua la 6 ngo cua mach tranzito co mot 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 u t thap hoac 6 mire cao Cac tin hieu digital thay doi mire dien ap may vi ti'nh hoat dong, cac dien ap xuat hien nhir la cac xung (Hinh1.1b)

5V 5V

+v o

< ►

cy +5v

-+ Q I Q~r»- —#-o o-l

ov _

_L_ <

a) b)

Hinh 1.1 Cac vi du ve sir dung so nhi phan

Tom lai, cac khoa chuyen mach, cac tranzito va cac linh kien digital khac deu dira tren co so he nhi phan Oieu noi len rang so nhi phan rat thuan tien dung vao viec phan tich va tong hop cac mach digital Ngoai ra, can biet cach dem so nhi phan va chuyen doi so nhi phan thap phan va ngiroc lai

1.2 CHUYEN DOI NHI PHAN - THAP PHAN

Co the bieu dien so nguyen bat ky cac so don vi, chuc, tram, nghin Vi du, so thap phan 2945 co the viet thanh:

2945 = 2000 + 900 + 40 +

(1.1)

Bieu dien diroi dang luy thira cua co so 10, bieu thirc (1.1) co the viet lai la: 2945 = 2.103 + 102 + 101 + 10°

(1.2) f

" t ^

Vi tri cac so

(7)

Cac luy thi/a co so 10 :103, 102, 101, 10° la cac so Cac so 2, 9, va la cac he so

Ti'ch so va he so cho gia tri cua moi vi tri so Tong tat ca cac ti'ch cho gia tri cua so thap phan

6 vi du tren, nhan vdi so 1000, nhan v6i so 100, nhan vdi so 1, tong so la:

2000 + 900 + 40 + = 2945

- Trong so nhj phan

Bang cach tirong tir, ta co the viet lai mot so nhi phan nao voi cac so

Vi du: so nhi phan 111 diroc viet la: 111 = 100 + 10 + (1.3)

Bieu thirc (1.3) viet dirdi dang thap phan: = 4 + +

(1.4)

Khi viet so nhi phan nhir bieu thirc (1.3) ta se lam mot viec tirong tir phan doan so thap phan don vi, 2s va 4s nhir bieu thirc (1.4)

So co so nho nhat diroc goi la LSD, so 6 ben phai, co so nho nhat; so co so I6n nhat diroc goi la MSD, so 6 ben trai day so co so Idn nhat

Noi cach khac, moi vi tri so cua so nhi phan co mot so Vi tri thCr nhat 6 ben trai, so 1, (trong so nhoi nhat Vi tri thCr hai tir ben phai co so 2, so ben trai lien ben co so

Cac so co so mu cua luy thira tang len, do, co the viet phirong trinh (1.4) nhir sau:

7 = 22 + 21 + 2°

Moi gap so nhi phan ta co the xac dinh diroc mot so thap phan tirong dirong nhir sau:

1 Khi co so 6 mot vi tri so, hay cong so cua vi tri Khi co so 6 mot vi tri so, bo qua so cua vi tri Vi du, so nhi phan 101 tirong dirong vdi so thap phan la:

4 + + =

(8)

Phi/dng phap doi so nhj phan 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 tu1 phai qua trai Neu co so 0 mot vi tri so, xoa bo so 0 vi tri

4 Cong cac so lai ta diroc so thap phan tirong dirong

Vi du: Hay chuyen doi so nhi phan 101 so thap phan tirong dirong:

Bl/oc 1: 1

Bl/oc 2:4

Bade 3: (2)

Bl/Oc 4: + =5

Vi du: Hay chuyen doi nhanh so nhi phan dirdi day so thap phan ti/Ong dirong:

1 1

16 (8) (2) = 21

- Phan phan cua so nhj phan

Ta da nghien ciTu phan nguyen Vay phan phan cua so nhi phan diroc chuyen doi 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 cac 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 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,5 (0) 0,125 = 0,625 Vi du khac, so thap phan tirong dirong cua 0,1101 la:

0, 1 0

0,5 0,25 0,0625 = 0,8125

- So nhj phan hon hop

(9)

v V 23 22 2 2°, 2~1 2 "2 2“3

/

dau phay nhi phan

9 ,

- Bieu may vi tinh

Khi nghien cifu cac so nhi phan, ta hieu biet sau sac them ve cau tao ben 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) chuoi cac so lieu nhi phan

Bo nhd: la noi chirong trinh va so lieu diroc liru trir trudc tinh toan Cung vay, ti'nh toan, bo nhd liru tru” cac tra loi trung gian, tirong ti/ nhir cach ta v ln lam 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 cua may vi ti'nh qua trinh ti'nh toan khong nhd 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 la cong, trCr, nhan va chia Phan cGng thirc hien cac phep tinh logic nhir OR, AND, NOR, NAND v.v

Ngo ra: la phan de chuyen Idi giai cuoi cung ben ngoai Phan ngo 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

(10)

Trong bang dirdi day thong ke cac luy thira cua va so thap phan tirong dirong cua chung, cung cac so K Ky hieu K thay cho 1024 Do do, 1K b ln 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 co nghla la chung co the liru trir 65.536 byte phan bo nhd chi 6 Hinh 1.2

Bang 1.1 Cac luy thira cua

CAC LUY THUA CUA

SO THAP PHAN TUUNG OUtfNG

CAC LUY THUTA CUA

SO THAP PHAN TUtfNG BlTCfNG

KY HIEU

2° 28 256

2 29 512

22 2'o 1024 1K

23 i ’ 2048 2K

24 16 2« 4096 4K

25 32 1S 8192 8K

2s 64 14

16384 16K

27 128 215 65536 32K

1.3 CHUYEN DOI THAP PHAN - NHj PHAN

Cach chuyen doi so thap phan 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 so nhi phan tirong dirong, dieu can thirc hien la bieu thi diroc la tong cua cac luy thira cua 2, roi viet va 0 cac vi tri cua cac so:

So thap phan ^ = 8 + + +

So nhi phan ► 0 1

+ Mot vi du khac: Chuyen doi so thap phan 25 so nhi phan tirong dirong:

So thap phan: ^ 25 = 16 + 8 + +

So nhi phan: ► 1

- Phirong phap chia tuan tir cho 2

Phirong phap bien de chuyen doi cac so thap phan sang nhi phan la cach chia tuan tir so thap phan cho 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 la thirc hien vi du dudi day:

(11)

Thi/c hien chia 53:2 = 26 26:2 = 13 13:2 = 6:2 = 3:2 = 1:2 =■ 0

Ket qua la: 5310

Phan dir

1 0 0 1 110101,

So co so nho nhat (LSD)

o o-♦o D '<& JZ O

So co so Idn nhat (MSD)

- Phircfng phap trir

Be thirc hien viec chuyen doi so thap phan sang so nhi phan, ngoai phirong phap chia lien tiep so thap phan cho 2, co phirong phap trir bang cach don gian viet cac gia tri cua cac so luy thira 2 cho den so co gia tri gan vdi so thap phan can chuyen doi Sau do, trir lien tiep so thap phan cho cac so luy thira Neu phep trir di/oc thirc hien vi so luy thira nho hon so thap phan, ta viet so nhi phan 1 vao vi tri bit tirong Crng v6i so luy thira Neu so luy thira I6n hon so thap phan 6 phan dir, ta viet so 0 vao vi tri tirong ting cua so luy thira va tiep tuc thirc hien cac bu6c cho cac so luy thira ke ben Oe biet cach chuyen doi so thap phan sang so nhi phan bang cach trir, tot hon het ta lam vi du sau day

Vi du, hay chuyen doi so thap phan 50 sang so nhi phan So luy thira Idn nhat nho hon so 50 la 32 Viet cac so luy thira tir 25 tro xuong Phirong phap trCr diroc thirc hien nhir sau:

50

-22.

18

l f i _

-2 32 16 1 0

Ket qua la: 5010 = 1100102

- Phan phan

Ta nhan phan phan cua so thap phan voi 2, ghi lai so nhd 6 vi tri nguyen Cac so nho doc theo chieu xuong la phan phan cua so nhi phan

(12)

Vi du: Chuyen doi so 0,95 so nhi phan nhir sau:

0,95 X - 1,9 = 0,9 vdi so nh6 la

0,9 X = 1,8 = 0,8 O )

c

0,8 X = 1,6 = 0,6

'<o

a X

0,6 X = 1,2 = 0,2 o

o-♦o

0,2 X = 0,4 = 0,4 '<0)

0,4 X - 0,8 - 0,8 i

J Z

r O

0,8 X = 1,6 = 0,6

Doc cac so nhd theo chieu tCr tren xuong cho ta phan phan cua so nhi phan 0,1111001 Trong trirdng hop nay, ta dung phep chuyen doi sau nhan diroc so nhi phan Vi ly do, Idi giai diroc xem la gan dung Neu can chi'nh xac hon nCra, ta tiep tuc nhan cho 2 den co nhieu so va dat mire chi'nh xac can thiet

Ket qua la: 0,9510 = 0,11110012

- Doi so nhj phan gom toan so 1

Khi nao mot so nhi phan co toan so 1, co the tim so thap phan tirong dirong bang cach dung cong thu’c sau: so thap phan = 2n - 1, 6 day n la so bit

+ Vi du: 1111 co bit, do, so thap phan tirong dirong la: So thap phan 24 - 1 = 15

Ket qua la: 11112 = 1510

+ Mot vi du khac: 1111 1111 co 8 bit, nen:

So thap phan tirong dirong = 28 - = 255 Ket qua la: 1111 111 12 = 25510

1 s o b A t p h a n

Co so cua mot he thong so bang so cac so ma he thong sir dung He thong so thap phan co co so la 10 vi he thong co cac so tir den He nhi phan co co so vi no chi dung so va so He bat phan co co so 8 Ta co the sir dung 8 so thong thirdng, la 8 so dau tien:

0, 1, 2, 3, 4, 5, 6,

(khong co so 8 va he thong so bat phan)

(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 so tirong ung voi luy thtia co so 8 nhir sau:

83 82 8° , 8“ 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 so cua no va cong tat ca cac ti'ch iai:

Vi du: so bat phan 23 chuyen doi sang thap phan nhir sau: x (81) + x (8°) = 16 + = 19 Mot vi du khac, doi so bat phan 257 thap phan:

2 x (82) + x (81) + x (8°) = 128 + 40 + = 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: (so dir thu* 3)

8) (so du1 thu* 2) 8)21 (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 phan phan cua so bat phan:

(14)

0,23 x 8 = 1,84 = 0,84 vdi so nh6 la 0,84 x 8 = 6,72 = 0, 72 vdi so nhd la 6 0,72 x 8 = 5,76 = 0,76 vdi so nhd la

o o-*o '«D

o

V V

Cac so nhd doc theo chieu xuong cho phan phan cua so bat phan Neu doi hoi co chi'nh xac cao hon, ta tiep tuc nhan se diroc nhieu so bat phan hon

Ket qua la: 0,2310 = 0,1658

?

- Chuyen doi bat phan - nhj phan

Vi 8 (co so cua he bat phan) la luy thira cua (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 so nhi phan tirong dirong nhir sau:

So bat phan ►

l i

So nhi phan -► 100 011

O day, moi so bat phan chuyen sang nhi phan tirong dirong (4 tro 100, tro 011) So nhi phan 100 011 tirong dirong voi so bat phan 43 thirdng thi bo khoang giira cac nhom bit, dieu lam cho viec doc so nhi phan de dang hon

+ Mot vi du khac, mot so bat phan diroc chuyen nhi phan nhir sau:

So bat phan — ►

1 1

So nhi phan — ► 011 101 111 100

Ket qua la: 35748 = 01 11 011 11002

+ Mot vi du khac: khong kho khan gi 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 -► 6 2

1 1 1 1I

So nhi phan -► 011 100 101 110 010

Ket qua la: 34,5628 = 011100.1011100102

- Chuyen doi nhi phan - bat phan

(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

-> 1 3 2

So bat phan hon hop

Bat dau tif dau phay nhi phan, thu’c hien theo hai hirdng, tach cac bit nhom Trong trirdng hop nay, them cac so de cac nhom ben ngoai cung diroc day bit Chuyen moi nhom so bat phan tuting di/Ong

Ket qua la: 1011,011012 = 13,328

Viec chuyen doi de dang tis bat phan nhi phan va ngiroc lai co nhieu iru viet vi lay tin hoac cho tin vao he thong digital it doi hoi ve cau true mach vi chung de dang doc va in 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 chuyen sang nhi phan

Vi du: chuyen doi so thap phan 363 so nhi phan Tri/dc het doi sang bat phan

0 45 8) 363

5

o o-*o

=3

-<Q)

_C

O

Tiep theo, doi so bat phan 553 so nhi phan tirong dirong:

So bat phan ► 5

So nhi phan * 101 101 011

Ket qua la: 36310 = 5538 = 1011010112

1.5 SO THAP LUC PHAN

So thap luc phan diroc sir dung rong rai doi vdi (iP Trirdc het, so thap luc phan ngan hon so thap phan Dieu lam cho de viet va de nhd cac so thap luc phan Hon nura, ta co the nham moi chuyen sang he nhi phan

He thap luc phan co co so 16, co tat ca 16 so tir so den so 9, tir A den F Noi mot cach khac, sau dem den so he thap luc phan, ta tiep tuc dem nhir sau:

A, B C, D, E, F

(16)

- Chuyen doi thap luc phan - nhj phan

Muon chuyen doi mot so thap luc phan sang so nhi phan, ta chuyen doi moi so thap luc phan bit tirong di/Cng dung ma ghi Bang 1.2: So thap luc phan va cac so thap phan, nhi phan tirong dirong"

Vi du, chuyen so thap luc phan A F 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

Bang 1.2 O day co 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 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

s thApphan s thAplucphAn s6 NHI phAn

0 0 0

1 0

2 0

3 0 1

4 0

5 1

6 1

7 1

8 0

9 0

10 A 1

11 B 1

12 C 1 0

13 D 1

14 E 1

(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 so ti/Ong ifng vdi luy thira c0 16 so cua cac vi tri so he thap luc phan nhir sau:

163 162 161 16° , 16“ 16~2 16-3

Dau phay thap luc phan

Do do, de chuyen doi tir thap luc phan sang thap phan, ta nhan moi so thap luc phan vdi so cua no, roi cong tat ca cac ti'ch lai vdi

Vi du, so thap luc phan F 8 E 6 , chuyen sang thap phan nhir sau: F 8 E 6 , = F x (163) + 8 x (162) + E x (161) + 6 x (16°)+ x (16~1)+ x (16“2)

= 15 x (163) + 8 x (162) +14 x (161)+ 6 x (16°)+ x (16~1)+ 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 so thap luc phan nhir sau:

0 — >•

9 10 — > A

154 15 “ > F ▼

16)2479

Ket qua la: 247910 = 9AF16

o

o-XD

13

•<gj O

1.6 MA ASCII

De xuat nhap tin tir may vi ti'nh, ta can vai loai ma so alpha (loai ma cho cac chCr, cac so va cac ky tir khac) Co mot thdi, cac nha san xuat da dung cac ma so alpha rieng cua minh, dan den sir roi loan viec san xuat, vi nhieu loai ma khac diroc dung vao viec xuat nhap tin Trong cong nghiep tin hoc, ngirdi ta da thong nhat dung ma ASCII (ASCII: American Standard Code for Information Interchange) Ma cho phep nha san xuat tieu chuan hoa phan cCrng cua may vi ti'nh nhir ban phim, may in va man hinh

(18)

- Sur dung ma ASCII

Ma ASCII (doc la as-ki) la ma bit x6, x5, x4, x5, x4, x3, x2, x1t x0, x la so hoac so Vi du, chCr A di/pc ma hoa la: 1000001, de de doc, ta viet 100

0001.

Bang 1.3 gi6i thieu ma ASCII Doc Bang 1.3 tirong tir nhir doc bang graph Vi du, chCr A co day bit x6 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 SP cua ban phi'm ASCII la nap vao may vi tinh ma 010 0000 (space)

- Bit ch in le

Ma ASCII diroc dung de truyen tren dirong day dien thoai Nhir vay co the truyen dan gay sai loi Mot bit c h 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 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 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 la ma bit quan trong, thirdng dupe dung vdi ma BCD De chuyen doi so thap phan nao dang ma dir 3, them vao mdi so thap phan, roi chuyen do’i tong so nhi phan bit

Vi du, chuyen do’ i so thap phan 12 ma du1 Trirdc het cong them vao moi so thap phan:

1

+ +

(19)

BANG 1.3: MA ASCII

W A

X*X,X4

010 011 100 101 110 111

0 0 SP @ p P

0 0 1 A Q a q

0 " B R b r

0 1 # C S c s

0 0 $ D T d t

0 1 % E U e u

0 1 & F V f V

0 1 G w w

1 0 ( H X h X

1 0 ) I Y i V

1 * J Z .i z

1 1 + K k

1 0 < L I

1 1 - = M m

1 1 > N n

1 1 / O o

Sau do, chuyen doi cac tong ma BCD

4

^ I

0100 0101

Nhir vay, 0100 001 la ma dir thay the cho so thap phan 12 Mot vi du khac, chuyen doi so 29 ma du" 3:

2

+ +

5 12

1

0101 1100

Sau da cong vdi 3, khong nho vao cot ben ma chuyen doi nhir da tien hanh d tren Do do, 0101 1100 la ma dir thay the cho so thap phan 29

Mach ti'ch hop dung de chuyen doi ma dir thap phan thirdng dirpc dung la 7443 IC TTL co ngo vao cho ma dir va 10 ngo cho so thap phan (xem thong so cua IC 7443)

1.8 MA G R A Y

Bang 1.4 gidi thieu ma GRAY, tirong Crng vdi so nhi phan Moi so cua ma GRAY khac vdi so trudc bit Vi du, d so thap phan tir den 8, so ma GRAY thay

(20)

doi tir 0100 den 1100, cac so chi khac 6 bit co so Idn nhat (MSB) Nhi/ mot vi du khac, so thap phan 13 va 14 dupe chuyen doi ma GRAY la 1011 va 1001; cac so chi khac mot vi tri so (vi tri thu1 hai ke tir ben phai) Nhir vay, toan bo ma GRAY, moi so chi khac bit v6i so trirdc

Ngoai ma du” va ma GRAY, co nhieu loai dang ma nhi phan, nhir ma BCD, ma dirpc goi la ma 8

Bang 1.4: Ma Gray

THAP PHAN MA GRAY NH|PHAN THAP PHAN MAGRAY NHI PHAN

0 0000 0000 1100 1000

1 0001 0001 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

(21)

CAU HOI VA BAI TAP

1.1. Bieu dien mot so he dem thap phan dtidi dang luy tnira 1.2 Trong so la gi?

1.3. Vi tri cac so day so la gi?

1.4. Cho vi du ve he dem thap phan dudi dang luy thu’a Xac dinh vi tri cac so, so va he so cua day so

1.5. Cho vi du ve he dem nhi phan

1.6. Bieu dien he dem nhi phan cau hoi dirdi dang luy thu’a cd so

1.7. Neu i/u diem va nhUdc diem cua he nhi phan

1.8. Mot Nibble co bao nhieu bit?

1.9. Hai Byte co bao nhieu bit?

1.10. The nao la LSD va MSD, cho vi du?

1.11. Trong ngon ngCrdung a he nhi phan, IK, 2M, 1G la gi?

1.12. Co the doi so nhi phan sang bat phan b ln g cach ghep cac ky so nhom moi nhom co bao nhieu bit?

1.13. Co the doi so nhi phan sang thap luc phan bang cach ghep cac ky so nhom, moi nhom co bao nhieu bit?

1.14. De bieu dien cung mot gia tri cua so thap phan vi du so 2004 so co co so ion hay nho can it so nhat (do dai so ngan nhat)?

1.15. Chuyen doi nhi phan sang than nhan va ngiroc lai viec chuyen doi nao de thu’c hien hon?

1.16. Cac kv tir dude ma hoa he thong ma ASCII nhir the nao?

1.17. Hai ky so thap luc phan la du de bieu dien so nhi phan bao nhieu bit9

1.18. May tinh the he hien dai hoat dong theo he bao nhieu bit?

1.19 So nhi phan dirdi day co bao nhieu bit, bao nhieu Nibble va bao nhieu Byte?

a) 1001

b) 1100 1010 c) 0010 1100 0111

d) 1010 0111 1100 1000

1.20* Doi cac so thap phan bang diTo'i day cac so thap luc phan, bat phan va nhi phan:

(22)

D O I R A C A C SO T H A P P H A H

-N H ! P H A -N B A T P H A N T H A P LU C P H A N

3579 246810 86420 45678910 97531

1.21* Doi cac so nhi phan bang dirdi day cac so thap luc phan, thap phan va bat phan:

- - - R A C A C SO

S O N HI P H A N ~ — — - _

B A T P H A N T H A P P H A N T H A P LU C P H A N

1010 1100 0001 0000 1010 0111 1010 0110 0101 1111 0100 1110

0010 1010 0011 1011 0100 1100

1.22. Doi cac so thap phan dirdi day cac so nhi phan: a)15,4

b)254;12 c) 511,015

1.23. Doi cac so nhi phan duoi day cac so thap phan: a) 10,1110

(23)

C H U O N G 2

CAC CONG LOGIC,

D A I SO LOGIC, PHAN TICH

V A TONG HOP MACH LOGICa ■

Hoc xong chwong nay, hoc vien co kha nang:

Hieu di/oc cac dac trung cua cac cong logic: Invectd (cong dao), OR, AND, NOR NAND, X-OR, va X-NOR,

Xay di/ng di/dc cac mach logic theo cac bang st/ that

Ap dung cac he thC/c logic, cac phi/dng phap tong cua tich va tich cua tong de toi i/u cac mach logic

Ap dung phwong phap Karnaugh de toi i/u mach logic.

TONG QUAN

Chirong thao luan ve cac cong logic, nhir cac cong INVECTO (cong dac), AND, OR, NAND, NOR , dong thdi thao luan ve cac bieu thu’c dai so logic, nhCrng he thu’c dai so Boole va hai dinh ly De Morgan

Chirong cung nghien ciru cac phirong phap gian iroc mach logic bang cac phuo'ng phap tong cua tich, tich cua tong va bang phirong phap Karnaugh

(24)

2.1 CONG DAO (iNVECTO )

- Vi sudung hoat dong hai trang thai?

Hoat dong hai trang thai la hoat dong rat thudng gap cac thiet bi dien tir digital, vi day la cach hoat dong co tin cay cao cua tranzito va cac thiet bi chuyen mach khac Voi hoat dong hai trang thai, tat ca cac tin hieu de dang diroc nhan biet vdi hai trang thai hoac 6 mud dien ap thap hoac 6 mire dien ap cao Dieu don gian co y nghia quan de xay dung cac mach may tinh va cac thiet bi ky thuat so khac co tin cay, vi cac linh kien tich cuc chi can xuai hien hai trang thai: hoac dong hoac mo

- Surdung tranzito lam khoa chuyen mach

Dung tranzito lam chuyen mach, co nghia la sir dung dac tinh dan bao hoa va ngirng dan cua tranzito Khi dan bao hoa, tranzito diroc coi nhir la mot khoa chuyen mach dan dien (kin mach) Khi tranzito ngirng dan, no dude coi nhir khoa chuyen mach bi ho (hd mach) Nhir vay, tranzito co trang thai hoat dong: kin mach va ho mach

• Mach cuc phat chung (Emito chung): Mach gidi thieu tren Hinh 2.1a la mach Emito chung Dong lb bang:

lb - (V,n ■ VBE )/Rb (2.1)

Vi co khuech dai dong cua tranzito nen dong I bang:

- Pdc ( - )

Va dien ap Vout (dien ap ngo ra) la: V = V out cc - I R'c' 'c

“ I

1

Hinh 2.1a: Mach Ennto chung Hinh 2.1,b: Cach ve gian irdc cua Hinh 2.1a

Duong tai: Hinh 2.2 bieu thi dirong tai DC va AC Khi Vin b ln g tronq

Hinh 2.1, tranzito d trang thai cat mach va diem hoat dong o' dau dirdi cua dirong tai Trong trirdng hdp tranzito dude xem nhir mot chuyen mach ho circ adz

-cu t phat (Colecto va Emito) Mat khac V „ Idn tranzitd o' che bao hoa va diem hoat dong 0 dau tren cua dudng tai mot cach ly tudng tranzito diroc xem nhu mot chuyen mach kin mach

(2.3)

(25)

Bao hoa cirng: Bao hoa cirng co nghia la tranzito co dong ciTc goc (ci/c Bado) du Ion de tranzito hoat dong 6 dau tren cua dudng tai Dan bao hoa mem khong du tin cay hau het cac truong hop vi co sir bien thien cua pdc (cung giong nhir hFE). Mach che bao hoa mem co the de dang chuyen sang che bao hoa vi ly thay doi nhiet hoac thay the tranzito

• Bao hoa curig co nghia la tranzito co dong 011*0 goc du Idn de di/Oc bao hoa du’di moi dieu k.ien hoat dong De co diroc bao hoa cirng, ngi/di thiet ke tinh toan cho c bao hoa3 idn gap xap xi 10 Ian gia tri cua IB bao hoa Ti so 10:1 du nho de

hau het cac tranzito tri bao hoa moi tri/dng hop nhi/ nhiet tang qua, thay the tranzito hoac thay doi dien ap cung cap

Rc

Hinh 2.2a Dudng tai Hinh 2.2b Tranzito ngirng dan Hinh 2.2c Tranzito dan Vi du dien ao vao V , tren Hinh 2.3 hoac la 0V hoac la +5V Khi V m bang 0V, tranzito cat mach va luc Vout bang +5V Khi Vin bang +5V tranzito hoat dong d che bao hoa cirng, va Vou, xap xi bang Trong trirdng hop lc bi0 hoa , ly tirong, la bang 5mA Bo qua gia tri VBEcua tranzito, lEba0hoa xap x' bang 0,5mA Do do, ti so dong lcb3ChCa/lBbaohoa xap xi bang 10:1

Khi dien ap ngo vao circ dai bang dien ap cung cap tranzito co the dat diroc che bao hoa cu'ng sir dung ti so xap xi 10:1 doi vdi RB/R; Vi du RB = 10 kQ, va R = kQ, nhir Hinh 2.3: ti so cua RB/R- b ln g 10 vi vay tranzito hoat dong d che bao hoa cu’ng Vdi cac gia tri khac, chang han nhu' RB = 47 kQ va Rc = 4,7 kQ, tranzito cung van hoat dong d che bao hoa cu'ng vi ti so RJR

bang 10

(26)

- Invectd dung tranzito

Bat ky Invecto nao cung chi co mot ngo vao va mot ngo Dirge goi la Invecto la vl trang thai 0 ngo luon luon trai ngiroc voi trang thai 6 ngo vao Dien hinh la dien ap ngo vao 6 muO dien ap cao (H) thi dien ap 6 ngo 6 muC dien ap thap (L) Ngiroc lai, dien ap ngo vao 6 mCrc dien ap thap (L) thi dien ap ngo o mCrc dien ap cao (H)

Hinh 2.3 la mot vi du cua Invecto ^Vi dien ap ngo vao chi co the co hai gia tri: (OV hoac + 5V), tranzito hoac ngirng dan hoac dan bao hoa Vi vay, ta nhan dirge hai trang thai hoat dong, dieu co nghia la dien ap ngo chi co hai gia tri on dinh (gia tri cao hoac gia tri thap)

Bang 2.1 tom tat hoat dong cua mot Invecto va dirge goi la bang si/ that (con goi la bang chan ly) Bang si/ that la bang chi tat ca cac kha nang xay 0 ngo vao, ngo cua mach logic Ngo vao 0 mC/c dien ap thap co ti/ong Crng ngo 6 muO dien ap cao va ngo vao 0 m ut cao co ti/o'ng ting ngo 6 mtic thap Ngo Invecto cGng dirge goi la phan bu cua ngo vao Invecto

Bang 2.1: Invecto

V„ ^0«T

Mifc thap (L) MlTc cao (H)

MC/c cao (H) MCrc thap (L)

- Ky hieu cua Invecto

Dung tranzito tren Hinh 2.3 la cach don gian nhat xay di/ng mot Invecto Co nhieu cach thiet ke de tao nen Invecto co tro khang vao va tro khang di/gc cai thien Hinh 2.4a la ky hieu cua Invecto Doi 6 mot so so mach, ngi/di ta dung ky hieu tren Hinh 2.4b mat ngdng (vong tron nho) nam o phia ngo vao Khi nao ta thay mot hai ky hieu can nho rang ngo la phan bu cua ngo vao

Hinh 2.5 gidi thieu IC 7404 la IC TTL Day la IC digital, 14 chan, dang DIP (Dual in line package: IC hinh hop, co hang chan), co 6 cong Invecto Chan 14 ket noi vdi nguon cung cap + Vcc va chan ket noi v6i dat GND

Hinh 2.4a: Ky hieu cong Invectd Hinh 2.4b: Cach ky hieu khac cua cong Invectd

Vcc

fi4i iru mn rrri rroi i~9i r~si

IC 7404

1

I

I

Dl

V i n l

— Vin2

L

D2

A D l

D2

p.i

i _

:

(27)

2.2 CONG HOAC (OR)

Mot cong OR co hai hoac nhieu ngo vao cua tin hieu nhi/ng chi co mot ngo Dirpc goi la cong OR vi dien ap ngo 0 mtic cao (H) neu mot hoac tat ca cac dien ap 6 ngo vao deu 6 mtic cao (H) Vi du, ngo cua cong OR hai ngo vao dat mtic cao neu mot hai ngo vao hoac ca hai ngo vao deu 0 mtic cao

Himh 2.6a bieu thi cach xay di/ng cong OR hai ngo vao va Hinh 2.6b don gian hoa cach ve cua Hinh 2.6a Cac dien ap ngo vao dirpc ky hieu la A va B va dien ap ngo dupe ky hieu la Y Hay gia du cac dien ap ngo vao hoac la OV (mtic thap L) hoac la +5V (mtic cao H) Chi co trifdng hop xay ra:

Trudng hop 1: A 6 mtic thap va B cung 6 mtic thap Vdi hai ngo vao cung 0 mtic thap, dien ap ngo cung a mtic thap vi ca hai diot deu khong dan Do do, Y 0 mtic thap L

Truong hop 2: A 6 mtic thap B 6 mtic cao’ H Dien ap ngo vao B 6 mtic cao (+5V), diot dirdi co thien ap thuan, dan den dien ap 6 ngo dat mtic ly ti/dng la +5V, hoac xap xi +4,3V, neu co ti'nh den dien ap dat tren diot Du dien ap ngo Y 0 mtic +5V hoac +4,3V thi dien ap ngo Y van 0 mtic cao Chu y rang, diot tren co thien ap ngi/pc

Truong hop 3: A 6 mtic cao B 6 mtic thap Vi ti'nh doi xting cua mach, nen mach hoat dong tirong tir nhir 6 trudng hop 2. Diot tren 0 trang thai dan diot diroi 6 trang thai ngirng dan, dien ap ngo Y o mtic cao

Trudng hop 4: A 6 mtic cao va B cung 6 mtic cao Voi ca hai ngo vao deu co dien ap o mtic cao (+ 5V), ca hai diot deu co thien ap thuan Vi dien ap ngo vao mac song song, dien ap ngo dat mtic ly ti/dng la + 5V Do Y dat mtic cao (+ 5V)

- Bang sir that

Bang 2.3 la bang sti that bieu thi du'di dang nhi phan Khi xem xet bang ta thay co lien quan den Bang 2.4, H la mtic dien ap cao (High) +5V, co ma la 1; L la mtic dien ap thap (Low) V, co ma la

Tom lai, qua moi quan he gitia trang thai ngo rs vdi trang thai ngo vao, cong OR la cong co dien ap ngo o' rntic mot hoac tat ca cac ngo vao 6 mtic

Bang 2.3: Cong OR ngd vao Bang 2.4: Cong OR ngo vao Bieu thi bang mtic dien Bieu thi bang so nhi phan

ft B Y

L L L

L H H

H L H

H H H

A B Y

0 0

0 1

1

1 1

Ghi chu:

H: mtic dien ap cao (High) +5V 0: ma bie’u thi mtic dien ap thap L: mtic dien ap thap (Low) ) 0V 1: ma bie'u thi mtic dien ap cao

(28)

Ky hieu logic

Hinh 2.7: Cac cong OR a) ngo vao; b) ngo vao; c) ngo vao

Doi vdi cac cong OR nay, ngo se 0 mu’c neu mot hoac mot vai hoac tat ca cac ngo vao 0 mu’c Chi co mot cach de ngo 6 mu’c la tat ca cac ngo vao deu 0 mu’c 0

- Cong OR TTL

Hinh 2.8 la so chan IC 7432, loai IC TTL co cong OR ngo vao Day la IC digital, 14 chan, dang DIP (Dual in line package: IC hinh hop, co hang chan) Sau noi chan 14 vdi nguon cung cap Vcc (+ 5V), va noi chan vdi dat GND, ta co the noi mot hoac nhieu cong OR vdi cac IC TTL khac

Hinh 2.8: So chan IC 7432

- Bieu thdi gian

Hinh 2.9 la bieu thdi gian cua cong OR ngo vao Cac dien ap vao dUOc dira den chan va cua IC 7432 Chan 6 mu’c chi ca hai ngo vao deu d mu’c

0 Ngoai dieu kien tren, ngo co mu’c vi mot hoac ca hai chan deu o mu’c

Hinh 2.9: Bieu thdi gian

Chan

Chan

Chan

A B C D E F G H I

(29)

2.3 CONG VA (AND)

- Cong AND ngo vao

Cong AND co ngo d mtic chi tat ca cac ngo vao 6 mtic

Hinh 2.10a chi cach xay dting cong AND ngo vao Hinh 2.10b la cach ve gian udc cua Hinh 2.10a Cac dien ap vao co ten la A va B, dien ap ngo co ten la Y Gia dinh rang dien ap cung cap la + 5V Ta cung gia dinh rang cac dien ap ngo vao hoac la 0V hoac la + 5V Chi co trudng hop xay 6 ngo vao:

+ Vcc

Hinh 2.10a: Cong AND ngo vao Hinh 2.10b: Hinh ve gian Udc

Trudng hap 1: A = 0, B = 0, ca hai dien ap ngo vao deu 6 mUc Catot cua moi diot dupe noi dat Do do, ca hai diot dupe phan cUc thuan va noi song song Vi vay, dien ap ngo ly tudng bang (xap xi bang 0,7 V) Dieu co nghia la Y =

Trudng hap 2: A = 0, B = Vi A = 0, nen diot phi'a tren dupe phan cuc thuan, day dien ap ngo xuong mUc Vi ngo vao B = 1, nen diot phi'a du6i co phan cuc ngupc Do do, dien ap ngo ly tudng bang 0V (hoac xap xi bang 0,7V), Y =

Trudng hap 3: A = 1, B = Vi mach doi xUng, nen mach hoat dong tuong tu trudng hop Diot phi'a tren ngung dan, diot phi'a dudi dan, Y =

Trudng hap 4: A = 1, B = 1, ca hai ngo vao deu bang +5V, ca hai diot deu khong dan Vi cac diot deu ngung dan, khong co dong chay qua R , va ngo dupe keo len dien ap cung cap (+5V), Y = 1.

- Bang su that

Bang 2.4 la Bang suthat cu3 cong AND ngo vao Khi xem xet bang suthat ta thay cong AND co ngo Y = chi A = va B = Noi cach khac ngo Y = chi tat ca cac ngo vao co mUc dien deu bang

(30)

Bang 2.4: Cong AND ngo vao Bang 2.5: Tiidng di/ong nhi phan

A B Y

0 0

0

1 0

1 1

A B Y

L L L

H L L

H L L

H H H

Bang 2.5 la bang tucsng dirong nhi phan cua Bang 2.4, 6 day, mu’c thap (L) co ma la 0, mu’c cao (H) co ma la

- Ky hieu logic

Hinh 2.11: Cong AND 2, 3, va 12 ngo vao

Hinh 12: So chan IC 7408

- Cong AND ngo vao

Khi tat ca cac ngo vao 6 mu’c 0, tat ca cac ngo vao deu dan, do ngo Y = Ngay chi co mot ngo vao a mu’c 0, Y cGng bang 0, vi diot dirge noi voi ngo vao 6 mu’c se 6 trang thai dan Chi co mot kha nang de ngo 6 mu’c la tat ca cac ngo vao deu O mu’c (+ 5V) Khi tat ca cac diot deu ngung d in va dien ap cung cap (+ 5V) keo ngo len trang thai

Bang 2.6: Bang sir that cua cong AND ngo vao v6i ma nhi phan

A B c Y

0 0

0

0 0

0 1

1 0

1

1 0

(31)

- Cac cong AND TTL

Sau noi dien ap cung cap +5V vao chan 14 va tiep dat chan 7, ta co the noi mot cong hoac cac cong AND vdi cac IC TTL khac

- Bieu thdi gian

Hinh 2.13 la bieu thdi gian cua cong AND ngo vao Cac dien ap ngo vao dira den chan va cua IC 7408 Chan la ngo 6 mu’c chi ca chan ngo vao deu 6 mu’c (giCra cac thdi diem C va D, G va H v.v ) Ngo 6 mUc doi v6i cac khoang thdi gian lai

Chanl

Chan2

Chan3

2.4 CONG HOAC-OAO (NOR)

- Ky hieu cong NOR

Mach logic 6 Hinh 2.14 dirpc goi la cong NOT-OR vi ngo bang: Y = A + B

Bieu thirc tren doc la "Y bang NOT cua A OR B", hoac "Y bang phan bu cua A OR B" Vi mach la cong OR dirpc noi tiep voi cong dao, cach nhat de co ngo bang la ca hai ngo vao deu 6 mu’c 0, nhir da chi 6 Bang 2.7

B B

a) Cong NOR b) Ky hieu cong NOR

Hinh 2.14:

Bang 2.7: Bang sir that cong NOR

A B Y

0

f 0

1 0

1

j -1 i -1

A D E H I

Hinh 2.13: Bieu thdi gian

(32)

Mach logic 0 Hinh 2.14b la ky hieu cua cong NOR Vong tron nho 6 ngo nhac ta nhd phai dao sau cong OR Tu’ NOT-OR dirpc rut gon la NOR V6i cong NOR, tat ca cac ngo vao phai 0 mu’c de dat 0 ngo co mCrc Neu ngo vao nao 6 mu’c thi ngo 0 mCrc

2.5 CONG VA-OAO (NAND)

Mach logic 6 Hinh 2.15b la ky hieu cua cong NAND Dau tron nho 6 ngo nhac ta nhd dao sau co’ng AND TCr NOT-AND dirpc rut gon la NAND Vdi cong NAND tat ca cac ngo vao deu d mCrc thi ngo d mCrc Neu ngo vao nao d mCrc 0, thi ngo se d mu’c

- Cong NAND TTL

IC 7400 co co’ng NAND ngo vao Vi co’ng NAND dong vai tro trung tam cong nghe TTL, nen cong NAND di/pc dung rong rai nhat va gia nhat Hon nCra, co’ng NAND co nhieu dang cau tao hon cac loai cong khac, nhir Bang 2.9 da chi Co’ ng NAND co cac loai 2, 3, 4, hoac 8 ngo vao Cac cong khac co it dang cau tao hon, vi du, cong OR chi co moi loai ngo vao (IC 7432)

1

8-1

a) Co’ ng NAND b) Cac ky hieu co’ng NAND

Hinh 2.15:

Bang 2.9: Cac cong TTL tieu chuan

LOAI k CONG

2 NGO VAO

3 C N NGO VAO

2 C d N G ft NGO VAO

1 CONG NGO VAO

NAND 7400 7410 7420 7430

NOR 7402 7427 7425

AND 7408 7411 7421

OR 7432

(33)

2.6 CONG X-OR

Cong X-OR chi'nh la cong Eclusive - OR (con goi la cong OR loai trif), co ngo 0 mu’c chi so le ngo vao 6 mu’c Hinh 2.16 gidi thieu cach xay di/ng cong X-OR

Cong AND phi'a tren co ti'ch A B, cong AND di/6i co ti'ch A B Do do, ngo cua cong OR la:

Y = A B + A B

Dieu gi se xay co cac chan khac mu’c logic? Khi A va B cung 6 mu’c 0, ca hai cong AND co ngo 0 mu’c 0, do Y = Neu A = 0, B = 1, cong AND tren 6 mu’c 1, nen cong OR co ngo Y = Tirong tu”, chan A = 1, B = ket qua cuoi cung la Y = Neu ca hai ngo vao deu 6 mu’c 1, ngo cua ca hai cong AND deu 6 mu’c va cuoi cung Y =

Bang 2.10 la bang sir that cua cong X-OR ngo vao Ngo d mu’c mot hai ngo vao A va B d mu’c 1, ca hai ngo vao cung d mu’c hoac mu’c thi ngo d mu’c Tom lai, ngo bang chi hai ngo vao khac mu’c

Hinh 2.17 la ky hieu cong X-OR ngo vao

Hinh 2.16: Cong X-OR Hinh 2.17: Ky hieu cong X-OR

Bang 2.10: Bang sir that cong X-OR

A B r

0 0

0 1

1

1

- Cong X-OR ngo vao

Hinh 2.18 la hai cong X-OR dieu khien mot cong X-OR Neu tat ca cac ngo vao (A, B C D) deu d mu’c 0, cac ngo vao co cac ngo d mu’c nen loi cua cong cuoi cung d mu’c Neu cac ngo vao A, B C d mu’c D d mu’c 1, nhir

vay cong X-OR d phi'a tren co ngo d mu’c 0, cong X-OR duoi co ngo d rnirc va ngo cuoi cung d mu’c 1

(34)

Hinh 2.18: Cong X-OR ngo vao

Bang 2.11: Cong X-OR ngo vao

NHAN X tT A B c D Y

C h in 0 0

Le 0 1

Le 0 1

Chan 0 1

Le 0

C h in 1

C h in 1 0

Le 1 1

Le 0

C h in 0

C h in 1 0

Le 1 1

C h in 1 0

Le 1 1

Le 1 1

C h in 1 1

Neu tiep tuc phan tich cac hoat dong cua mach vdi cac ngo vao lai, ta co the thiet lap di/dc Bang 2.11 Tu” Bang 2.11 ta co nhan xet quan la so le cac ngo vao d muC se cho ngo 6 mu’c Vi du, cac ngo vao dau tien ABCD = 0001 tao nen ngo bang 1, vi co so le ngo vao co mu’c Cac ngo vao khac tao nen ngo bang la: ABCD = 0010; 0100; 1000; 1110; 1101; 1011; 0111

Hinh 2.18 minh hoa cong X-OR ngo vao Nhin ky hieu ta nho rang cong X-OR se cho ngo d mu’c so cac ngo vao A, B, C, D co so le ngo vao d mu’c 1

2.7 DAI SO LOGIC

- Tong quan

(35)

loai dai so m6i, thay the phirong phap cua Aristote Trong gan mot the ky, dai so Boole chi/a co tac dong den ky thuat va cong nghe, mai den nam 1938, Shannon ap dung dai so Boole vao viec mo ta cac mach dien cua tong dai dien thoai Nho cac cong trinh cua Shannon, ve sau nay, cac nha ky thuat da dung dai so Boole de phan ti'ch va thiet ke cac mach vi tinh

-Toan turNOT

Trong dai so Boole, mot bien co the hoac bang hoac bang Doi vdi cac mach digital, dieu co nghia la tin hieu co the 0 mu’c hoac mu’c 1 Hinh 2.19 la mot vi du cua mach digital, vi dien ap ngo vao va ngo hoac la 6 mu’c 0 hoac 6 mu’c Them vao do, ngo Y luon luon la phan bu cua ngo vao A Phirong trinh logic la:

Y = NOT A Neu A = thi:

Y = NOT = Mat khac, neu A = thi:

y = NOT =

Trong dai so Boole, dau gach tren thay the cho toan tir NOT Nhir vay, phirong trinh logic (2.4) co the viet thanh:

Y = A (2.5)

Bieu thu’c (2.5) dirpc doc la "Y bang NOT A", hoac "Y bang phan bu cua A" Bieu thu’c (2.5) la cach viet chuan cho ngo cua mot cong NOT

- Toan tur OR

Mot cach de bieu thi hoat dong cua cong OR (Hinh 2.20), phirong trinh logic dirpc viet nhir sau:

Y = A OR B (2.6)

Phirong trinh logic noi len rang ngo dirpc xac dinh bang luat OR cua cac ngo vao Vi du, neu A = 0, B = thi:

Y = A OR B = OR = Mot vi du khac, neu A = 1, B = 0, thi:

Y = A OR B = OR = Tirong tir, neu A = 0, B= 1, thi:

Y = A OR B = OR =

Trong dai so Boole, dau + thay cho toan tir OR Nhir vay, viet lai la:

Y = A + B

Bieu thirc tren doc la "Y bang A OR B" Bieu thu’c (2.7) la ngo cua cong OR

bieu thu’c (2.6) dirpc (2.7) cach viet chuan cho

(36)

- Toan tur AND

Phirong trinh viet cho cong AND 6 Hinh 2.21 la: Y = A AND B

(2.8)

Trong dai so Boole, dau nhan (hoac dau cham) thay cho toan tir AND Do do, phirong trinh (2.8) thirdng dirpc viet la:

Y = A B

Hinh 2.19: Cong NOT Hinh 2 : Cong OR Hinh 2.21: Cong A N 2

A_

B-C "

ô ã

E ~ *

Y = ABCDE

Hinh 2 : Cong AND ngo vao

(2.9) Hoac don gian hon nCra, bo dau cham: Y = A B

Bieu thu’c (2.9) la cach viet chuan cho ngo cua cong AND Neu ca hai ngo vao cua cong AND deu 6 mire thi:

Y = A B = =

Vi AND cho gia tri Neu A = 0, B = 1, thi: Y = A B = =

Vi gia tri ngo cua cong AND bang mot hai ngo vao b£ng Neu A = 1, B = 0, thi:

Y = AB = = Ca hai ngo vao bang 1, thi:

Y = A B = 1 =1

- Cac phi/dng trinh dai so Boole cua cac mach logic

(37)

Hinh 2.22 ve hai tang cac cong OR dung !C 7432 Ngo cua cong OR dau tien la:

Y3 = A + B

Chi so dudi cua Y la so thu” tu chan IC theo qui dinh Ngo cua cong OR thu* hai la:

Y6 = Y3 + C = A + B + C Ngo cuoi cung la:

y8 = y6 + d = a + b + c + d

Dieu noi len rang mach logic tren Hinh 2.22 tirong dirong cong OR ngo vao, thirc hien luat OR de cho ket qua ngo cuoi cung

IC 741 I la loai IC TTL, dang DIP 14 chan, gom cong AND ngo vao Thong thirdng dien ap cung cap (+ 5V) dilOc noi voi chan 14 va tiep dat 0 chan

Hinh 2.22 la mach logic noi hai cong AND ngo vao cua IC 7411 Bay gid hay viet phirong trinh dai so Boole cho ngo cuoi cung

Ngo cua cong AND dau la: Y12 = A B C

Day la mot ngo vao cua cong AND thir hai, ngo cuoi cung la: Y6 = Y12 D E = A B C D E

Do do, mach tirong dirong voi cong AND ngo vao

2.8 HAI BjNH LY DE MORGAN

- Cong AND dao ngo vao

Hinh 2.23 co ve cac cong dao 6 ngo vao cong AND, de tien loi ngirdi ta thirdng ve nhir Hinh 2.23 Vong tron nhd d ngo vao nhac ta nhd dao trirdc thirc hien toan tir AND Hay phan tich mach logic doi vdi tat ca cac kha nang co the xay d ngo vao

Trudng hap 1: Neu A = 0, B = 0, cac cong dao tao nen d ngd vao cong AND co mu’c Do do, Y =

Trudng hap 2: Neu A = 1, B = 0, cong dao tren tao nen d ngd vao cong AND co mu’c 0, ket qua la Y =

Trudng hap 3: Neu A = 0, B = cong dao di/di tao nen d ngd vao cong AND cd mu’c 0, ket qua la Y =

Trudng hap 4: Neu A = 1, B = 1, cac cong dao tao nen mu'c d ngd vao cong AND, do Y =

(38)

i O - £ > = D -B

Hinh 2.23a va b: Cong AND dao ngo vao Hinh 2.24: Djnh ly De Morgan thu nhat

Bang 1.12: Cong AND dao ngo vao

A B Y

0

0

1 0

1

- Kha nang thay the

Bang 2.12 la bang su' that cua mach logic Hinh 2.23b So sanh vdi bang su'that cong NOR (Bang 2.7), ta thay hai bang co gia tri nhu Dieu co nghia la cong AND dao ngd vao cho cung gia tri 6 ngo nhir 6 cong NOR Noi cach khac, cac mach co the tir chuyen doi Neu cho mot mach logic nao 0 cong NOR, ta co the thay the moi cong NOR bang cong AND dao ngo vao Ngiroc lai, neu mot mach logic co cac cong AND dao ngo vao, ta co the thay the bang cong NOR Sau nay, cac vi du se chi rang cac cong NOR tirong dirong vdi cac cong AND dao ngo vao, cac cong co nhCrng Crng dung thuc tien

- Djnh ly De Morgan thu" nhat

Phirong trinh dai so Boole cho mach logic 0 Hinh 2.24 la: Y = A + B

Phirong trinh dai so Boole doi vdi Hinh 2.23 la: Y = A B

PhUdng trinh tren mo ta cong NOR, phirong trinh dudi mo ta cong AND dao ngo vao Vi cac ngo dong nhat cung gia tri ngd vao Do do, ta co the viet

A + B = A B (2.10)

Sir dong nhat chinh la noi dung dinh ly De Morgan thir nhat Dinh ly la: "Phan bu cua m ot tong bang tich cua cac phan b u "

Hinh 2.24 neu len y nghia cua dinh ly De Morgan thir nhat

(39)

- Cong OR dao ngo vao

Hinh 2.25 ve cong OR dao ngo vac Mach thirdng dupe ve don gian nhu”

Hinh 2.25, cac vong tron nho dirpc coi nhir la phep dao Hay phan tich mach logic vdi tat ca cac trirdng hop co the xay 0 ngo vao

Trudng hap 1: Neu A = 0, B = 0, cac cong dao tao nen cac ngo vao cong OR 0 mu'c Do do, Y =

Trudng hap 2: Neu A = 0, B == 1, cong dao tren tao nen mot ngo vao cong OR o mire 1, nen Y =

Trudng hap 3: Neu A = 1, B =- 0, cong dao dudi tao nen mot ngo vao cong OR 6 mu’c 1, ket qua la Y =

Trudng hap 4: Neu A = 1, B =: 1, cac cong dao tao nen 6 cac ngo vao cong OR co mu’c 0, do Y =

k r y

a) b)

Hinh 2.25: Cong OR dao ngo vao va ky hieu Hinh 2.26: Djnh ly De Morgan thu1 hai

Bang 2.13: Cong OR dao ngo vao

A B Y

0

0 1

;

j i

1

- Kha nang thay the

Bang 2.13 la bang sir that cua mach logic tren Hinh 2.25 So sanh vdi

Bang 2.8 ta thay hai bang dong nhat vdi nhau, dieu co nghia la cong OR dao ngo vao 6 Hinh 2.25 tao nen cung cac tin hieu ngo nhir cong NAND 6

Hinh 2.15 Cho mot mach logic co cac cong NAND, ta co the thay the m6i cong NAND bang cong OR dao ngo vao Ngiroc lai, neu mach logic co cac cong OR dao ngo vao, ta co the thay the moi cong bang mot cong NAND

- Djnh ly De Morgan thir hai

Phirong trinh logic cua dai so Boole cho Hinh 2.15 la: Y = AB

Phirong trinh logic cua dai so Boole cho Hinh 2.25 la: Y = A + B

Phirong trinh tren mo ta cong NAND va phirong trinh dirdi mo ta cong OR dao ngo vao Vi cac ngo cho ket qua dong nhat doi voi cung cac dieu kien dau vao Ta co the viet:

A B = A + B (2.11)

(40)

Sir dong nhat chi'nh la noi dung dinh ly De Morgan thu1 hai Dinh ly diroc phat bieu nhu sau: "Phan bu cua m ot tich b in g tong cac phan b u "

Hinh 2.26 neu len y nghia cua dinh ly De Morgan thu’ hai 2.9 CAC DINH LUAT VA DINH LY CUA DAI SO BOOLE■ ■ ■ ■

- Cac dinh luat co ban

+ Hoan vi:

A + B = B + A (2.12)

A B = B A (2.13)

Hai phirong trinh chung to rang trat tir cua mot toan tir logic la khong cc y nghia, vi cung mot loi giai nhirng co the thu’c hien bang 2 cach

Hinh 2.27a bieu thi phirong trinh (2.12) Hinh 2.27b bieu thi phirong trinh (2.13) + Lien ket:

A + (B + C) = (A + B) + C (2.14)

A (B C) = (A B) C (2.15)

Cac dinh luat chung to rang trat tir cua tap hop cac bien khong anh hirdng den loi giai cuoi cung

+ Phan 'i

A (B + C) = A B + A C (2.16)

Dinh luat rat de nho vi no gidno dai so thong thirdng

Hinh 2.27e cho thay hai mach logic tirong sing bang Dinh luat phan phoi goi y cho ta ve gia tri cua dai so Booie Neu ta sap xep trirdc mot bieu thirc dai so Boole, cac mach logic tirong ung co the don gian hon Chung ta co the sir dung cac dinh luat de gian irdc nhting bieu thu’c ohCrc tap cua dai so Boole va dat diroc mot mach logic don gian non

lo a n tu OR

Bon he thirc Booie la:

1) He thCfc thCr nhat:

A + = A (2.17)

Dieu noi len rang mot bien thirc hien phep OR vdi mot so lai cho ket qua cninh bien Va nhu' vay neu A = ta co:

0 + =

Khi A = 1, ta co:

1 + 0 = 1

(41)

2) He thirc khac cua Boole:

A + A = A (2-18)

He thu’c hoan toan dung ta thay A nhu’ sau: Neu A = 0, he thu’c (2.18) bang:

0 + = dieu hoan toan dung

Neu A = 1, he thu’c (2.18) bang: + =

dieu cGng hoan toan dung vi thu’c hien luat OR vdi cho ket qua bang Do do, mot bieu thu’c nao thu’c hien luat OR vdi chi'nh no cho ta chi'nh bien

a) b)

> c O

d) e)

Hinh 2.27

3) Mot gui t ic khac cua dal so Boole can biet la:

A + = (2.19)

dieu dung vi neu ta thay A = 0, he thu’c (2.19) la: + =

Neu ta thay A = 1, ne thu’c tien bang:

1 + ^ (2.19b)

d i(?i; dung vi oau t thuc hien phep OK, knong pnai ia phep cong thong thirdng

cm lai he thu’c (2.19) noi len rang neu mot ngd vao cua mot cong OR 6 mu’c 1,

ngd cung bang 1 khong phu thuoc vao cac ngd vao khac

4) Cuoi cung ta co he thirc sau:

A A = (2.20)

Neu A = thi A = va phirong trinh la dung Ngupc lai, neu A = 1, A = 0, phuong trinh van dung Vay mot bien dupe thirc hien phep OR vdi phan bu cua

bien ket qua luon luon bang 1

- "oan tu AND

6’ day co he thirc AND:

t r > L >

(42)

A = A (2.21)

A A = A (2.22)

A = (2.23)

Khi A = 0, nhCrng he thirc tren deu dung Tirong tir, A = 1, moi he thu’c cGng dung Do do, he thu’c tren co the di/pc dung de don gian cac he thCrc phirc tap cua dai so Boole

Mot he thu’c AND nCra la:

A A = (2.24)

Dieu rat de hieu, vi ta co the dat di/dc mot hai gia tri co the xay doi v6i A la:

0 1 = 0 hoac:

1 0 = 0

TCr do, mot bien diroc thirc hien phep AND vdi phan bu cua no luon luon cho ket qua bang 0

- Dao kep va cac djnh ly De Morgan

Qui tac dao kep la:

A = A (2.25)

Dieu chCrng to rang phan bu kep cua mot bien bang chi'nh bien Cuoi cung, co cac dinh ly De Morgan nhir 6 phan tren da trinh bay:

A + B = A B (2.26)

A B = A + B (2.27)

- Djnh ly doi ngau

Bat dau bang mot he thu’c dai so Boole Ta bien doi he thu’c Boole bang cach:

1 Thay dau toan tCr OR bhng dau toan tCr AND 2 Thay dau toan tCr AND b in g dau toan tif OR

3 Thay b in g phan bu neu hoac xuat hien bieu thu’c

Vi du: Phirong trinh (2.17) noi len rang: A + = A

'He thu’c doi ngau la:

A = A

Tinh chat doi ngau dirdc the hien b ln g cach thay dau OR bang dau AND va lay phan bu cua 0 de co gia tri 1

(43)

Vi du, phi/dng trinh (2.16) dUdc chuyen doi nhu” sau: A (B + C) = A B + A C

Biing cach thay doi moi toan tu1 OR va AND, ta co he thu’c doi ngau sau: A + B C = (A +B) (A + C)

Dieu hoan toan moi la, ta chi/a tirng thao luan 6 phan tren

(Neu muon chifng minh, ta xay di/ng bang suthat cho moi ve cua phuo'ng trinh Bang sl/ that cua ve phi/Cng trinh neu dong nhat chirng to he thu’c dai so

Boole la dung)

Bang 2.14: Bang cac he thu’c dai so Boole va cac he thu’c lien quan

A + B = B + A A B - B A

A + (B + C) = (A + B) + C A (B C) = (A B) C

A (B + C) = (A B ) + A C A + B C = (A + B) (A + C)

A + C = A A = A

A + = A =

A + A = A A A = A

A + A = > >l =

A = A A = A

A + B = A B A B = A + B

A + A B = A A (A + B) - A

A + A B = A + B A ( A + B) = A B

2.10 PHlfO NG PHAP TONG CUA TICH

Hinh 2.27 chi tat ca cac kha nang co the xay 6 ngo vao cua cong AND ngo vao Cac ngo dupe goi la cac ti'ch co ban Bang 2.14 liet ke cac ti'ch co ban giong vdi cac dieu kien ngo vao de tao ngo vao 6 mu’c 1

Vi du, A B 6 mu’c A va B 6 mu'c 0: A B o mu'c A = va B = 1 v.v Tu” tu'dng xay di/ng cac tich co ban ap dung cho ba hoac nhieu bien ngo vao Vi du co bien ngo vao A B, C va phan bu cua chung Co 8 kha nang xay dung'tich co ban cho cong AND bien ngo vao va phan bu cua no

A B C , A B C , A B C , A B C A B C A B C , A B C A B C Hinh 2,28a chi tich co ban dau tien Hinh 2.28b la tich co ban thu hai Hinh 2.28c la tich c0 ban thu' ba (Hay tu've cac cong cho cac tich co ban lai)

(44)

A BH C

Y=A B C A

B-| Y=A B C

A B -I C

,Y=

b)

Hinh 2.28

Bang 2.15 tom tat cac ti'ch co ban bang cach liet ke cac dieu kien ngo vao cho ngo co ti'ch c.O ban bang Vi du, A = 1, B = va C = 0, tich co ban cho ket qua cua ngo la:

Y = A B C = =

- Phirong trinh tong cua tich

Van de la 0 cho co bang su1 that nhu” Bang 2.16, lam the nao de co loi giai tong cua cac tich Dieu ma ta phai lam la xac dinh moi ngo 0 mu’c bang sir that va ghi lai ti'ch co ban Vi du* ngo dau tien 6 mu’c xuat hien tirong Crng vdi cac ngo vao A = 0, B = 1, € = 1._Tich co ban ti/ong Crng la A B C Ngo tiep theo 0 mu’c xuat hien v6i A = 1, B = 0, C = Ti'ch co ban tirong Crng la A B C Lam tiep tuc ta dirpc cac ti'ch co ban nhir 6 Bang 2.17 De co phirong trinh tong cua ti'ch, ta thirc hien luat OR doi vdi tich co ban Bang 2.17:

Y = A B C t - A B C + A B C + A B C (2.28)

Bang 2.16: Thiet ke mach logic theo Bang 2.17: Ti'ch co ban tirong Crng bang sir that

A B c Y

0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 1

- Mach logic

(45)

Hinh 2.29 Mach AND-OR la loi giai nha thiet ke tti Bang sir that 2.16 Noi cach khac, mach AND-OR tren Hinh 2.29 co bang sir that cho tren Bang 2.16.

B-C' A. B " C A- 3-C A_ 3-C"

Y= ABC

Y=A3C

Y= ABC

Hinh 2.29: Loi giai AND-OR Hinh 2.30

Ta khong the xay dirng mach nhu’ tren Hinh 2.29 vi khong co IC co cong OR

4 ngo vao NhUng mach tren Hinh 2.30 di/oc cau tao bang cac cong NAND- NAND dung IC 7410 va 7420 la phu hop voi thirc te Cac tin hieu ngo vao diroc lay tir bus (mot nhom day dan mang cac tin hieu logic), tren Hinh 2.30 bus co 6 day dan co cac tin hieu logic A, B, C va phan bu cua chung

2.11 BANG KARNAUGH

Bang Karnaugh cho thay ro co tich co ban can thiet doi v6i Idi giai tong cua tich Vi du, 6 day chuyen doi tir Bang 2.18 sang bang Karnaugh nhir the nao? B£t dau bang ve Hinh 2.31a Chu y rang, cac bien va cac phan bu: 6 cot dting co A, tiep theo la A; hang ngang co B, tiep theo la B Bay gid hay tim ngo 6 mu’c Bang 2.18 Ngo dau tien co mu’c xuat hien doi vdi A = va B = Tich co ban doi vdi dieu kien ngo vao la AB Dira tich co ban vao Bang Karnaugh nhir chi d tren Hinh 2.31b So co tich A B vi so n im 6 hang A va cot B

Tirong tu1, Bang 2.18 co ngo d mu’c tirong ting vdi ngo vao A = va B = Tich co ban la A B, dupe dtia vao bang Karnaugh la dtia cac so vao cac vi tri lai bang Karnaugh (Hinh 2.31d).

Bang 2.18 Bang 2.19

A B r

0 0

0

1

-[ 1

1

A B C Y

0 0

0

0 '

0 1

1 0

-1

0

1 1

1 1

(46)

- Bang bien

Tavebang Karnaugh nhi/ the nao co bang sir that 2.19? Dau tien, ve_bang Karnaugh rong nhir Hinh 2.32a Cot dung gan cac ten la A B, A B, A B va A B Vdi trat tir nay, chi co mot bien thay doi tir dang bu sang dang khong bu (hoac ngi/oc lai, neu di chuyen theo hi/6ng tir dudi len) Tiep theo, hay tim ngo co mu’c 0 Bang 2.19 Cac ngo co mu’c ti/ong Crng vdi cac ngo vao la 010, 110 va 111 Ti'ch co ban doi vdi cac dieu kien ngo vao la A B C, A B C va A B C Dira cac ti'ch di/6i dang cac so vao Bang Karnaugh (Hinh 2.32b) Bi/dc cuoi cung la di/a cac so vao cac vi tri lai (Hinh 2.32c).

Bang 2.20 Bang si/tha t

A B c D T

0 0 0

0 0 1

0 0

0 1

0 0

0 1

0 1

0 1 1

1 0 0

1 0

1 0

1 1

1 0

1 1

1 1

1 1

- Bang bien

Nhieu may vi ti'nh digital va he thong digital xCr ly so bit Vi du, mot vai IC digital lam viec vdi cac so bit nhir 0000, 0001, 0010 v.v Vi ly nay, cac mach logic thirdng dirpc thiet ke de xCr ly cac bien ngo vao bit (hoac cac phan bu cua chung) Do do, ta can biet cach ve bang Karnaugh bien

Gia du rang co bang si/ that nhi/ Bang 2.20 Bat dau bang cach ve bang Karnaugh rong (Hinh 2.33a) Hay chu y cac trat ti/ Cot dC/ng co AB, AB, AB va A B Hang ngang co C D, C D, CD va C D Trong Bang sir that 2.20 co cac ngo ti/ong C/ng vdi cac ngo vao A B C D la 0001, 0110, 0111 va 1110 Cac ti'ch co ban doi vdi cac dieu kien ngo vao la A B C D , A B C D , A B C D va A B C D Sau di/a cac so vao bang Karnaugh, ta co bang tren Hinh 2.33b Birdc cuoi cung la lap day cho bang cac so 0 de hoan tat bang Karnaugh nhi/

(47)

B B B B B B DO

1

D

O

A A A A 0 0

A A 1 A 1 1 A 1 1

a) b) c) d)

H inh 1

c c c c C c

A B A B A B 0 0 A B A B 1 A B 1 0 A B A B 1 1 A B 1 1 A B A B A B 0 0

b)

H inh 2

C D C D C D C D C D C D C P C D

A B y O y i y 3 y 2 A B A B y 4 y 5 y 7 y 6 A B A B y l y l 3 y l y l 4 A B A B y 8 y 9 y l l y l O A B

a )

H inh 3

1 :

b)

C D C D C D C D

A B 0 I 0 0

A B 0 0 1 0 A B 0 0 0 1 A B 0 0 0 1

2.12 CAC NHOM DOI, NHOM BON VA NHOM TAM

- Nhom doi, nhom bon va nhom tarn

Hay quan sat Hinh 2.34a, Bang Karnaugh co mot nhom doi nam ngang (hai so nam lien ke nhau) So dau tien thay cho ti'ch A B C D; so thir hai thay cho ti'ch A B C D Khi chuyen tCr so dau sang so thir hai chi co mot bien chuyen tir dang khong bu sang dang bu (tCr D sang D) cac bien khac khong thay doi dang (A, B va C van giCr nguyen dang khong bu) Khi nao thi co the loai bo cac bien co dang thay doi?

- Kiem tra

Phirong trinh tong cua ti'ch tuong Crng vdi Hinh 2.34a la: Y = A B C D + A B C D

Dat thi/a so chung, co: Y = A B C (D + D)

Vi D diroc thirc hien luat OR vdi phan bu nen phirong trinh don gian la: Y = A B C

(48)

Noi chung, nhom doi n^m ngang nhir tren Hinh 2.34a thi tong cua tich gian irdc diroc bien va phan bu cua bien lai bang mot ti'ch bien

Be de nhan dang, ta khoanh nhom doi Hinh 2.34b Nhir vay, ta nhan thay diroc la mot bien va phan bu cua no diroc gian irdc, ta co mot ti'ch bien la A B C

Lay mot vi du khac, d Hinh 2.35a co nhom doi cac so theo chieu doc Cac so ti/ong Crng vdi A B C D va A B C D Nhan thay rang chi co mot bien thay doi dang tir khong bu sang dang bu (tCr B sang B) Do do, B va B dirpc gian i/dc, cho ta ti'ch A C D

- Cac vl du khac

Moi thay mot nhom doi nam ngang hay nam doc, ta co the loai bo bien xuat hien ca 6 dang bu va khong bu Vi du, 0 Hinh 2.35b cho thay rang bien doi tir dang bu sang dang khong bu chuyen tir so phi'a tren xuong di/di Cac bien khac giCr nguyen Do do, nhom doi dirpc khoanh lai nhir 6 Hinh 2.35b dai dien cho tich A C D Tirong tir, cho nhom doi nhir Hinh 2.35c, chi co bien D chuyen doi dang sang D, nen nhom doi dirpc thay the bang tich A B C

Neu co nhieu hon mot nhom doi bang Karnaugh, ta co the thirc hien tich dirpc gian irdc de co phirong trinh dai so Boole Vi du, nhom doi phi'a dudi 0

Hinh 2.35d thay cho tich dupe gian irdc la A C D, nhom doi phia tren 6 Hinh 2.35d

thay cho tich A B D Phirong trinh dai so Boole doi vdi Bang la; Y = A C D + A B D

- Nhom bon

Nhom bon la nhom bon so nam lien ke theo hi/dng nam ngang hoac hirdng th in g dirng Hinh 2.36 gidi thieu cac dang cua nhom bon Khi xuat hien nhom bon, ta can khoanh lai vi no cho ta mot ti'ch don gian hon Thirc te, mot nhom bon loai trCrdirpc hai bien va phan bu cua no

Tren Hinh 2.36a, nhom bon dirpc coi nhir hai nhom doi (Hinh 2.36c), nhom doi thu” nhat dai dien cho tich A B C , nhom thir hai dai dien cho A B C , phirong trinh dai so Boole cho hai nhom doi la:

Y = A B C + A B C Dat thtia so chung:

Y = A B (C + C) Rut gon thanh:

(49)

C D C D C D c D

A B 0 0

A B 0 0

A B 0 1

A B 0 0

C D C D

A B 0 0

A B 0 0

A B 0 1

A B 0 0

t'irih : N hom d o i n a m rh e o c h - n n e a r?

C D c

A B 0

A B 0

A B 0

A B 0

0 0

0 0 0 0

H inh : N hom dot n a m

a) b)

Nhir vay, nhom bon d Hinh 2.36a dai dien cho ti'ch bien, hai bien da di/pc gian irdc Quan sat nhom bon Hinh 2.36b Ta chon so d diem xuat phat dien ngang, D la bien thay doi dang Khi chuyen doc, B chuyen dang Do do, cac bien lai (A va C) la cac bien nhat co mat ti'ch da diroc gian irdc Noi cach khac phirong trinh toi gian doi vdi nhom bon d Hinh 2.36b la:

Y = A C

- Nhom tarn

Ngoai cac nhom doi, nhom bon co nhom tarn Day la mot nhom gom tarn so nhir tren Hinh 2.37a Mot nnom tarn loai bo diroc ba bien va phan bu cua no Hay xem nhom tarn nhir la hai nhom bon (Hinh 2.37b) Phirong trinh cho hai nhom bon la:

Y = A C + A C Dat thira so chung:

Y = A (C + C) Rut gon lai la:

Y = A

Nhir vay, nhom tarn tren Hinh 2.37a gian irdc diroc bien va phan bu cua chung tich tutfng Crng

2.13 DON GIAN P H JO N G TRiNH LOGIC BANG BANG KARNAUGH

-V i du:

Gia du, ta chuyen bang sir that bang Karnaugh nhir 6 Hinh 2.38a Trirdc het, ta tim cac nhom 8 Neu khong co, ta tim cac nhom Neu cc ta khoanh

(50)

lai Cuoi cung, ta khoanh cac nhom doi Khi hoan viec khoanh nhom ta co bang Karnaugh nhu” 0 Hinh 2.38b.

Nhom doi dai dien cho nhom gian u6c A B D, nhom ben di/61 dai dien tich A C va nhom ben phai dai dien ti'ch C D Bang phep OR cac ti'ch gian i/6c nay, ta co phirong trinh dai so Boole ti/dng irng vdi bang Karnaugh la:

Y = A B D + A C + C D (2.29)

C D C D c D C D C D c D c D C D C D C D C D c D

A B 0 0 A B 0 0 A B 0 0

A B 0 0 A B 0 0 A B 0 0

A B 1 1 A B 0 1 A B 1 1

A B 0 0 A B 0 1 A B 0 0

a ) b) c)

Hinh 2.36: Cac nhom 4

C D C D C D C D c D c D c D C D

A B 0 0 A B 0 0

A B 0 0 A B 0 0

b) A

A B 1 1 B 1 1

A B 1 1 1

A B 1 1

a ) b)

Hinh 2.37: Cac nhom 3

C D C D C D C D C D C D C D C D

A B 1 A B 1

A B 0 A B 0 0 0 1

A B 1 : A B 1 1

A B 1 l A B 1

Hinh 2.38 a Hinh 2.38 b - Cac nhom chong Ian

Ta diroc phep sir dung mot vai so nhjeu hon mot Ian Hinh 2.39a minh hoa dieu So dai dien cho tich co ban A B C D la mot phan cua nhom doi va mot phan cua nhom tarn Phirong trinh don gian doi voi cac nhom chong Ian la:

(51)

C D C D C D C D C D C D C D C D

A B 0 0 A B 0 0

A B 0 A B m 0

A B 1 1 A B i 1

A B 1 1 A B i 1

Hinh 2.39 a Hinh 2.39 b

Neu tach so nhu” Hinh 3.39b, phirong trinh logic tro nen phifc tap hon: Y = A + A B C D

Vi vay, ta luon luon lap nhom chong Ian neu co the Nhu” vay, ta co the dung so nhieu hon mot Ian de lap nhom chong Ian

- Nhom ghep

Hay xem xet Hinh 2.40a Cac nhom doi cho phirong trinh logic :

Y = B C D + B C D (2.31)

Nhir vay, neu ghep nhom doi ben trai vdi nhom doi ben phai cua Bang Karnaugh, ta diroc nhom bon Be bieu thi dieu do, ta ve nira vong cho moi nhom doi, nhu1 Hinh 2.40b TCr do, ta co phirong trinh logic tir nhom bon la:

Y - B D (2.32)

Bieu chac chan dung vi phi/ong trinh (2.31) co the diroc gian irdc bang ap dung he thCrc dai so logic de diroc phi/ong trinh (2.32)

C D C D C D C D C D C D C D C D

A B 0 0 A B 0 0

A B 0 A B 'l 0 1

A B 0 A B 11 0

1

A B 0 0 A B 0 0

Hinh 2.40 a

Kiem tra lai tCrphi/Ong trinh (2.31): Y = B C D + B C D Bat thu’a so chung, ta co:

Y = B D (C + C) Rut gon con:

Y = B D

Hinh 2.40 b

(52)

Phi/ong trinh cuoi cung chi'nh la phirong trinh cua nhom bon ghep tren

Hinh 2.40b Do do, cac so mep bang Karnaugh co the duoc ghep voi cac so ep doi dien

-V i du

Neu co the duoc, ta thiet lap cac nhom ghep, nhom chong Ian V i du,

Hinh 2.41a co nhom tarn va nhom doi, ta co phirong trinh dai so Boole la: Y = C + B C D

Neu ap dung cach thiet lap nhom ghep va nhom chong Ian nhu” Hinh 2.41b,

ta co phirong trinh dai so Boole la: Y = C + B D

C D C D C D C D C D C D C D C D A B

A B A B A B

0 0 0 0

A B A B A B A B

1 0

ll 1

ll 1 ,

1 0

Hinh 2.41 a Hinh 2.41 b - Loai bo cac nhom thira

Sau hoan viec tao nhom, ta loai bo nhom thCra, day la cac nhom ma cac so cua nhom da diroc dung cac nhom khac

Cho Hinh 2.42a, sau khoanh nhom bon ta di/oc Hinh 2.42b Tiep theo, dira cac so lai vao nhom doi theo cach tao nhom chong Ian (Hinh 2.42c).

(53)

C D C D C D C D C D C D C D C D A B A B A B A B A B A B A B A B 0 1 0 a)

C D C D C D C D

A B A B A B A B 0 c) d)

Hinh 2.42: Loai bo nhom thtia

- Ket luan

Tom tat phirong phap dung bang Karnaugh de don gian phirong trinh logic: Dira so vao bang Karnaugh doi vdi moi tich co ban co ngo tren bang sir that bang Dira so vao cac vi tri lai tren bang Karnaugh

2 Khoanh cac nhom tarn, nhom bon va nhom doi Nh6 can ap dung cach ghep va chong Ian de tao nhom Idn nhat neu co the diroc

3 Neu so biet lap, hay khoanh lai Loai bo nhom thira

5 Viet phirong trinh dai so Boole bang cach ap dung luat OR cac tich tirong ting doi vdi cac nhom diroc khoanh

2.14 DIEU KIEN TU Y NGHI

Trong mot vai he thong digital, co nhting dieu kien ngo vao c h ic chan khong bao gid xay hoat dong binh thirdng; do, cac ngo tirong ting se khong xuat hien mtic logic, bang sti that dieu diroc the hien bang dau x ngo Vi du, Bang 2.21 la Bang sti that, co ngo mtic cho tat ca cac ngo vao tti 0000 den 1000, mtic cho ngo vao 1001 va x cho ngo vao tti 1010 den 1111 X dtiOc goi la dieu kien chon Khi nao thay x Bang sir that, ta co the cho x hoac bang hoang 1, tti ta co mach logic don gian hon Hinh 2.43a la bang Karnaugh tuong ting Bang sir that 2.21 co cac dieu kien chon tti 1010 den

1 1

(54)

Cac dieu kien chon giong nhu cac la phieu khong chi tui vi ta co the ghi dieu gi vao cGng di/de Hinh 2.43b la cach co hieu qua nhat de khoanh so

1 Viec lam co hai muc dich: thir nhat la so thuoc nhom bon, mot nhom Idn nhat co the thiet lap di/dc neu cho x bang 1; thu" hai la sau so dUdc khoanh nhom tat ca cac x ngoai nhom bon di/de coi bang Bang cach nay, cac x aifdc dung mot cach toi lTu Ta biet rang, viec thuC hien nhu” tren khong gay tro ngai gi vi

cac dieu kien chon ti/dng ting vdi ngo vao khong bao gid xay ca

Bang 2.21: Bang su* that co cac dieu kien chon

A B c D Y

0 0 0

0 0

0 0

0 1

0 0

0 1

0 1 0

0 1

1 0 0

1 0 1

1 X

1 1 X

1 0 X

1 1 X

1 1 X

1 1 X

C D C D C D C D C D C D C D C D

A B 0 0 A B 0 0

A B 0 0 A B 0 0

A B X X X X A B X X X X

A B X X A B X X

A B C D

Hinh 2.43 a Hinh 2.43 b Hinh 2.43 c

Phi/eng trinh logic tren day dUdc mach AND co hai ngd vao A va D thud hien, nhir chi tren Hinh 2.43c Khi kiem tra mach xem co phu hop vdi bang sir that 2.21 khong, ta thay rang A = va D = cho ta Y = 1, dung vdi dieu kien dau vao 101

Nhom bon tren Hinh 2.43b cho phi/dng trinh dai so Boole: Y = A D

Can ghi nhd noi dung sau day ve cac dieu kien chon :

1 Cho bang sir that, ve mot bang Karnaugh co cac so va so cung cac dieu kien chon x

(55)

3 Sau tao nhom Idn nhat co chtia so 1, cac dieu kien chon ngoai nhom di/oc cho bang

2.15 P H l/G N G PHAP TICH CUA TONG

V6i phirong phap tong cua tich, viec thiet ke xuat phat tu1 bang sir that, bao gom cac dieu kien ngo vao va ngo Btidc tiep theo la chuyen bang sir that phUOng trinh tong cua ti'ch tirong dirong Btidc cuoi cung la ve mach NAND- NAND tirong dirong

Phi/ong phap ti'ch cua tong cung tirong tti nhir vay Cho bang su1 that, thiet lap tong co ban can thiet cho viec thiet ke mach logic, roi thu’c hien luat AND cho cac tong nay, ta duoc phi/ong trinh ti'ch cua tong ti/ong ting vOi bang si/ that NhiTng co nhting khac biet gitia hai phi/ong phap Vdi phi/ong phap tong cua tich, ti'ch co ban cho ngo bang ti/ong ting voi cac dieu kien ngo vao Nhi/ng phi/ong phap ti'ch cua tong thi tong co ban cho cac ngo bang ti/Ong ting vdi cac dieu kien ngo vao Cach tot nhat de hieu dieu khac biet la lam mot vi du

- Chuyen doi bang sir that phirong trinh logic

Gia du co bang su” that nhir Bang 2.22, can xay dting phi/ong trinh tich cua to’ng Can phai lam gi de xac dinh moi ngo bang bang sti that va ghi lai tong co ban cua no Trong Bang 2.22, ngo co mtic xuat hien dau tien tuong ting vdi A = 0, B = 0, C = To’ng co ban ti/ong ting vdi cac ngo vao la A + B + C Tai sao? Vi tong cho ngo bang doi vdi dieu kien ngd vao ttiOng ting

Y = A + B + C = + + =

Ngd thu^hai_o mtic ttiOng ting vdi cac ngd vao A = 0, B = va C = To’ ng co ban la A + B + C, chu y rang B va C la phan bu, vi chi bang cach ay tong logic cua ti/ong ting vdi dieu kien dau vao da cho

Y = A + B + C = + T + = + + =0

Bang 2.22: Bang sti that

A B c Y

0 0 u ► A + B + C

0 1

0 1

0 1 - ► A + B + C

1 0

1 1

1 0 -— ► A + B + C

1 1

(56)

Tirong tir, ngo thir ba bang tirong ting v6i A = 1, B = 1 va C = 0, do tong cd ban cua no la:

Y = A + B + C = f + i " +

= + + =

Bang 2.22 chi tat ca cac tong co ban can thiet de thi/c hien bang sti that Chu y rang moi bien dirge lay phan bu bien ngo vao ti/ong Crng bang 1; bien khong lay phan bu bien ti/ong ting bang Be co phi/ong trinh tich cua tong, ta thi/c hien phep AND doi vdi tat ca cac tong co ban

Y = (A + B + C) (A + B + C) (A + B + C) (2.33) Day la phi/ong trinh ti'ch cua tong ti/ong ting vdi Bang sir that 2.22.

- Mach logic

Sau co phi/ong trinh ti'ch cua to’ng, ta ve mach OR-AND de co mach logic, cung co the chuyen mach logic tren mach NOR - NOR O phi/ong trinh (2.33) moi tong dai dien cho ng5 cua mot cong OR ngo vao Do do, ta co the ve mach logic nhi/ Hinh 2.44.

Khong co IC thi/c hien luat OR ngo vao, nen mach logic tren Hinh 2.44

khong thi/c te NhO dinh luat thu" nhat cua De Morgan, ta co the thay the mach OR - AND 6 Hinh 2.44 thanh mach NOR - NOR nhu1 tren Hinh 2.45 Mach tren

Hinh 2.45 thi/c hien bang si/ that neu ta ket noi nhir sau:

A+B+C

-• -+B+C

B

+B+C

A B B C C

I C 7

13

=3

I C 7

T f

Hinh 2.44: Ti'ch cua tong Hinh 21.45: Mach NOR-NOR

A: chan A: chan

B: chan B: chan 4, 10

C: chan 13, 11 C: chan

2.16 GIAN UOC BIEU THU’C LOGIC TICH CUA TONG

(57)

Karnaugh Co mot vai cach dung bang Karnaugh O phan ta dung cac cach de dang nhat

- Mach tong cua tich

Gia du rang, thiet ke mach logic xuat phat tU bang sir that 2.23 Viec lam dau tien la ve bang Karnaugh theo cach thong thudng nhu tren Hinh 2.46a Khoanh cac nhom va viet phi/ong trinh tong cua tich:

Y = A B + A B + A C

Hinh 2.46b la mach NAND - NAND ti/Ong ting

- Mach bu

Oe co mach ti'ch cua tong, ta bat dau bang phan bu cua cac tri so 0 va 1 bang Karnaugh nhi/ tren Hinh 46a Ket qua cho bang bu 6 Hinh 2.46c.

Khoanh nhom va ta dupe tong cua tich sau: Y = A B + A B C

Tai lai la Y ma khong phai la Y? Vi lap bang Karnaugh bu cung chi'nh la lay bu a ngo cua bang sir that Dieu co nghia la phuong trinh tong cua tich 6

Hinh 2.46c co ngo chi'nh la Y Hinh 2.46d la mach NAND - NAND cho Y Mach khong cho ngo nhu mong muon, no cho phan bu cua ngo can thiet ke

A B A B A B A B

C D C D C D C D A B

A B A B A B

0 0 0 0 Ch

i i i

0 0

1 1

a) b) d)

Hinh 2.46: Mach tong cua tich

- Xac djnh mach NOR - NOR

Dieu ma ta can lam la co Idi giai ti'ch cua tong, mach NOR - NOR cho ta ket qua nhu tren Bang sir that 2.23 Dinh ly De Morgan thU nhat noi rang cac cong NAND co the dupe thay the bang cac cong OR dao loi vao; do, ta co the thay the Hinh 2.46d bang Hinh 2.47a Bus so lieu dung cho moi bien va phan bu cua no thudng dupe dung cac he thong digital Nen dang le noi A va B vdi cong OR dao loi vao nhu tren Hinh 2.47a, ta co the noi A va B den cong OR nhu tren

Hinh 2.47b Tuong tu, ta co the noi A, B va C vdi cong OR dao ngo vao, ta lai noi A, B va C den cong OR Noi mot cach khac, Hinh 2.47b tuong duong vdi

Hinh 2.47a.

Budc tiep theo de tien toi mach NOR - NOR la chuyen doi Hinh 2.47b thanh

Hinh 2.47c bang cach di chuyen vong tron dao tU ngo vao 6 cong OR ben phai sang ngo cua cac cong OR ben trai Dieu da lam bien doi cac cong OR

(58)

thanh cac cong NOR Birdc cuoi cung la dung cong NOR 6 ngo de co Y thay the cho Y, nhu” mach NOR - NOR d Hinh 2.47d.

Bang 2.23 Bang sir that

A B c D Y

0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1

Hinh 2.47: Mach ti'ch cua tong

Den bay gid, ta khong phai qua tirng bu'dc thay doi mach NAND-NAND bu mach NOR - NOR tirong dirong Thay vao do, ta co the ap dung dinh ly doi ngau nhu1 mo ta di/6i day

- Djnh ly doi ngau

6 phan trirdc da gidi thieu dinh ly doi ngau cua dai so Boole Ta da ap dung dinh ly doi vdi mach logic Cho mot mach logic, ta xac dinh mach doi ngau nhir sau: chuyen doi moi cong AND cong OR, chuyen doi moi cong OR cong AND va lay phan bu tat ca cac tin hieu ngo vao-ngo Phat bieu tirong dirong cua mach doi ngau la: chuyen doi moi cong NAND cong NOR chuyen doi moi cong NOR cong NAND va lay bu tat ca cac tin hieu ngo vao- ngo

So sanh mach NOR-NOR tren Hinh 2.47d v6i mach NAND-NAND tren

(59)

- Tom t it ve cac phirong phap thiet ke mach logic

1 Chuyen doi bang su1 that bang Karnaugh Sau tao cac mu’c nhom, viet phirong trinh tong cua tich va ve mach NAND-NAND Day la Idi giai tong cua tich doi vdi ngo Y

2 Lap bang Karnaugh bu Tao cac mu’c nhom, viet phirong trinh tong cua tich va ve mach NAND-NAND doi voi Y Day la mach NAND-NAND bu

3 Chuyen doi mach NAND-NAND bu mach NOR-NOR doi ngau bang cach chuyen tat ca cac cong NAND cac cong NOR va lay phan bu tat ca cac tin hieu

4 So sanh mach NAND-NAND (birdc 1) vdi mach NOR-NOR (birdc 3), ta co the dung mach nao nhu cau, thudng ta dung mach co it cong logic

(60)

CAU HOI VA BAI TAP

2.1. Liet ke phan tu1 logic can ban ky thuat so

2.2. Phan tu* logic AND cho ngo bang cac ngo vao bang bao nhi

2.3. Phan tir logic OR cho ngo bang cac ngo vao bang bao nhie

2.4. Phan tir logic NOT cho ngo bang ngo vao cua no bin< nhieu?

2.5. Cong NOR hai ngo vao, hai ngo vao chrpc noi chung lai vdi nh tao cong gi?

2.6. Ham OR va ham X-OR co dac diem gi khac nhau?

2.7.Xay di/ng mach logic thirc hien ham X-NOR

2.8. Hay viet cac bieu thu’c cua hai dinh luat De Morgan

2.9. Cach doc bieu thu’c A x B nhir the nao?

2.10. Cach doc bieu thu’c A + B nhir the nao?

2.11. Cho vi du ve Bang Karnaugh bien

2.12. Cho vi du ve Bang Karnaugh bien

2.13. Trinh bay sir chuyen doi AND-OR NAND-NAND

2.14.Trong bang Karnaugh, nhom gian irdc dirge bao nhieu phan tu?

2.15. Trong bang Karnaugh, nhom gian irdc dirge bao nhieu phan tu?

2.16. Trong bang Karnaugh, nhom 8 gian irdc dirge bao nhieu phan tu?

2.17. Co mach logic nao co so ngo nhieu hon ngo vao khong?

2.18. Dieu kien nghi bai toan la gi? Cho mot vi du bai toan c< kien chon

2.19. Khi phan tich mach logic ngirdi ta xuat phat tirc o so nao?

2.20. Khi thiet ke mach logic ngirdi ta xuat phat tir co so nao?

2.21. Cach xac dinh tich co ban bang sir that thirc hien phironc tong cua ti'ch Cho vi du

2.22. Cach chuyen doi tir bang sir that phirong trinh logic thu phirong phap ti'ch cua tong Cho vi du

2.23. Phat bieu dinh ly doi ngau cua dai so Boole Cho vi du

2.24*.Tren Hinh 2.48a hai cong Invecto m ic noi tiep

(61)

1MJA 7404

■ % £

Hinh 2.48

2.25 Neu ngo vao cua mach logic tren Hinh 2.48b 6 mu’c thap, ngo cua mach co cao hay thap? Mach nao ti/Cng dirong vdi mach nay?

2.26* Lap bang s lT that theo Hinh 2.49a, so sanh vdi bang sir that cua cong

OR ngo vao

7432 4-075 7404 7432 7404

a) b) <0

Hinh 2.49

2.27. Lap bang sir that theo mach tren Hinh 2.49b 2.28. Lap bang sir that theo mach tren Hinh2.49c

2.29. Mach tren Hinh 2.49b co sai loi, tren Hinh 2.50 la so xung cua mach Xac dinh sai loi cua cac cong sau day:

a) Ngo vao cua cong Invecto (cong dao) hoat dong giong cong OR b) Chan 6 bi noi dat

c) Cong AND dirpc dung thay cho cong OR

d) Ngo cua cong Invecto (co’ng dao) khong dung

Chan

Chan

Chan Chan 6 Chan 8

Hinh 2.50

(62)

2.30* Ve mach logic cua phtiong trinh dai so Boole dudi day: Y = A B C + A B C + A B C + A B C

Vdi cac IC dudi day va ghi chu cac chan da dupe sCr dung: 7404, 7411 va 7432

2.31* Gian irdc cac bieu thu’c sau: a) (A+B)+(A+B)

b) F(A,B,C,D) = AB+C+ACD+BCD

2.32. Cho ham logic bien F(A,B,C,D) nhu1 sau: F(A,B,C,D) = ABCD+ABC+ABC+CD+BD+AD

Hay ciTc tieu hoa ham bang cach dung bang Karnaugh, viet bieu thu’c logic sau cud tieu hoa ham tren

2.33. Ve mach logic cua ham: Y = ABC + ABC

Sau do, toi iru ham tren bang cach dung dai so Boole va ve lai mach sau da toi gian

2.34. Ve mach logic cua ham sau: Y = (A+B+C)(A+B+C)

Ap dung dai so Boole de toi gian ham, sau ve mach logic tirong ting

2.35. Trong Hinh 2.51a, ngd cua cong NAND hoat dong giong nhir cong ngo vao vi chan 10 va 11 dirpc ket noi lai vdi Gia du, dau logic ket noi vdi IC 7410 Co’ng nao ba co’ ng bi hong neu dau logic bieu thi cac so lieu nhu" tren Hinh 2.51b?

Bang Bai tap 2.31

Bl£u THlfC Y

DAI SO BOOLE 1x0

1+0 1x1

T

0 x1x0 0+0+

1 x x x 0 + + + x x x

o+o+o+o

(63)

2.36. Neu dau logic chi thi trang thai nhu tren Hinh 2.51c cua mach logic tren Hinh 2.51a Nhir vay, cong nao bi hong?

2.37. Mach tren Hinh 2.51a co su co Neu so dang xung di/Oc trinh bay tren Hinh 2.51d Tinh trang nao dudi day da gay si/co:

a) Cong NAND tren bi hong

b) Chan 6 bi ngan mach voi nguon cung cap + 5V c) Chan bi noi dat

d) Chan 8 bi ngan mach vdi nguon cung cap + 5V

2.38. Cho bang sir that nhi/trong bang di/6i day, khoanh cac nhom 2, 4, 8 neu co the di/oc, xac dinh mach toi gian tong cua ti'ch, ve mach logic

2.39. Ve bang Karnaugh theo bang si/ that sau day, khoanh cac nhom 2, 4, 8 neu co the di/oc, viet phi/ong trinh dai so Boole toi gian va ve mach logic theo phi/ong trinh tren

2.40. Gia du rang 6 so lieu vao cuoi cung cua bang bai tap 2.38 co Y la dieu kien chon Sir dung bang Karnaugh chi toi i/u mach logic

2.41. Gia du rang 6 so lieu vao dau tien cua bang bai tap 2.39 co Y la dieu kien chon Chi mach logic toi i/u ti/ong Crng cua bang

2.42. Ve mach logic toi gian NOR-NOR cua bang bai tap 2.38

2.43. Ve mach logic toi gian NOR-NOR cua bang bai tap 2.39

2.44. Cho phi/ong trinh dai so Boole nhi/sau: Y = ABCD + ABCD + ABCD

Chi mach toi gian NAND-NAND va mach toi gian NOR-NOR ti/Ong i/ng vdi mach logic tren

(64)

£ - £ *

6 13

A % 3 -*+ ■ C 5

o

K 12 tO

# •

lOQ 9 0 3 0

12

7fc7» 0

ON

= OFF

'2 0 3 O 4 0 5 (5

7

8 n s

12 0

77

lO o O

3 0

c)

Chan Chan Chan 13 Chan 12 Chan Chan Chan Chan &

Chan

4- 5V

+ 5V

(65)

A B c D Y

0 0 0

0 0 1

0 0

0 1

0 0

0 1

0 1 0

0 1

1 0 0

1 0 1

1 1

1 1

1 0

1 1

1 1 0

1 1

Bang cho Bai tap 2.38

A B c D Y

0 0 0

0 0 1

0 1

0 1

0 0

0 1

0 1 0

0 1 1

1 0

1 0 1

1 1

1 1

1 AI 0

1 1

1 1 0

1 1

Bang cho Bai tap 2.39

(66)

CHUONG 3

MACH XLT LY SO LIEU■ ■

Hoc xong chwong hoc vien co kha nang:

Hieu duoc nguyen ly cau tao va heat dong cua cac bo ghep kenh (Multiplexer) va cac bo phan kenh (Demultiplexer), cac bo giai ma, bo tao va kiem tra bit c h in le

SCr dung cac IC Multiplexer va Demultiplexer cac Crng dung ky thuat digital.

SCr dung dWdc cac IC giai ma BCD, giai ma dung LED thanh.

SCr dung duoc cac IC ma hoa cac mach thi/c te.

L/ng dung cac bo tao va kiem tra bit c h in le cac mach thi/c te.

TONG QUAN

(67)

3.1 CAC BO GHEP KENH (MULTIPLEXER)

Multiplexer la mach co nhieu ngo vao nhting chi co mot ngo Nhd su’ dung tin hieu dieu khien co the hudng ngo vao nao den ngo Hinh 3.1 gidi thieu mot cach tong quat nguyen ly cau true Multiplexer Mot nhting Multiplexer dung bien la Multiplexer co 16 bit ngo vao, ngo dieu khien va bit ngo ra, goi la Multiplexer 16-1

1 n Day dieu khien — -►

-► M U LTIP LEX ER -► Ngd vao

_ -► n

Hinh 3.1 - Multiplexer 16-1

Hinh 3.2 la Multiplexer 16-1, no dUdc goi la bo chon so lieu vi bit ngo phu thuoc vao so lieu ngo vao duoc lUa chon Cac bit ngo vao dUdc ky hieu tu1 D0 den D15 Chi mot cac bit so lieu ngo vao dUdc chuyen den ngo dudi sti dieu khien cua cac tin hieu ABCD Khi cac bit dieu khien ABCD = 0000, cong AND tren cung hoat dong cac co’ng AND khac ngting hoat dong; do bit so lieu D0 dtipc truyen den ngo ra, luc do:

Y = D0

Ro rang la neu D06 mu’c thi Y a mu’c 0; D06 mu’c thi Y 6 mu'c

Khi cac bit dieu khien ABCD = 1111, tat ca cac cong AND deu ngting hoat dong trti cong AND dtidi cung Trong trtidng hop nay, D15 la bit nhat dtioc truyen den ngo va:

Y - D15 - IC 74150

Neu cong OR 16 ngo vao tren Hinh 3.2 dtiOc thay the bang cong NOR thi co hien tuong gi xay ra? Khi do, tai ngo ra, ta co phan bu cua so lieu duoc Itia chon Vi du, neu co ABCD = 0111, cong AND tuong ting vdi D7 hoat dong, ngd co so lieu bang phan bu cua so lieu ngo vao:

Y = D7

Do la phu'Ong trinh logic cho loai Multiplexer TTL, vi no co mot cong Invectd (cong dao) 6 ngd ra, tU cong dao ta co phan bu cua bit so lieu duoc lua chon

IC 74150 la Multiplexer 16-1 co so chan du'Oc gidi thieu tren Hinh 3.3 Cac chan tU den 8; tU 16 den 23 la danh cho cac bit so lieu vao D den D 15

(68)

Cac chan 11, 13, 14 va 15 la cac ngo vao cua cac bit dieu khien ABCD Chan 10 la ngo Y, no bang phan bu cua so lieu duoc lua chon

0

Chan 9, chan Strobe (ngo vao xung chon), la ngo vao tin hieu dieu khien cho Multiplexer hoat dong hoac ngirng hoat dong Bang 3.1 cho biet Strobe hoat dong d mu’c L, cho ngo Y bang phan bu cua bit so lieu vao, n la so thap phan ti/ong dtidng cua ABCD Mat khac, Strobe 6 mUc H, Multiplexer ngung hoat dong va keo theo ngo Y 6 mUc H: Y = Dn

D12

Vcc D8 D9 DIO Dll D13D14D15D C

n n n n n n n n n n n n

24 23 22 21 20 19 18 17 ^ 14 i i

IC 74150

1 10 11 12

u u u u u u u u u u u n "

D7 D6 D5 D4 D3 D2 Dl DO y A GND

STROBE

(69)

Thiet ke mach logic thtidng bat dau bang bang sti that Van de la 6 cho cho mach logic co cung bang sti that Trong chtiOng 2, cac phtiong phap tieu chuan de thu’c hien mot bang su” that la phwong phap tong cua tich va phwong phap tich cua tong. Bay gid them mot phirong phap thu ba ntia la phwong phap ghep kenh.

Gia du co bang sti that nhti Bang 3.2, ta can co mot mach logic de thtic hien bang sti that De su” dung IC 74150 thtic hien bang sti that, phan bu cua moi ngo Y co dtioc ngo vao ttiOng ting la:

D0 = T = 0 D, = = d2 = f = 0

- M ultiplexer logic

D1S = =

Bang 3.1 3ang 3.2.

Strobe A B c D Y

L L L L L D,

i L L L H D,

L L L H L d2

L L L H H Da

i L H L L Dj

L L H L H d5

i L H H L Ds

L L H H H d7

L H L 1 L Ds

L H L L H D?

L H 1 H L D10

L H L H H D„

L H H L L d;2

1

L H H L H D : 3

L H H H L 0,4

L H H H H D 15

H X X X

X H

A B c 0 Y

0 0 0 0 1

0 0 0 1 0

0 0 1 0 1

0 0 1 1 1

0 1 0 0 1

0 1 0 1 1

0 1 1 0 0

0 1 1 1 0

1 0 0 0 1

1 0 0 1 1

1 0 1 0 1

1 0 1 1 1

1 1 0 ■-/ 1

1 1 0 1

1 1 1 0 0

1 1 1 1

1

(70)

hSV

Q — 6— ,

c <1 o /Li ? ? '

*

19 1 R

' •

.1 6

(*

r. 11

e Cl D

13 14j 15 DO

Dl D2

n i Vcc

D4 D5 D6 IC D7 74150 D8 D9 D10 Dll STROBE D12 D13 GUD D14 Dl 24 10 12

Hinh 3.4: Sir dung IC 74150 cho mach Multiplexer logic

Tiep theo, cach noi cac ngo vao so lieu cua IC 74150 nhir tren Hinh 3.4 sao cho cac ngo vao bang voi cac so lieu noi tren Noi cach khac, D0 dirpc noi dat D duoc noi vdi +5V, D2 dupe noi vdi dat v.v Trong moi trudng hop, ngo vao so lieu la phan bu cua Y Bang 3.2 Hinh 3.4 la giai phap thiet ke Multiplexer, no co cung bang sir that da cho 6 Bang 3.2 Khi ABCD = 0000, D0 la ngo vao dupe lira chon nhu O Hinh 3.4 vi D0 = 0, Y = Khi ABCD = 0001, D, dupe lira chon, vi Dt = 1, nen Y = Neu kiem tra cac kha nang xay doi voi cac ngd vac lai ta nhan thay rang bang sir that cua mach giong vdi bang sir that da chc

Bang 3.2.

- Dau dao tren cac dudng tin hieu

Cac phieu du lieu thudng chi cac dau dao tren cac dUdng tin hieu Vi du chu y chan 10 co dau dao, nhac rin g ngd co gia tri b ln g phan bu cua bit so lieu dupe chon Cung chu y den chan ngd vao Strobe chc biet Multiplexer hoat dong Strobe d mu’c L va ngung hoat dong d mu’c H Vi ly Strobe dUdc goi la tin hieu hoat dong d mu’c L

Hau het cac thi chan IC deu dung dau dao de chi th[ tin hieu hoat dong a

muc L Cho den nay, moi thay dau dao d chan ngd vad cua IC ta hieu ia tin hieu vao chan hoat dong 6 mu’c L

- Mach logic van nang

(71)

doi cac bit so lieu ngo vao tren Hinh 3.4, chung ta co the sir dung cung mot IC de thu’c hien hang ngan bang sir that khac

- Cac Nibble Multiplexer

Doi ta can lira chon mot hai nibble ngo vao Trong triTdng hop ta co the dung mot nibble Multiplexer nhir chi tren Hinh 3.5 Nibble ngo vao ben trai la A3A2A1A0 va nibble ngo vao ben phai la 63626,60 Tin hieu dieu khien, dirpc goi la Select, xac dinh nibble ngo vao nao dirpc truyen den ngo

Khi Select 6 mu’c L, cong NAND ben trai hoat dong, do: y3y2y1y0 = a3a 2a a

Khi Select 0 mu’c H, cong NAND ben phai hoat dong, va: Y3Y2Y = 636,6,60

Hinh 3.5: Nibble Multiplexer

Hinh 3.6a gidi thieu so chan cua IC 74157, loai nibble multiplexer co ngo vao Select nhu” mo ta tren day Khi Select 6 mu’c L, niblle ben trai di/o'c chon hirdng den ngo Khi Select 6 mu’c H, nibble ben phai dirpc chon hi/6ng den ngo IC 74157 cung co ngo vao Strobe Nhu* da trinh bay tren day, Strobe phai 6 mu’c L de multiplexer hoat dong hpp le Khi Strobe a mu’c H, multiplexer khong hoat dong Hinh 3.6b gi6i thieu so ket noi cua IC 74157 Dau dao 6 chan 15 nhac ta biet la IC hoat dong 0 ngo vao Strobe co mu’c L

(72)

I

*5 [ I

7

/£5] Strobe

b z Q A O

Y3 T^j B O

A 2 ~J2_| YO

B 2 QJ, A1

Y2 [ T ] &

GND\f. ~g| y i

Hinh 3.6:: Cac

A A A t A O B 3 2

Strobe J:

Y3 Y2 >7 YO

3.2 BO PHAN KENH (DEMULTIPLEXER)

Bo phan kenh la mot mach logic co mot ngo vao va nhieu ngo Nhd dung cac tin hieu dieu khien, ta co the hirdng tin hieu ngo vao den mot cac ngo

Hinh 3.7 minh hoa nguyen ly chung ve cau true cua Demultiplexer Mach co mot day tin hieu vao, m day tin hieu dieu khien va n day tin hieu ngo

m tin hieu dieu khien

Tin hieu ngd vac \ d o phan kenh

D em ultiplexer

n tin hieu n gd r

Hinh 3.7: Bo phan kenh

- Demultiplexer 1-16

Hinh 3.8 la Demultiplexer 1-16 Bit ngo vao dupe ky hieu D Bit so lieu dupe truyen den bit so lieu cua cac ngo ra, thuoc vao gia tri cua ABCD la ngo vao tin hieu dieu khien

Vi du, ABCD = 0000, cong AND tren cung hoat dong, cac cong AND khac ngi/ng hoat dong, do, bit so lieu D dupe truyen den ngo nhat Y0 Neu D 6 mu’c thi Y0 cung 6 mu’c va ngupc lai Ta thay gia tri Y0 phu thuoc gia tri D Tat ca cac ngo khac d mu’c

(73)

DATA

R < >7 < > «> I I( >

-1

< I—

<»—

< ►—

< h - - # - -i i >—

— *

<»—

1

i h i h

-e

YO

Y1

Hinh 3.8: Demultiplexer 1-16 - IC 74154

IC 74154 la Demultiplexer 1-16 co so chan nhu" 6 Hinh 3.9 Chan 18 la ngo vao so lieu D, cac chan tCr 20 den 23 la cac bit dieu khien ABCD, cac chan tir den 10 va tti 13 den 17 la cac bit Y0 den Y 15 Chan 19 la Strobe, la ngo vao hoat dong 6 mtic Chan 24 noi vdi nguon Vcc va chan 12 noi dat

Bang 3.3 la bang sti that cua IC 74154 Tri/dc het, can chu y ngo vao cua Strobe Strobe cua IC hoat dong 6 mtic L Khi Strobe 6 mtic 0, ngo vao dieu khien ABCD xac dinh mot cac ngo a mtic L, so lieu ngo vao 6 mtic L Khi so lieu ngo vao 6 mtic H, tat ca cac ngo deu 6 mtic H Tirong tti, Strobe 6 mtic H, tat ca cac ngo deu 6 mtic H Hinh 3.9 la so chan cua IC 74154 co mot ngo vao bit so lieu (chan 18) ABCD dieu khien Bit so lieu tti dong hi/6ng den ngo dupe chi thi bang so thap phan ttiOng dtiong vdi cac bien ABCD Dau dao 6 chan Strobe bieu thi ngo vao hoat dong 6 mtic L

74LS154 15 3-14

D-13D—

12 y-11D CEl 10D

cE0 9D— 8 D-7

D A3 6 y A2 5D

A1 4D

A0 3D -2D -1y -0y

-STROBE

Vcc A A A AO

1

■DATA 24 23 22 2C 19 18

Y15Y14Y13/12 Y11

T7l 15

a 13

IC 4

1 1C 11

YO Y1 Y 2Y Y4 Y5 Y6 Y7 Y8 Y9 Y10

12GND

Hinh 3.9: IC 74154

(74)

Bang 3.3 Bang si/tha t cua IC 74154

Strobe Data A B c D Yo Y, y2 Y3 Y4 Y5 Y6 Y7 Y8 Y9 Y, Y, Y, Y, Y, Y,

n i _ i

L L L L L L L H H H H H H H H H H H H H H

L L L L L H H L H H H H H h H H H H H H H h

L L L L H L H H L H H H H H H H H H H H H H

L L L L H H H H H L H H H H H H H H H H H H

L L L H L L H H H H L H H H H H H H H H H H

L L L H L H H H H H H L H H H H H H H H H

-L L L H H L H H H H H H L H H H H H H H H H

L L L H H H H H H H H H H L H H H H H H H H

L L H L L L H H H H H H H H L H H H H H H H

L L H L L H H H H H H H H H H L H H H H H H

L L H L H L H H H H H H H H H H L H H H H H

L L H L H H H H H H H H H H H H H L H H H H

L L H H L H H H H H H H H H H H H L H H H

L L H H L H H H H H H H H H H H H H H L H H

L L H H H L H H H H H H H H H H H H H H L H

L L H H H H H H H H H H H H H H H H H H H L

L H X X X X H H H H H H H H H H H H H H H H

H L X X X X H H H H H H H H H H H H H H H H

H H X X X X H H H H H H H H H H H H H H H H

3.3 BO GIAI MA 1-16

Bo giai ma tirong ti/ nhu" mot bo Demultiplexer, co dieu khac nhat la khong co ngo vao so lieu, chi co cac ngo vao dieu khien ABCD nhir Hinh 3.10 Mach logic dirge goi la Bo giai ma I -16 vi chi co 16 ngo a mu’c

Hinh 3.10: Bo giai ma 1-16

(75)

Neu ta kiem tra cac kha nang xay cua tin hieu dieu khien ABCD khac (ti/ 0000 den 1111), ta thay chi so di/6i cua ngo 6 mu’c H luon luon bang vdi so thap phan ti/ong di/ong voi ABCD Vi ly mach logic doi di/pc goi la Bo giai ma nhi phan-thap phan. Vi co day ngo vao va 16 day ngo ra, mach cGng duoc goi la Bo giai ma day-16 day.

Thi/dng ngi/di ta khong xay di/ng bo giai ma tach rieng cac cong Invecto va cac cong AND nhi/ chi tren Hinh 3.10 ma co the sti dung IC 74154 lam bo giai ma Do do, IC 74154 dtipc goi la Bo Giai ma-Phan kenh, vi no co the vtia dtipc dung de gai ma vtia di/oc dung de phan kenh Trong muc 3.2 ta da thay sti dung IC 74154 lam bo phan kenh nhi/the nao Be sti dung IC 74154 lam bo giai ma, ta noi dat tat ca cac ngo vao so lieu va Strobe nhir tren Hinh 3.11 Cac ngo dirpc li/a chon di/pc giti 6 mtic L (xem Bang 3.3) Dieu ly giai tai lai co cac dau dao (vong tron nho) 0 cac day ngo Cac dau dao nhac ta nhd la day ngo O mtic L day 6 trang thai hoat dong hoac duoc lua chon

Vi du: Neu co ngo vao nhi phan ABCD = 0111, thi luc ngo Y7 0 mUc L tat ca cac ngo khac deu 6 mUc hi

74LS1 £4

15D— 14 y-1 3— 12 D-11 D—

El 10

D-E0 3—

g

>-7D—

A3 6

D-A q

D-A1 4

D-A0 3

D-2

O-1D— 0D—

Hinh 3.11: Stidung IC 74154 lam bo giai ma

Vi du: Hinh 3.12 minh hoa cach md rong hoat dong cua IC 74154 Hai IC 74154 duoc ghep de tro bo giai ma 1-32 Dudi day la nguyen ly heat dong cua mach Bit X dieu khien IC 74154 dau va phan bu cua X dieu khien IC 74154 thU hai Khi X 0 mUc L IC 74154 dau hoat dong va IC 74154 thti hai ngung hoat dong Ngo vao ABCD dieu khien ca hai bo giai ma nhung chi co bo giai ma dau hoat dong, do chi co mot ngo cua bo giai ma dau la 0 mUc L

Khi X 6 mu'c cao, IC 74154 dau ngu'ng hoat dong va IC thU hai duoc kich hoat Dieu co nghia la ngd vao ABCD du'Oc bo giai ma thu' hai giai ma ngo 6 mUc L Thi/c te, mach tren Hinh 3.12 hoat dong nhu la mot bo giai ma - 32

Ngudi ta thu'dng them dau dao (vong tron nho) vao mach logic nao mach hoat dong vdi xung kich hoat 6 mu'c L Trong Hinh 3.12 tat ca cac day ngo deu 6 mtic H trti day ngo dupe giai ma: ao ta chi co mot day ngo so cac day ngd du'o'c giai ma co dau dao (vong tron nho) Dieu noi len la so chi co day ngo hoat dong la 6 mu'c L tat ca cac day ngd khac deu o

(76)

mu’c H Tirong tir, ta cung them dau dao (vong tron nho) vao cac ngd vao so lieu (DATA) va Strobe cua moi IC 74154, de bieu thi cac ngd vao tich c u t L

3.4 CAC BO GIAI MA BCD-THAP PHAN

Ma BCD: BCD la cac chCr dau cua cum tir Binary-Coded-Decirnal (so thap phan ma nhi phan) Ma BCD co iru diem la cho phep chuyen doi tri/c tiep cac so bieu dien dirdi dang nhi phan sang dang thap phan Ma BCD bieu thi m6i so cua so thap phan bang mot nibble (mot bo bit) tirong dirong

Vi du, so thap phan 429 doi sang dang BCD nhir sau:

4

I I I

0 00 0 10 1001

Nhu” vay, sir dung ma BCD 0100 0010 1001 tirong dirong vdi so thap phan 429

Mot vi du khac, chuyen doi so thap phan 8963 ma BCD:

8 6

I I I I

1000 1001 1 0011

Tren day, ta da chuyen moi so thap phan sang so nhi phan de co ma BCD tirong dirong Khi may tinh thu’c hien cac phep tinh cong, trir v.v Ldi giai cuoi cung diroc chuyen doi ngiroc iai tir ma BCD sang so thap phan

Vi du: Chuyen so dirdi dang ma BCD sang so thap phan nhu” sau:

0101 111 0

I 1 I

(77)

Nhir vay, so thap phan 578 tirong dirong vdi ma BCD 0101 0111 1000

Chu y rang cac so cua ma BCD bao gom tir 0000 den 1001, tat ca cac to hop Ion hon (tir 1010 den 1111) khong co ma BCD, vi no Idn hon so thap phan Idn nhat la so

- Bo giai ma BCD-thap phan

Mach tren Hinh 3.13 diroc goi la bo giai ma1-10, vi chi co mot cua 10 ngo la 6 mu’c H Vi du, ABCD bang 0010, chi co cong Y2 AND co tat ca cac ngo vao 6 mire cao, do, chi co ngo Y2 la 6 mu’c H Neu ABCD bang 1000, chi co cong Y8 AND co tat ca cac ngo vao 6 mu’c H, ket qua la, chi co ngo Y8 dat mu’c H

Neu kiem tra cac kha nang co the xay khac cua cac so ABCD (tir 0000 den 1001), ta se thay rang chi so dirdi cua ngo d mire H luon luon bang vdi so thap phan tirong dirong cua so cua ma BCD d ngo vao Vi ly nay, mach cung dirpc goi la bo chuyen doi BCD-thap phan

H ^>oô ã - >• -• — - t •-tH>o*—•-_J-

A -

* • -Jl M

J-YO Y1 Y Y9

Hinh 3.13: Nguyen ly hoat dong cua Bo giai ma - 10

i de cc

V.V.

IC 7445

Neu khong muon xay dirng bo giai ma vdi cac bo dao tach rieng va cac cong AND, nhir bieu thi tren Hinh 3.13, ta co the dung IC TTL 7445 nhu” gidi thieu tren

Hinh 3.14 Chan 16 ket noi vdi nguon cung cap Vcc va chan 8 ket noi vdi dat Tir chan 12 den chan 15 danh cho ngo vao cua ma BCD, cac chan va den 11 la cac ngo IC co cac chirc nang tirong dirong vdi mach tren Hinh 3.13, chi khac la dirpc chon, cac ngo co mire L, tat ca cac ngo khac 6 mire H, nhir bieu thi Bang 3.4 Chu y rang cac ngo vao BCD co gia tri tir 1010 den 1111 se tao nen mu’c H d cac ngd

Vi du: Cac chan ngd cua IC 7445 co the ket noi vdi cac diot quang (LED), nhir trinh bay tren Hinh 3.15 Neu moi dien trd co tri so la kQ va moi LED co sut ap la V, luc do, dong chay qua LED dirpc phat sang la:

5V-2V

I = = 3mA

1k Q.

(78)

7 4 Q9 D Q8 D Q7 D -Q6 O

-Q5 D—

Q4

-A3 Q3 D—

A2 Q2 D—

A l Q1 D— A Q0 D

-Y O 16Vcc

Y1 15

IC 7445 D

Y2 14 C

Y3 12 E3

Y

12 A

Y5 11 Y 9

Y 10 Y<3

G W & Y7

Hinh 3.14: So chan cua IC 7445 Vi du: Tren Hinh 3.15 cac LED dirpc danh so tCr den

- Ta thay ABCD = 0101, ngo dirpc giai ma la Y5, vi Y5 dirpc noi dat mach giai ma ben IC, do, LED sang Tat ca cac LED khac khong sang vi cac ngo 0 mCrc H

- Khi ABCD = 1001, LED dirpc noi dat, do LED sang

- Khi ABCD = 1100, khong LED nao sang, vi ngo vao khong hop le (xem

Bang 3.4).

r r n r r r m •5V

16

Jfz

-44

7445 Q9 Q8 Q7 Q6 Q5 Q4

A3 Q3

A2 Q2

Al Q1

A0 QO

3 GNP

(79)

Bang 3.4: Bang sir that cua IC 7445

CAC NGO VAO CAC NGO RA

TT A B c 0

h Y, h h h h Ys

0 L L L L L H H H H H H H H H

1 L L L H H L H H H H H H H H

2 L L H L H H L H H H H H H H

3 L L H H H H H L H H H H H H

4 L H L L H H H H L H H H H H

5 L H L H H H H H H L H H H H

6 L H H L H H H H H H L H H H

7 L H H H H H H H H H H L H H

8 H L L L H H H H H H H H L H

9 H L L H H H H H H H H H H L

H L H L H H H H H H H H H H

Q H L H H H H H H H H H H H H

TO C H H L L H H H H H H H H H H

CO

c H H L H H H H H H H H H H H

s z H H H L H H H H H H H H H H

H H H H H H H H H H H H H H

3.5 BO GIAI MA DUNG LED THANH

LED (Light Emitting Diode) bu t xa nhan di/oc phan cu t thuan, cac dien tir tir tai hop voi cac "lo " 6 gan cho tiep giap Dien tir tir roi tir mu’c nang lirong cao hon xuong mu’c nang lirpng thap hon nen chung phat nang lirpng dirdi dang nhiet va quang Do dung cac nguyen to nhir galium, asenic va photpho, nen nha san xuat co the tao cac LED bu t xa co anh sang mau do, xanh la cay, vang, xanh lam, da cam va tia hong ngoai (tia khong nhin thay diroc) Cac LED phat cac tia b u t xa nhin thay di/oc rat thuan tien sir dung cac dung cu t h ir , may tinh tui

- Bo chi thj dung LED thanh

Bo chi thi dung LED 7 thanh gom 7 LED diroc danh dau tir a den g Do LED di/oc phan ci/c thuan khac nen ta co the chi thi cac so tu” den Hinh 3.16

ghi ro cac co danh dau thir tir theo qui dinh Khi chi thi so 0, cac a, b, c, d, e va f phat sang Khi chi thi so 5, cac a, c, d, f, g phat sang

(80)

I 1

f b

J c\ U

i ~1 ^ Qui dinh ten cac cua L E D thanh

e c

^ L oai an ot chung c ) Loai ca t o t chung

Hinh 3.16: LED

- IC 7446

IC 7446 la loai IC giai ma va dieu khien bo chi thi LED Co hai loai giai ma - dieu khien tirong ting vdi cac loai chi thi anot chung va catot chung M6i bo giai ma - dieu khien co ngo vao (ngo vao cua ma BCD) va ngo (cho cac LED tCf a den g)

IC 7446 la loai IC giai ma - dieu khien tirong hop v6i LED anot chung Cac mach logic ben IC 7446 chuyen doi ma BCD 6 ngo vao tin hieu ngo mong muon Vi du, neu ngo vao ma BCD la 0111, mach logic cua IC 7446 se lam cho cac a, b, va c dan vi cac tranzito tirong Crng dan bao hoa Ket qua la so se xuat hien o bo chi thi dung LED Ta phai noi cac dien tro han dong 6 ngoai IC nhir chi tren Hinh 3.17a.

- IC 7448

(81)

Vcc

b y ­

test

RBI

RBO-LED THANIfl

t — r r r r i

-I, LE Dc Li De LE Dg LE 3b LEDd LE 31 LE

t t i i t i i

1 12 <>

11 10 9 15 1'

IC 74-46 | >

T

%

16

I 7 1 6

8

Vcc

i

' I I I

\ B C D

GND

■ t e s t ■RBI RBO

a) IC 7446 ket noi vdi LED de giai ma b) IC 7448 ket noi vdi LED de giai ma

Hinh 3.17: Cac IC 7446 va 7448 lam nhiem vu giai ma

3.6 MA HOA

Bo ma hoa chuyen doi mot tin hieu ngo vao ti'ch circ tin hieu ngo duoc ma hoa Hinh 3.18 gidi thieu nguyen ly chung cua bo ma hoa co n ngo vao Mach logic ben bo ma hoa chuyen doi tin hieu ngo vao ti'ch c u t ngo nhi phan diroc ma hoa co m bit

Hinh 3.18: Bo ma hoa

- Bo ma hoa thap phan - BCD

Hinh 3.19 gidi thieu nguyen ly chung bo ma hoa thap phan - BCD Cac khoa chuyen mach nhan xuong moi cac cong muon noi mach voi nguon +5 V

(82)

Hinh 3.19: Bo ma hoa thap phan-BCD

Vi du: Khi nhan khoa xuong, cac cong OR cua B va D co ngo vao d mu’c H, ngo bang:

ABCD = 0101

Khi nhan khoa xuong, ngo bang: ABCD = 1001

- IC 74147

Hinh 3.20a la so chan cua IC 74147 IC la bo ma hoa thap phan - BCD Ngo vao thap phan tCr Xt den x9 noi cac chan tu1 den va tu" 10 den 13 Ngo BCD la cac chan 14, 6, va Chan 16 la chan nguon cung cap +Vcc, chan 8 la chan noi vdi dat GND, chan ky hieu NC la chan khong dung tdi, no khong ket noi vdi bat ky phan nao cua mach ben IC Hinh 3.20b chi cach noi mach theo so chan IC 74147 Dau dao cho biet ngo vao va ngo la ti'ch c u t L Bang 3.5

la Bang su1 that cua IC 74147 Khi tat ca cac tin hieu ngo vao x deu 6 mu’c H thi tat ca cac ngo cGng 6 mu'c cao H Khi x90 mu’c L thi ngo ABCD la LHHL (ti/dng dirong vdi so neu chuyen ngo ABCD phan bu cua LHHL) Khi x8 la ngo vao nhat 6 mu’c thap L, ABCD bang LHHH (tirong dirong v6i so 8 neu lay phan bu cua ngo LHHH) Neu tiep tuc lam nhir vay vdi phan lai cua bang sir that, ta se thay ngo vao thap phan tich circ L dirpc chuyen doi phan bu BCD 6 ngo (co nghia la 910 = 10012 , nhirng ngo Ia1001 = 0110)

IC 74147 IC 74147

X4 [7 3

X5 U n

X6 [7 14

X7 (T 13

X8 [ £ B [ ? C H

g n d( T

I Vcc NC A X3 X2 X1

(83)

Vi ly nay, IC 74147 con di/pc goi la bo ma hoa iru tien, vi no iTu tien doi vdi ngo vao co bac cao nhat Ta co the thay dieu neu quan sat Bang 3.5 Neu tat ca cac ngo vao tir X, den X9 deu o mu’c thap L thi luc do, bac cao nhat cua cac ngo vao la X9 dupe ma hoa de co ngo la LHHL Noi cach khac, X9 co quyen ifu tien doi vai cac ngo vao khac Khi x96 mu'c H, thi xg dirpc quyen uu tien va di/pc ma hoa, neu X8 = L

Bang 3.5: Bang s i/that cua IC 74147

CAC NGO VAO CAC NGO RA

xl x? x ,l x, x5 x x, Xs A B C D

H H H H H H H H H H H H H

X X X X X X X X L L H H L

X X X X X X X L H L H H H

X X X X X X L H H H L L L

X X X X X L H H H H L L H

X X X X L H H H H H L H L

X X X L H H H H H H L H H

X X L H H H H H H H H L L

X L H H H H H H H H H L H

L H H H H H H H H H H H L

Vi du: Hinh 3.21 gidi thieu bo ma hoa su" dung IC 74147 Ta thay tat ca cac khoa khac ho mach, dien ap dirpc keo len den +5V Bang 3.5 chi cho ta thay cac ngo ABCD luc co gia tri la HHHH

Khi khoa 6 dirpc nhan xuong, ngo vao x6 dirpc noi dat Do do, tat ca cac x dirpc dat 6 mu’c cao H chi trir x6 Bang 3.5 chi gia tri ngo ABCD la HLLH, phan bu cac bit ngo co gia tri thap phan la 6

I H H H H

»-*oV 2 -oN> i ^ - o V ihi-toV-i ^ V ^ » o V

— *oNo W v

9 )V

R

11 ie

12

< * Vcc <>X2

-Li0X3

+5V

2 T 4IC 7414'

<>X5 0X6 <1X7

^>X8

10 G N D

4>X9 r |O^A P^B 3-^C O^D

Hinh 3.21: Bo ma hoa thap phan-BCD

(84)

3.7 BO T A O BIT CHAN LE - BO KIEM TRA BIT CHAN LE

Bit c h in co nghia la mot ngo vao n bit co so c h in bit Vi du, 110011 co so bit c h in vi co bit Bit le co nghia la mot loi vao n bit co so le bit Vi du, 11001 co so le bit vi co bit

Vi du khac:

□ So nhi phan 1111 0000 1111 0011 thuoc loai bit c h in vi co 10 bit □ So nhi phan 1111 0000 1111 0111 thuoc loai bit le vi co 11 bit

So nhi phan tren day tro nen de doc neu ta viet tting nhom bon bit (nibble)

- Bo kiem tra bit ch in le

Cac cong X-OR dung de kiem tra bit c h in le cua so nhi phan la rat ly tuong vi chung cho mu’c d ngo ngo vao nhan so le bit Do do, mot ngo vao cua cong X-OR nhan so c h in bit se cho O ngo mu’c 0, 0 ngo cho mu'c

1 ngo vao nhan so le bit 1

Vi du, Hinh 3.22 la cong X-OR 16 ngo vao Mot so 16 bit dieu khien ngo vao Cong X-OR cho mu’c d ngo vi ngo vao nhan so le bit Neu ngo vao co so 16 bit nhan so c h in bit 1, ngo se 0 mCrc 0

- Bo tao bit c h in le

Trong may ti'nh dien tir, so nhi phan co the la mot lenh noi v6i may ti'nh thirc hien phep cong, tru1, nhan ; hoac so nhi phan co the la so lieu de xir ly nhi/ la mot so, mot chur v.v Trong trudng hop nao do, doi ta thay co bit ngoai lai dUdc them vao so bit goc de tao so nhi phan mdi la bit c h in hoac bit le

'O ID I 1 00100 01100

Hinh 3.22 Vi du, Hinh 3.23 gidi thieu so nhi phan 8 bit:

X7X6X5X4X3X2X1X0

Gia dy, co so bang 0100 0001 So la bit ch in , dieu d in den cong X- OR tao 6 ngo mu’c 0, vi co cong Invecto, nen:

(85)

Va ngo cuoi cung co so gom bit la 0100 0001 Nhu” vay, day la bit le Gia du, ta chuyen doi so d ngo vao 8 bit la 0110 0001 Day la bit le Trong trudng hop cong X-OR tao bit d ngo NhUng cong Invecto dao lai bit de cho so d ngo bit la 0110 0001 Nhu vay, ngo cuoi cung lai co so la bit le

5 b b it

So fa t co fa t !e

Hinh 3.23: Bo tao bit c h in le

Mach tren Hinh 3.23 la bo tao bit le vi no luon luon cho so 6 ngo la so nhi phan bit thuoc loai bit le Neu ngo vao co so nhi phan 8 bit la bit ch in , so tU cong dao tao nen ngo cuoi cung so bit le (muon co bo tao bit c h in ta bo cong dao)

- Lfng dung thu’c te

Trong qua trinh truyen dan tin hieu co cac loai tap nhieu xam nhap vao dUdng truyen nen doi cac sai loi bit 1 xay so lieu nhi phan truyen qua dudng day dien theai hoac cac dUdng truyen khac Mot cach de kiem tra cac sai I6i la sCr dung bo tao bit le d dau phat tin hieu va sir dung bo kiem tra bit le 6 dau thu Neu khong co cac sai loi bit 1 truyen dan gay thi so lieu nhan d u p e thuoc loai bit le NhUng neu mot cac bit d u p e phat di bi bien doi nhieu thi so lieu nhan

d u p e se thuoc loai bit chan

Vi du, ta muon truyen di so nhi phan 0100 0011 Vdi bo tao bit le nhu tren

Hinh 3.23, so lieu dupe truyen se la 0100 0011 So lieu co the dUdc truyen qua dudng day dien thoai de di den noi can den Neu khong co sai I6i xay truyen dan, bo kiem tra bit le tai dau thu se tao ngo d mUc H, co nghia la so lieu thu dupe thuoc loai bit le Trong mot tinh huong khac, neu co sai loi bit tham nhap vao so lieu dupe phat di, bo kiem tra bit le se co d ngd mUc L, the hien la so lieu thu dupe khong dung Cac sai loi rat hiem xay ra, nhung xay thi thudng la cac sai loi thuoc loai bit Dieu noi len tai phUdng phap mo ta tren day co the phat hien kip thdi hau het cac sai loi xay doi vdi cac so lieu dUdc truyen

(86)

- IC 74280

Hinh 3.24b gidi thieu chan IC 74280, day la IC tao va kiem tra bit chan le thuoc loai TTL Cac bit so lieu ngo vao tu” A den I Cac bit co the la bit chan hoac le Chan - NC- chan khong ket noi v6i mach ben IC Cac chan ,2 va tu’ 8 den 13 la cac ngo vao so lieu Chan va 6 la cac ngo vao tong c h in va tong le Khi so lieu ngo vao thuoc loai bit chan thi luc Z EVEN OUTPUT 6 mu’c H va Z ODD OUTPUT 0 mu’c L Khi so lieu ngo vao thuoc loai bit le, thi luc do, Z EVEN OUTPUT P mu'c L va Z ODD OUTPUT 6 mu’c cao H

Neu thay doi cac ngo vao dieu khien ta se thay doi cach hoat dong cua bo tao va kiem tra bit c h in le Gia du rang EVEN INPUTd mu’c L va ODD INPUT 6 mire H Khi so lieu ngo vao co bit chan, Z EVEN OUTPUT 6 mu’c L va Z ODD OUTPUT 6 mu’c H Khi so lieu ngo vao co bit le, Z EVEN OUTPUT 6 mu’c H va Z ODD OUTPUT 6 mu’c L

IC 74280 co the dirpc sir dung de phat hien bit c h in le, IC cung dupe sir dung lam bo tao bit c h in le

7 S

1

1

1

1 s O

12 S E 11 10

14|

Vcc

13 12

3

TIT

10

A ODD EVEN

G N D ' LE CHAN

So ngd vao tu A den / 0 mdc H

Ngo ra Tong chan TSng te 0, 4, 3

1, 3, 9

H L L H

(87)

CAU HOI VA BAI TAP

3.1 Dinh nghia bo ghep kenh (Multiplexer) 3.2 Dinh nghia bo phan kenh (Demultiplexer)

3.3 Vi co the goi IC 74150 la mach logic van nang Co the dung mot IC 74150 de thiet ke mach logic thu’c hien bang su that co bao nhieu bien ngo vao?

3.5 LED co nghia la gi?

3.6 Dien tro gidi han de dam bao cho LED hoat dong on dinh thirdng bang bao nhieu?

3.7 LED co nhCrng loai nao, moi loai co nhCrng dac triTng gi? 3.8 Ma BCD co iru diem gi?

3.9 Vi can co bo tao va kiem tra bit c h in le truyen tin hieu digital moi trirdng truyen dan?

3.10* 6 Hinh 3.2, ABCD = 1001 thi ngo Y bang bao nhieu? 3.11 6 Hinh 3.4, ABCD = 1100 thi ngo Y bang bao nhieu?

3.12* Sir dung Multiplexer logic de thiet ke mach logic cho Bang 3.6

Bang 3.6: Bang si/tha t

A B c D Y

0 0 0

0 0 1

0 1

0 1

0 0

0 1

0 1 0

0 1 1

1 0

1 0 1

1 1

1 1

1 0

1 1

1 1 0

1 1

3.13 Chi cach ket noi sir dung IC 74150 de thi/c hien phirong trinh dai so Boole sau day:

Y = ABCD + ABCD + ABCD

(88)

day:

Bang 3.7 Bang 3.8: Bang 3.9: Ma Gray

3.14* Sir d u n g IC 74150 d e x a y d i f n g m a c h l o g i c t h u ’c h i e n Bang 3.8 s a u

A B c D Y3 Y , Y, Y.

0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 1 0 0 1 1 0 0 1 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 1 1 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 0 0 0

A B c D y3 Y, Y, Y ,

0 0 0 0 0 0 1 0 0 0 0 1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 1 0 0 0 0 1 1 1 1 0 0 0 1 0 0 0 0 1 0 1 1 0 0 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 1 0 1 0 1 1 1 1 0 0 1 0

A B c D Y

0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 1 1 0 1 0 0 0 1 1 0 0 1 1 1 0 1 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 1 1 1 1 1 0 0 1 1 1 1 0

3.15* Trong Hinh 3.7, vdi ABCD = 0101, day ngo nao hoat dong khi: a) Strobe d mu’c cao?

b) Strobe 6 mu'c thap?

Hinh 3.25

3.16 Cac tin hieu ngo vao T va R 6 mu’c L Hinh 3.25, ngo Y nao hoat dong ABCD = 0011 ? De co ngd Y9 hoat dong, cac tin hieu ngd vao can phai nhu1 the nao?

3.17* Co mach cho tren Hinh 3.25, gia du rang dau logic chi thi chan 19 luon luon 6 mu’c H, nhCrng kha nang nao neu dudi day co the xay ra:

a) Chan 20 bi tiep dat

(89)

c) Ngo vao R bi tiep dat

d) Ngo vao T ket noi v6i nguon cung cap + 5V

' a7

3.18 Cac tin hieu ngo tren Hinh 3.11 co mu’c L hay mu’c H tac dong? Oe IC gai ma ngo vao ABCD thi ngo vao Strobe phai a mu’c L hay mu’c H?

3.19* Co mach cho tren Hinh 3.12, gia du X = va ABCD = 0110, a) chip nao hoat dong?

b) ngo nao hoat dong?

3.20 Chuyen doi cac so thap phan sau day cac ma BCD tirong dirong: a) 32

b) 634 c) 4898

3.21* Chuyen doi cac so co ma BCD sau day cac so thap phan tirong dirong:

a) 0 1 0 1 1 b) 1000 0001 0011 c) 0111 0010 0101 1001

3.22 Co mach cho tren Hinh 3.13, ngo nao 6 mu’c H ABCD = 0101?

3.23* Co mach cho tren Hinh 3.15, ngo nao 6 mu’c L ABCD = 0111?

3.24 Mach Hinh 3.26 co mot nhom gom 10 chip, danh so tir den 9, Moi chip co ngo vao Strobe 6 mu’c tich circ L Chip nao hoat dong tirong ting vdi cac dieu kien sau:

a) ABCD = 0000 b) ABCD = 0010 c) ABCD = 1001

+ V

16

CHIP O

s t r o bF ”

CHIP

s t r o bP

CHIP

V cc

YCO-

Y1Q-cJS,

15

7445Y2°-Y ; 0

Y^O YEO

Y(q

Y^D-Y^O

GND Y£q

-s t r o bF s t p o bF

CHIP

stkobP

Hinh 3.26

(90)

3.25* Neu ngo vao ABCD tren Hinh 3.26 luc dau b ln g 1111 Doi vdi dieu kien cac dang song ngd bat dau 6 mu’c H nhi/ bieu thdi gian tren

Hinh 3.27, mach khac khong gidi thieu 6 day, gia du di/pc tao theo cac gia tri dau vao cua ABCD nhi/ sau: 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111,

1000 va 1001 Bieu thdi gian cho chung ta biet mach tren Hinh 3.26 co vai sai loi Vay kha nang nao liet ke di/di day co the xay ?

a) Chan 16 khong ket noi den nguon cung cap? b) Chan 8 bi ho mach?

c) Chan 12 bi noi dat?

d) Chan 15 ket noi vdi nguon cung cap + 5V?

3.26 Tren Hinh 3.16 thanh nao cua LED di/pc phat sang de bieu thi cac so cac tri/dng hop sau:

a) so 2 b) so 6 c) so 8

“ U L J

L J L J

Y2 | _ |

Y3 | _ |

- L J -L J

L J L J -V8

y9

Hinh 3.27

3.27* Tren Hinh 3.17a, Vcc = +5V, tat ca cac R deu co gia tri la kQ va moi LED co sut ap la V Hoi moi cua LED phat sang co dong chay qua vao khoang bao nhieu mA?

3.28 Tren Hinh 3.19 ngo cho dap Crng nhu1 the nao khi: a) Khoa di/pc nhan xuong?

(91)

3.29* Tren Hinh 3.21 neu khoa 8 dupe nhan xuong, a) Chan ngo vao nao cua IC dat mu’c L?

b) Ngo ABCD bang bao nhieu?

3.30* Co cong X-OR 16 ngo vao nhir tren Hinh 3.22, ngo Y bang bao nhieu ngo vao co cac gia tri nhu” sau:

a) 1111 0000 1111 0000 b) 0101 1010 1100 0111 c) 1110 1011 1101 0001

d) 0001 0101 0011 0110

1 1 T O O I O O O I I O O

Hinh 3.22: Cong X-OR vdi 16 ngo vao

3.31 Cho mach tren Hinh 3.23, bo ghi 8-bit la mach logic lifu trCr byte Hoi byte A7 Ao bang bao nhieu cac dieu kien sau:

a) A7 A0 = 1000 0111 va ngo vao dao bang 0, b) A7 Aq = 0011 1100 va ngo vao dao bang 1, c) A7 A0 = 1111 0000 va ngd vao dao bang 0, d) A7 Aq = 1110 0001 va ngo vao dao bang

Y7 Y6 Y5 Y4 Y3 Y2 Y1 YO

Hinh 3.23

3.32* Voi mach sir dung IC 74180 va bang sir that cho tren Hinh 3.24 (3.44) Co the thay doi mach nhu1 the nao de cong bit la bit ch in ?

(92)

*7 X6 X5 X4 X3 X2 XI XO

~T

-

7 G N D

74130

Ngo vao le (O d d Input) Ngo vao chan (Even Input)

Odd O utput

6

X& X7 X X5 X4 X X2 X! XO

Hinh 3.24

INPUTS OU~ r j T S

o f H ’s a t

X to XO Even Odd ?n Odd

Even H L f-j L

Odd H L L H

Even L H L H

O d L H H L

X H H L L

(93)

C H U O N G 4

MACH SO HOC■ ■

Hoc xong chudng nay, hoc vien co kha nang:

Hieu duoc y nghia ve cac so nhi phan khong dau va co dau, cac so nhi phan am va duong.

Thi/c hien dUdc phep bu1 va bu 2, phep tinh so hoc bu 2.

Xay di/ng cac khoi nCfa cong, cong day du, cac bo cong, bo trCf bhng cac cong logic.

Thi/c hien dUdc phep tinh cong, trCt, nhan va chia nhi phan.

TONG QUAN

Co the xay dirng cac mach logic thirc hien phep ti'nh cong hoac trir Vi cac mach cong hoac mach trir la cac cong logic dung cac linh kien dien tir nen thdi gian ti'nh toan rat nhanh Cu the mot phep cong dirpc thu’c hien chi vai micro giay Chirong bat dau bang cong nhi phan, tiep theo la gidi thieu hai phirong phap mo ta so am, bo cong, bo trir 8 bit Ngoai chirong gidi thieu khai quat nguyen tac lam viec cua may vi ti'nh va cac he thong digital

(94)

4.1 PHEP CONG NHj PHAN

Cac so dac trirng cho so lirpng mang tinh vat ly Vi du, Bang 4.1 la cac so thap phan va tirong ung la so cac may dien thoai (co the la cac dang dai lirpng vat ly khac) So thay cho may dien thoai, so thay cho may dien thoai v.v Phep cong dai dien cho sir ket hop cua cac so lirpng co ti'nh vat ly Vi du:

2 + =

tirpng trirng cho sir ket hop cua may dien thoai vdi may dien thoai de co tong la may dien thoai Mot cach hinh tirpng, dieu dirpc the hien nhir sau:

- Bon trirdng hop can nhd:

Cac mach dien may vi ti'nh khong xir ly cac so thap phan, chung chi xir ly cac so nhi phan Trirdc tim hieu may vi ti'nh thirc hien phep ti'nh so hoc nhir the nao, ta phai hoc cach cong cac so nhi phan Cong nhi phan la chia khoa de mo cac giai phap thirc hien phep trir, nhan, chia nhi phan

Ta hay bat dau bang bon trirdng hop co ban cua phep cong nhi phan:

0 + = (4.1)

0 + = (4.2)

1 + = (4 ;3)

1 + 1 = 0 (4.4)

Cac phirong trinh (4.1), (4.2) va (4.3) la hien nhien vi gio'ng nhir phep ti'nh thap phan Tuy vay, trirdng hop thCrtirgay rac roi cho ta, vi khong hieu phirong trinh (4.4) dac trirng cho hien ti/png gi the gidi vat ly Phi/ong trinh (4.4) dac tri/ng cho viec ket hop cua 1 may dien thoai vdi 1 may dien thoai de co tong la 2 may dien thoai:

+

(95)

Bang 4.1: Cac so thap phan

1 + = 10

Cho den nay, ta can nhd rang cac so nhi phan, thap phan, bat phan, hoac thap luc phan deu la ma cua cac dai li/png vat ly Be phan biet cac so thuoc he thong so nao do, ta dung cac chi so dirdi de ky hieu, vi du:

12 + 12 = 102 (he nhj phan) 78 + 18 = 108 (he bat phan) i0 + 110 = 1010 (he thap phan) Fi6+ 1i6 = 1016 (he thap luc phan) (hoac FH + 1H = 10H)

- Phep cong hai so nhj phan

Thu’c hien cach cong theo tirng cot, tir cot co so thap nhat den cot co so cao hon lien ke va tiep tuc thirc hien den cot co so Idn nhat, de cong cac so nhi phan cung nhir cac so thap phan Vi du, ta co phep cong nhi phan nhir sau:

1 1100

+ 1 1010

?

Bat dau cong cot co so riho nhat, ta co:

1 1100

+ 1010

0

(96)

Tiep theo, ta cong cac bit d cot thu1 hai tinh tu* ben phai:

1 1100

+ 1010

10

Cong cot thu1 ba, co:

1 1100

+ 1010

110

Cot thCr tu" cho ket qua: So nhd

1 1100

+ 1010

0110

Can chu y rang so nhd diroc chuyen sang cot cuoi cung, co so nhd vi + = 10 Vi phep cong thap phan, ta ghi so va chuyen so sang cot co so cao hon lien ben

Cot cuoi cung cho: So nhd

1 1100

+ 1010

11 0110

6 cot cuoi cung: 1 + 1 + 1 = 10 + 1 = 11

Khi nam vCrng bon qui tac co ban tren, ta co the thirc hien phep cong cac so nhi phan ma khong can quan tam xem so Idn den mu’c nao

Vi du :

Cong cac so nhi phan 16 bit: 0000 1111 1010 1100 va 0011 1000 0111 1111 Hay bieu thi bang cac so thap luc phan va thap phan tirong Crng

Loi giai:

Bat dau cong cac bit ben phai va cong theo tirng cot:

Nhi phan Thap luc phan Thap phan

0000 1111 1010 1100 F A C H

+ 0011 1000 0111 1111 F H + 4

(97)

V i du:

Tu1 vi du tren, hay bieu thi cach lam viec cua may vi tinh the he dau thu’c hien phep cong

Ldi giai:

Cac may vi tinh the he dau nhu” Apple II co bo vi xurly 8 bit De cong cac so 16 bit, may vi tinh the he dau cong 8 bit thap, sau do, cong 8 bit cao, cac phep cong thu’c hien rieng Dudi day la cach lam viec cua may vi ti'nh the he dau cong cac so nhi phan cua vi du tren:

Byte cao Byte thap

I I

0 00 1111 1010 1100

+ 0011 1000 0111 1111

? May vi ti'nh bat dau cong byte thap

1010 1100

+ 0111 1111

00 10 1011

So tran

LUu y co tran cua byte thap, tran duoc mang sang cot cuoi cung cua byte cao May vi tinh lu’u trCr byte thap (0010 1011), sau may tinh thu’c hien phep cong khac doi vdi byte cao, cong ca so tran, nhu" dudi day:

1 < Tran 0000 1111

+ 0011 1000

0 0 1000

May vi tinh sau lai lull trir byte cao De xuat Idi giai cuoi cung may vi ti'nh lay cac tong cao va thap tir bo nhd de diroc ket qua nhi/ sau:

0 00 1000 0 10 1011

so nhi phan tu'o'ng dirong vdi so thap luc phan 4823H hoac so thap phan 18475, trung hop vdi ket qua tim duO'c cua vi du tren

(98)

4.2 PHEP T R I/N H I PHAN

Ta hay bat dau bang bon trirdng hop co ban cua phep tri/ nhi phan:

0 - 0 = 0 (4.5)

1 - 0 = 1 (4.6)

1 - 1 = 0 (4.7)

1 0- 1 = 1 (4.8)

Cac phi/ong trinh (4.5), (4.6) va (4.7) rat d l hieu, vi chung hoan toan giong phep tri/ thap phan Trirdng hop thir tir co mot chut rac roi Ta hay tro lai vdi moi trirdng vat ly:

2 may dien thoai tri/ di 1 may dien thoai lai 1 may dien thoai

Doi vdi cac so nhi phan Idn hon, ta tri/ cot cho cot, giong nhir ta thi/c hien vdi so thap phan Dieu co nghia la doi ta phai vay d cot co so Idn hon lien ben Vi du:

1 0 1

- 0 0

?

T ri/d cot co so nho nhat (LSB): 1 0 1

- 10 0

1

Tri/ cac bit d cot thir hai, vay ti/ cot lien ben, co:

Vay —►

1 0 1

- 0 0

1

6 cot thir hai ti/b e n phai, tri/n h ir sau: 10 - 1 = 1,d e c o :

Vay -►

1 0 1

(99)

Trir cac cot lai:

Vay “ ►

1 0 1

- 10 10

0 11

Sau thu’c hien phep trir nhir tren, den bay gid ta thay phep trir nhi phan khong kho khan hon phep trir thap phan Thirc chat, no de hon vi trir cac so nhi phan chi co trirdng hop can nhd ma thdi

4.3 SO NHj PHAN KHONG DAU

Trong mot so phep tinh, cac so lieu la so dirong hoac so am Khi co so nhu” vay, ta co the quen di dau + hoac dau - va tap trung vao tri tuyet doi cua cac so Vi du, so 8 bit nho nhat la 0000 0000 va so Ion nhat la 1111 1111 Do do, tong cac hang cua cac so 8 bit la:

tir: 0000 0000 (00H)

den: 1111 1111 (FFH)

tirong dirong vdi so thap phan tir den 255 Ro rang la cac so khong co dau + hoac dau -

So nhi phan 16 bit co cac so:

tir: 0000 0000 0000 0000

den: 1111 1111 1111 1111

dai dien cho cac tri tuyet doi cua cac so thap phan tir den 65535

- Tai goi la so nhj phan khong dau?

So lieu nhir tren diroc goi la so nhi phan khong dau vi tat ca cac bit cua so nhi phan diroc dung de dac trirng cho tri tuyet doi cua so thap phan tirong irng Ta co the cong hoac trir cac so nhi phan khong dau, thoa man cac dieu kien da cho Cac vi du dirdi day se de cap den cac so nhi phan khong dau

- Han che

The he may vi tinh dau tien chi xir ly so 8 bit NhCrng han che cua may vi tinh loai de dang nhan thay Vi du, vdi phep tinh so hoc khong dau, tat ca cac tri tuyet doi phai nam khoang tir den 255 Do do, moi so diroc cong hoac trir phai nam khoang tren day Cung nhir vay, cac Idi giai cung phai n lm khoang Neu tri tuyet doi nao Idn hon 255, ta phai dung phep ti'nh so hoc 16 bit, dieu co nghia la may vi tinh Ian lirot lam viec vdi 8 bit thap, roi tiep tuc lam viec vdi 8 bit cao

(100)

- Tran

Trong phep tinh so hoc 8 bit, cong hai so khong dau co tong so Idn hon 255 nen bi tran, so nhd dirpc mang sang cot thu’ chin Hau het cac |uP co mach logic, mach dupe goi la cd tran; mach mang so nhd sang cot thir chin va bao cho ta biet rang Idi giai 8 bit la khong dung

Vi du:

Hay trinh bay phep cong 15010 va 8510 vdi vdi cac so nhi phan 8 bit khong dau

Ldi giai:

Chuyen doi cac so thap phan sang thap luc phan roi chuyen sang nhi phan la:

15010 —► 96H — ► 1001 01102 8510 —► 55 H —► 0101 01012 Ta cong cac so khong dau lai va dirpc:

1001 0110 96H

+ 0101 0101 + 55H

1110 1011 EBH

Nhu" vay:

1110 10112 —► EBH 23510

Vi du:

Hay trinh bay phep trir 15010 cho 8510 vdi cac so 8 bit khong dau Ldi giai:

Dung cac so nhi phan da neu 6 tren, roi thu’c hien phep trir, ta co:

1001 01102 96H

- 0101 01012 - 55H

0100 00012 41H

Nhir vay:

0100 00012 — ► 41H — ► 6510

Vi du: Hai vi du tren deu cho ket qua nam khoang tCr den 255 Bay gid ta lam phep cong cd tran de tao mot Idi giai 8 bit khong dung qui dinh Hay trinh bay phep cong 17510 vdi 11810 dung cac so 8 bit khong dau

Ldi giai:

17510 + 118.Q

(101)

Ldi giai Idn hon 255 Oieu gi da xay d day ta dung phep cong cac so 8 bit?

Khi chuyen doi thap phan thap luc phan va nhi phan, ta di/dc: 17510 — ► AFH — ► 1010 11112

11810 * 76H 0111 01102

Bo vi xir ly 8 bit bo’ sung nhu" sau:

1010 11112 AFH

+ 0111 01102 + 76H

1 0010 01012 125H

Tran

Vdi phep tinh so hoc 8 bit, chi 8 bit thap diroc su" dung, nen ket qua la: 0010 01012— ► 25H — ► 3710

N hi/ta thay, Idi giai vdi 8 bit la khong dung Phep ti'nh la dung qui dinh neu ta lay tran, nhirng 0 day Idi giai chi dung cd 8 bit Neu hoc lap trinh bang ngon ngCr Assembler, ta se biet cach thirc hien cd tran xay

Tom lai, cac mach so hoc 8 bit chi cd the xir ly so thap phan khoang tir den 255 Neu cd tran phep cong, ngirdi lap trinh phai viet lenh cd chu y den cd tran va dung phep ti'nh chCra 16 bit cho Idi giai cuoi cung Oieu cd nghia la ta phai phan 8 bit thap, 8 bit cao va tran

4.4 CAC SO CO DAU

Ta xir ly cac so lieu cd gia tri am va dirong? Cau tra Idi cd y nghia quan vi no xac dinh ti'nh phu”c tap cua mach so hoc can phai cd

Cac so thap phan am la -1, -2, -3 v.v Tri tuyet doi cua cac so la 1,2, 3, v.v Mot cach lap ma cho cac so dirdi dang thap phan la chuyen doi tri tuyet doi so nhi phan tirong dirong va cd dau phi'a trirdc Do do, chuoi 1, va -3 tro - 001, - 010, - 011 VI moi mot so phai diroc ma hoa mot day so va so 1; cac dau + va - cung phai diroc bieu thi dirdi dang nhi phan Do do, ngirdi ta qui irdc so diroc dung de chi dau + va so de chi dau TCr do, cac so 001, -010 va - 011 diroc ma hoa la 1001, 1010 va 1 01 1

- Djnh nghia

Cac so cho tren day chCra bit dau va tiep theo la bit tri tuyet doi Cac so dirdi dang diroc goi la cac so cd dau Doi vdi cac so thap phan cd gia tri Idn, chuyen doi nhi phan se chCra nhieu hon bit, nhirng dieu cot loi van nhu” cu: MSB (bit cd so Idn nhat) luon luon bieu thi dau va cac bit lai luon luon la tri tuyet doi Dirdi day la cac vi du ve chuyen do’ i cac so thap phan cd dau sang nhi phan:

(102)

- 16 —> 1001 0000

+ 25 —► 0000 0000 0001 1001 -1 —► 1000 0000 1000 0000

Nhi/ da biet, cac so 8 bit khong dau gom cac so ti/ den 255 Khi ta dung cac so co dau, ta da giam tri tuyet doi Ion nhat tU 255 xuong 127 vi ta can phai bieu thi ca hai tri so am va di/ong

Vi du, cac so am

ti/ 1000 0001 (- 110) den 11111111 (- 12710) va cac so difdng

tu* 0000 0001 (+ 110) den 01111111 (+ 10)

Tri tuyet doi Idn nhat la 127, xap xi mot nUa so dung vdi so nhi phan khong dau vdi cung so bit ChUng nao ma cac so lieu ngd vao dan trai tU-127 den +127, ta co the dung phep tinh 8 bit, ngi/di lap trinh van phai kiem tra xem tong co vi/ot tran hay khong, vi tat ca cac Idi giai 8 bit deu nam khoang - 127 den + 127

Neu so lieu co tri truyet doi Idn hon 127, thi dung phep tinh co 16 bit Vdi cac so 16 bit, cac so am:

tU 1000 0000 0000 0001 (-110) den 1111 11 1 111 1111 (-32 76710) va cac so di/ong:

ti/ 0000 0000 0000 0001 (+110)

den 0111 1111 1111 1111 (+32 76710)

Them vao do, ta thay rang tri tuyet doi Idn nhat xap xi bang mot nira cac so khong dau Tri/ can dung den dau + va - de thi/c hien so lieu, luc ta mdi dung so co dau

ITu diem chi'nh cua cac so co dau la cach dung don gian Cac so am va so di/dng la nhi/ nhau, chi tri/ co bit dau Vi vay, ta de dang xac dinh tri tuyet doi b ln g cach xoa bit dau va chuyen doi cac bit lai so thap phan ti/dng di/Ong So co dau bi han che viec sir dung vi mach so hoc thi/c hien phep tinh co cau true phirc tap C-ac so co dau thudng dUdc sir dung cac mach chuyen doi A/D

4.5 PHEP BU 2 - Phep bu

Phep bu cua mot so nhi phan la phep bu tUng bit cua so nhi phan Hinh 4.1 chi phep bu thUc hien b ln g mach logic VI moi bit dieu khien mot Invecto (cong dao), ngo bit la phep bu cua ngd vao bit Vi du, neu ngd vao la:

(103)

x3 x2 x, x0 = 0111

t h i p h e p b u c h o la:

X3 X2 X1 XO

Hinh 4.1 Qua cong dao ta nhan dirpc so bu Mot vai vi du:

1010 — ► 0101 M— (So bu 1) 1110 1100 — ► 0001 0011 * (So bu 1)

- Phep bu 2

Them vao ket qua bu cho ta so nhi phan bu Cong thu’c bu la:

Bu = Bu +

Vi du: Co so nhi phan 1011, xac djnh so nhj phan bu 2:

- Xac djnh so nhj phan bu 1: so nhj phan: 1011 0100 (so nhj phan bu 1)

- Xac djnh so nhj phan bu 2: 0100 + = 0101 (so nhj phan bu 2) Mot so vi du xac djnh so nhj phan bu 2:

So nhi phan — ► So bu 1So bu 2

1110 1100 — ► 0001 0011 — ► 0001 0100

1000 0001 — ► 0111 1110 ► 0111 1111

0011 0110 — ► 1100 1001 ► 1100 1010

- Cac so dirong va so am

Tir "trirdc" va "sau" co cung y nghia vdi cac so "am" va "dirong" tren true so

Hinh 4.2 minh hoa dieu tren day dai so: so danh dau goc cua true so, cac so dirong 6 ben phai va so am a ben trai Ta co true so nhu” tren Hinh 4.2 Hang tren la so nhj phan co dau va hang dirdi la so thap phan cd dau So nhj phan 1000 tirong di/ong vdi so thap phan -8 so 1001 tirong dirong vdi so -7 so 1010 thay cho so -6 v.v .Tir true so ta rut hai nhan xet:

- Thu1 nhat la. bit cd so Idn nhat MSB la bit dau: so bieu thi dau +: so bieu thi dau

(104)

- ThCr hai la, cac so am tren Hinh 4.2 la so nhi phan bu cua cac so di/ong, dieu the hien nhu1 sau:

So nhi phan

1000 1001 1CM0 1011 1100 1101 1110 1111 0 0 0001 0010 0011 0100 0101 0110 0111

—I -1 -1 -1 -1— I -1— I— j -1 -1 -1 -1 -1 -1 -1

-6 -5 -4 -3 0 +1 +2 +3 +4

So thap phan

Hinh 4.2 Cac so thap phan va cac so nhi phan bu

TRI S6T UY£TD6l SO DUONG s6 Am

1 0001 1111

2 0010 1110

3 0011 1101

4 0100 1100

5 0101 1011

6 0110 1010

7 0111 1001

8 - 1000

Ta thay rang, cac so dirong va so am la cac so nhi phan bu cua Noi cach khac, ta co the lay bu 2 cua so nhi phan dirong de xac dinh so nhi phan am tirong Crng Vi du:

310 “ ► 00112 - 310 < - 11012

Sau lay bu cua 0011 ta dirpc 1101, so bieu thi so - Nguyen tac cung dirpc Crng dung de thirc hien phep tinh ngirpc lai: tir so nhi phan am thirc hien phep bu de xac dinh so nhi phan dirong Vi du:

■ 710 -► 10012

+ 710 01112

Cong viec tien hanh tren day co y nghTa la: khi thuc hien phep bu la tuong duong vdi viec thay doi dau cua so. Oieu ket luan co y nghia quan vi no de dang dirpc thirc hien bang mach logic Khi nao mach logic lay bu thi ngo la so am doi v6i ngo vao Tir tirong chu dao d in den mach so hoc rat don gian, vdi mach logic ta co the thirc hien phep cong va phep tri/

Tom lai, thi/c hien phep bu ta can nhd:

1 Cac so dirong luon luon cd mot bit dau la so 0, cac so am luon luon cd mot bit dau la so 1

2 Cac so di/ong cd dang so cd dau Cac so am cd dang so bu

(105)

4.6 PHEP BU SO HOC

Luc dau, cac may vi tinh su1 dung cac so cd dau cho cac gia tri di/ong va am nen mach logic cd cau true phut tap Sau nay, mot ky s i/d a tim viec bieu thi bu cd the don gian phan cirng Tu" do, phep bu tro ma van nang de xir ly cac so dirong va am

- Phep cong

Hay xem xet phep cong cac so nhi phan, trirdng hop cd the xay ra:

Trudng hdp 1: Ca hai so deu la so di/ong Gia du, cd so +83 va +16 Chuyen doi sang so nhi phan ta cd:

+ 8310 * 0101 00112

+ 1610 0001 00002

Phep cong di/oc thi/c hien nhu” sau:

8310 0101 00112

+ 1610 + 0001 00002

9910 0110 00112

Khong cd viec gi khong binh thirdng xay Cong theo tirng cot ta diroc 0110 0011 Chuyen sang so thap luc phan, sau chuyen sang so thap phan:

0110 00112 — ► 63H (chuyen so nhi phan sang so thap luc phan) 63H ^ 9910 (chuyen so thap luc phan sang so thap phan)

So thap luc phan chuyen sang so thap phan cung cho ket qua trung hop vdi tong cua so thap phan nhi/ thi/c hien d tren

Trudng hdp 2: So am nho hon so di/ong Gia du cac so la + 125 va - 68 Chuyen doi sang so nhi phan ta cd:

+ 12510 — ► 0111 11012

- 6810 — ► 1011 11002

May vi tinh se tim cac so bo nhd va chuyen cac so den mach cong Cac so diroc cong theo tirng cot, bao gom ca cac bit dau, diroc ket qua:

12510 — ► 0111 11012

+ (- 6810) — ► + 1 1 1100, 5710 — ► 0011 10012

Vdi phep tinh 8 bit, ta thay khong de y den so nhd mang sang cot thir 9 Ta lien he banh xe rang cua dong ho chi thi nhi phan Khi banh xe rang thir 8 diroc phuc nguyen (tro ve vi tri ban dau), no khong tao so nhd vi khong cd banh xe thu' de nhan so nhd Ta cd the chuyen doi Idi giai bang so nhi phan sang thap phan nhi/ sau:

(106)

0011 10012 — ► 39H

39H — ► 5710

Trudng hop 3: So am Idn hon so dudng Hay lay so +37 va so -115 lam vi du Chuyen doi sang so nhi phan ta co:

+ 3710 0010 01012

- 11510 1000 11012 < — so da bu 2 Thi/c hien phep cong nhu1 cac tnfdng hop tren:

+ 3710 0010 01012

+(- 11510) + 1000 1101,

- 7810 1011 00102

Chuyen doi tiep tuc:

1011 00102 ► B2H B2H — ► - 10

Trudng hdp 4: Ca hai so deu am Gia sir co cac so la -43 va -78 Trong phep bu 2, cac so la:

- 4310 — ► 1101 01012

- 7810 — ► 1011 00102

Thirc hien phep cong diroc:

- 310 — ► 1101 01012

+ (- 7810) — ► +1011 00102

- 12110 — ► 1000 1 12 — ► 1000 1 12

Ta khong xem xet toi so nho cuoi cung vi ta thirc hien phep tinh 8 bit, 8 bit lai chuyen doi nhu" sau:

1000 011 12 — ► 87H

87H — ► -12110

Loi giai phu hop vdi Idi giai cong true tiep cac so thap phan

Ket luan: Cho du cac so dirong va am dude bieu thi dirdi dang bu mach dien cua phep cong v in tir dong tao Idi giai dung (gia dinh la tong thap phan nam khoang tir -128 den +127, neu khong, ta se co so tran)

- Phep trir

Phep trir diroc thirc hien nhir sau: So trir - So bi trir

(107)

Co tri/ong hop xay la: ca hai so deu di/dng; so am nho hon so di/Ong: so am Ion hon so dirong va ca hai so deu am Van de 6 day la co the sir dung mach cong de thi/c hien phep tri/ diroc khong? Trong dai so, ta biet rang cong mot so am tirong dirong vdi tri/ mot so di/ong Neu ta lay bu cua so bi tri/ thi phep cong thi/c hien vdi so tri/diroc lay bu se cho ket qua dung De hieu ro hon ta can phan tich trirdng hdp sinh thi/c hien phep tri/:

Trudng hdp 1: Ca hai so deu di/ong Gia du cac so la + 83 va + 16 Chuyen sang so nhi phan la:

+ 8310 0101 00112

+ 16,0 0001 00002

De thi/c hien + 83 trir di cho + 16, may vi tinh se giri so +16 den mach bu de cho ket qua:

- 1610 1111 00002

Sau cong so tren vdi + 83 nhi/ sau:

+ 83,o 0101 00112

+ (-16,0) + 1111 00002

67,o 1 0100 00112 0100 00112

Chuyen doi loi giai nhi phan sang thap luc phan, sau chuyen sang thap phan nhi/ sau:

0100 00112 43H

43H + 67,o

Trudng hap 2: So am nho hon so dirong Gia du rang so tri/ la +68 va so am la -27

Chuyen sang so nhi phan:

+ 68,0 0100 01002

- 27,o 1110 01012

May vi tinh chuyen so - 27 den mach bu de tao nen

+ 27,o 0001 10112

Sau thu’c hien phep cong nhir sau:

68,c 0100 01002

+ 27,0 + 0001 10112

95,0 0101 11112

Ldi giai dudi dang nhi phan chuyen sang thap phan nhi/sau:

0101 11112 5FH

5FH

(108)

Trudng hdp 3: So am Idn hdn so duong Ta lay so t r i r bang + 14 va so bi t r i /

bang 108 Chuyen sang dang nhi phan nhu" sau: + 1410 — ► 0000 1 102 - 10810 ► 1001 01002 May vi tinh chuyen sang so bu cua -108 la:

+ 10810 — ► 0110 1 1002 Sau thirc hien phep cong nhir sau:

+ 1410 — ► 0000 11102 10810 * + 0110 1100?

12210 0111 10102

Ldi giai nhi phan chuyen doi sang thap phan la: 0111 10102 — ► 7AH

7AH — ► +12210

Trudng hap 4: Ca hai so deu am Gia du cac so la - 43 va - 78 Chuyen sang bu 2 nhir sau:

- 4310 — ► 1101 01012 - 7810 — ► 1011 00102 Trirdc het lay bu cua -78, dirdc:

- 7810 — ► 0100 11102 roi cong lai:

- 4310 — ► 1101 01012 + 7810 — ► 0100 11102

3510 0010 00112 — ► 0010 00112 Chuyen Idi giai nhi phan sang dang thap phan:

0010 00112 — ► 23H 23H — ► +3510

- Tran

Trong phep tinh so hoc, gia tri tong nam ngoai khoang tir -128 den +127, tran se chuyen sang bit dau lam cho thay doi dau Ngirdi lap trinh phai viet lenh kiem tra viec thay doi bit dau

(109)

phep trir vi nhu" da biet mach so hoc thi/c hien phep cong doi vdi phan bu cua so bi tri/)

Trudng hap 1: Hai so duong. Gia du cac so phep cong la + 100 va + 50 Tong thap phan la +150, nen co so tran chuyen vao vi tri cua MSB So tran lam thay doi bit dau do Idi giai cung bi thay doi Ta hay xem xet phep cong di/6i day:

10010 — ► 0110 01002 + 5010 — ► + 0011 00102

15010 1001 01102

Bit dau la so arn ta thirc hien phep cong hai so di/ong Do do, so tran da gay sai sot

Trudng hdp 2: Hai so am. Gia du cac so phep cong la - 85 va - 97 Ta thu’c hien phep cong:

- 10 — ► 1010 10112 + (- 9710) — ► + 1001 11112

- 18210 1 0100 10102 — ► 0100 10102

Ldi giai 8 bit la 0100 1010 Bit dau la di/ong nhi/ng ta biet rang Idi giai dung phai chira bit dau am vi ta vu'a thu’c hien phep cong hai so am

- Phai xur ly so tran nhu" the nao?

Tran di/dc phan mem giai quyet, khong thuoc ve phan ci/ng Ngi/oi lap trinh phai thir de kiem tra tran sau moi phep cong hoac tri/ Si/ thay doi bit dau rat de phat hien Ngi/di lap trinh viet lenh so sanh cac bit cua hai so dude thu’c hien phep cong Khi hai so cd cung dau, bit dau cua Idi giai di/dc so sanh voi mot hai bit dau cua so phep cong Neu bit dau khac nhau, viet them lenh cho may vi tinh de xir ly phep tinh so hoc 16 bit

Lap trinh ngon ngCr Assembler co de cap den cac van de ve tran, ve cac phep tinh so hoc 16 bit va cac van de co lien quan

4.7 CAC KHOI SO HOC

Tri/dc nghien cuU mach logic thirc hien phep tinh so hoc 8 bit doi vdi cac so di/ong va am, ta can tim hieu ba mach co ban dung khoi so hoc Ba mach la mach bo nira cong, mach bo cong day du va mach bo dao co dieu khien Mot hieu ro cac mach ta mdi co the hieu may vi tinh thi/c hien phep cong va phep tri/ cac so nhi phan co Idn bat ky

- Bo ni/a cong

Khi cong hai so nhi phan, ta bat dau tu' cot co so nho nhat (LSB) Dieu nghia la ta phai cong hai bit co the co nho Mach dung de thirc hien phep cong la mach bo nu'a cong

(110)

Hinh 4.3 la mach logic bo nira cong Ngo cua cong X-OR duoc goi la tong ngo cua cong AND la so nho Cong AND co ngo 6 mu’c chi ca hai ngo vao cung mu’c Cong X-OR co ngo 0 mu'c neu mot hai ngo vao 6 mu’c 1, nhung ca hai ngo vao co cung mu’c (cung mu’c 1 hoac cung mu'c 0) thi ngo 6 mu’c Bang 4.2 la bang suthat cua mach logic bo nira cong

Khi kiem tra ngo vao cua Bang 4.2 ta nhan thay la bo nu’a cong thuc hien phep cong nhi phan

Bang 4.2: Bang suthat bo nu’a cong

A B NHOT TONG

0 0 0 0

0 1 0 1

1 0 0 1

1 1 1 0

Ddng thCrnhat: Ngo vao co A = va B = Ta tra loi: cong v6i bang vdi so nhd la Bo nu’a cong tra Idi: Tong = va so nhd =

Ddng thu' hai: Ngd vao cd A = va B = 1

Ta tra Idi: cong vdi 1 bang 1 vdi so nhd la Bo nu’a cong tra Idi: Tong = 1 va so nhd =

Ddng thif ba: Ngd vao cd A = 1 va B = Ta tra Idi: 1 cong vdi bang 1 vdi so nhd la Bo nu’a cong tra Idi: To’ng = 1 va so nhd =

Ddng th ittif: Ngd vao cd A = 1 va B = 1

Ta tra Idi: 1 cong vdi 1 bang vdi so nhd la 1

Bo nu’a cong tra Idi: To’ ng = va so nhd = 1

AB

Tong: A [3 + A [3

Hinh 4.3: Bo nu’a cong

Nhu ta thay, bo nu’a cong bat chudc bo nao ngudi de thuc hien phep cong cac bit Oieu khac nhat la bo nu’a cong thuc hien phep cong nhanh hon ta gap mot trieu Ian

- Bo cong day du

(111)

bo cong day du tren Hinh 4.4 (bo cong day du tren Hinh 4.4 la don gian nhat ngoai co nhieu bo cong day du co cau true khac)

Bang 4.3 la bang su” that cua bo cong day du Ta co the kiem tra hoat dong cua bo cong day du qua bang su' that Vi du, so nho' bang tren Hinh 4.4 ca hai hoac ca ba ngo vao A, B, C mu’c Oieu phu hop voi cot NHO Bang

4.3 Khi so le ngo vao A, B, C d mu’c lam cho ngo cong X-OR mu’c 1, cot TONG cua Bang sir that 4.3 chCrng thirc dieu

Khi xem xet tirng dong cua Bang sir that 4.3 ta thay bo cong day du thirc hien phep cong bit

A

30 CONG T ran

& £>AYE>U

C (FA)

7

Tong

b)

Hinh 4.4 Bo cong day du: a) Mach logic Bo cong day du b) Ky hieu

Ddng thirnhat: Ngo vao co A = 0; B = va C = Ta tra Idi: cong cong bang voi so nhd bang Bo cong day du tra Idi: To’ng = va so nhd =

Ddng thu"hai: Ngd vao co A = 0; B = va C = Ta tra Idi: cong cong bang vdi so nhd bang Bo cong day du tra Idi: Tong = va so nhd =

Bang 4.3: Bang sir that cua bo cong day du

A B c SO N H O TO N G

0 0 0

0 1

0 0 1

0 1

1 0

1 1

1 1

1 1 1

(112)

Ddng thCrtiS. Ngo vao co A = 0; B = va C =

Ta tra Idi; cong cong bang v6i so nhd b ln g Bo cong day du tra Idi: Tong = va so nh6 =

Ddng cuoi cung: Ngo vao co A = 1; B = va C = Ta tra ldi; cong cong bang vdi so nhd bang Bo cong day du tra Idi: To’ng = va so nhd =

Hinh 4.4a la mach logic cua bo cong day du va Hinh 4.4b la ky hieu cua bo cong day du cd ngo vao A, B va C Ngd vao thir ba C thudng duoc goi la so nhd vao, no den tU cot cd so thap hon Bo cong day du cd ngd ra, Tong va so nhd Ngd so nhd duoc goi la so nhd vi no di den cot cd so cao hon

- Bo dao co dieu khien

Hinh 4.5 la bo dao cd dieu khien Khi dao mu’c 0, no chuyen tu* ngd vao bit den ngd ra, dao mu’c 1, no chuyen so bu Vi du, so ngd vao la:

A7 A0 = 01101110

Ngd vao dao d mu’c se cho: Y7 Y0 = 0110 1110

Nhung neu ngd vao dao mu’c dan den: Y7 Y0 = 1001 0001

A A

Y Y

P A

Hinh 4.5: Bo dao cd dieu khien

Bo dao cd dieu khien giua vai tro quan Vi thuc hien phep trU, trudc het ta can lay bu doi vdi so bi trU Sau do, ta cong vdi phan bu cua so bi trU de cd Idi giai cua phep trU Vdi bo dao cd dieu khien, ta cd the thuc hien phep bu

1, sau bang cach don gian ta duoc so bu

4.8 BO CONG - BO T R I/

(113)

SO NHO RA cua moi bo cong day du la SO NHO VAO cua bo cong day du cua cot co b a c cao hon (co so cao hon) Cac so duoc xir ly la A7 A0 va B7 B0 va Idi giai la S7 S0 V6i phep ti'nh so hoc bit, thi SO NHO cuoi cung duoc bo qua v6 i ly da noi d tren Voi phep ti'nh so hoc 16 bit thi SO NHO cuoi cung duoc dUa vao phep cong cua byte cao

- Phep ctong

Phep cong duoc thuc hien nhu sau: A7 A6 A5 A4 A3 A2 A, A0 + b7 b6 b5 b4 b3 b2 B, B0 S7 s6 S5 S4 S3 S2 s, s0

Trong cong, TIN HIEU TRU" duoc giu mu’c Do do, so nhi phan B7 B0 di qua mach dao co dieu khien ma khong thay doi Sau do, cac bo cong day du cho TONG a ngo Cac bo cong cho ket qua dung bang cach cong cac bit tirng cot, chuyen cac SO NHO den cot co bac cao hon v.v Vi du, bat dau tUso LSB, bo cong day du cong A0, B0 va TRIT Phep cong cho TONG la S0 va SO NHO RA (Tran ra) dUa den bo cong day du bac cao hon Bo cong lai cong A,, B vdi SO NHC* VAO (tran vao) de cho S, va SO NHO RA (tran ra) Phep cong tuong tu duoc thuc hien doi vdi tirng bo cong day du lai va TONG xuat hien cac ngo

Hinh 4.6 Bo cong - bo trU nhj phan

Vi du, co cac so duoc cong la + 125 va - 67 Nhu vay A7 A0 = 01111101 va By B0 = 1011 1101 Ta xem phep cong duoc thuc hien nhu the nao?

0111 1101

+ 1011 1101

?

Vi tin hieu trir giu' mu'c cong nen SO NHO VAO dUa den cot LSB bang 0:

(114)

0111 1101

+ 1011 1101

?

Bo cong day du dau thu’c hien phep cong la:

0 + + = vdi so nhd bang

SO NHO RA cua bo cong day du thu" nhat (FA 1) la SO NHO VAO doi vdi bo cong day du thu” hai (FA 2)

1 M— SO NHO

0111 1101

+ 1011 1101

0

6 cot thir hai cd: + + = vdi SO NHO bang SO NHO duoc dUa den bo cong day du thu1 ba (FA 3)

0 < SO NHO

0111 1101

+ 1011 1101

10

Bang cach tuong tu, cac FA lai cong cac bit ngo vao cho den nao den FA cuoi cung

1 A SO NHO

0111 1101

+ 1011 1101

0011 1010

Khi SO NHO vao doi vdi MSB xuat hien, FA cho ket qua: + + = vdi SO NHO bang

Qua trinh cong ket thuc bang mot SO NHO cuoi cung

0111 1101

+ 1011 1101

10011 1010

Khi thuc hien phep tinh so hoc bit, SO NHO cuoi cung khong duoc xem xet tdi nhu da noi tren; Idi giai la:

S , S0 = 0011 1010

(115)

Ldi giai tuong dudng so thap phan + 58, no la tong dai so cua cac so ban dau la + 125 va - 67

- Phep trir:

Phep trU dUdc thuc hien nhu sau:

A7 A6 A5 A4 A3 A2 A, A0 - B7 B6 B5 B4 B3 B2 B, B0

S7Sg s s s s s s

Trong trCr, TIN HIEU TRU duoc giu mu’c Do do, bo dao co dieu khien cho so bu cua B7 B0 Them vao do, vi TIN HIEU TRU la SO NHO VAO doi v6i FA 1, nen mach xir ly cac so lieu nhu sau:

1 M— t in HIEU TRU"

a7 a6 a5 A4 A3 A2 A, Aq

+ B7 B6 B5 B4 B3 B2B, B0 S7 S6 S5 S4 S3 S2 S So

Khi A7 .,A0 = 0, mach cho so bu cua B7 B0 vi so dUdc cong vao so bu cua B7 B0 Khi A7 , A0 khac 0, ket qua chi'nh la phep cong cua A7 A0 vdi ^7 B0

Vi du, co cac so la + 82 va + 17 Nhu vay A A0 = 0101 0010 va B7 B0 = 0001 0001 Bo dao co dieu khien cho so bu cua B, so bu la 1110 1110 Vi TIN HIEU TRLT = tri/, nen mach thuc hien phep cong nhu sau:

1 < TIN HIEU T R I/

0101 0010

+ 1110 1110

1 01 00 0001

Doi voi phep tinh so hoc bit thi SO NHO cuoi cung khong duoc xem xet toi nhu da noi d tren; dd do, Idi giai la:

S7 S0 = 0100 0001

Ldi giai tUdng dudng vdi so thap phan la + 65, la hieu dai so cua hai so ban dau la + 82 va + 17

V i du

Hay xay di/ng bo cong - trir bit b^ng mach TTL

(116)

Ldi giai:

IC TTL 7483 cd bo cong day du Dieu nghl la IC cd the cong cac nira byte (nibble) De cong cac byte, ta can cd hai IC 7483, nhu gidi thieu tren Hinh 4.7 So nhd (chan 14) cua IC 7483 ben phai duoc dung nhu so tran vao (chan 13) cua IC ben trai Mach thuc hien duoc phep cong cac so nhi phan bit Hai IC 7486 tao nen bo dao cd dieu khien dung de thuc hien phep trir cac so nhi phan

A7 A6 Ap A4 B7 B6 B5 B4

t } 10 16

s 10, ia, 13

748-6

■3 '6 1<8 '

16 . 1

A3 A2 Al AO P3 B2 B1 3 0

lif 2| 6| 9

57 56 55 54

1 & 10 16

J T .13

7466

>3 •6 ' >8

16 4 7

7453

15| 21 j 9 1

53 S2 SI SO

13

Tin n.au conn trU

Hinh 4.7 Hai IC 7483 thuc hien duoc phep cong va trir cac byte

4.9 PHEP NHAN VA PHEP CHIA NH| PHAN

Microprocessor (pP) bit tieu bieu la 6502 va 8085 dung vdi phan mem thuc hien phep nhan va phep chia Noi cach khac, phep nhan duoc thuc hien b ln g cac lenh cong va phep chia duoc thuc hien bang cac lenh trU Do do, bo cong - bo trir duoc sir dung de thuc hien cac phep tinh cong, trU, nhan, chia

Vi du: Tinh phep nhan sau day: x = ?

So thir nhat - so - la so bi nhan; so thir hai - so - la so nhan Phep nhan la phep cong duoc lap lai, do, phep nhan vdi cung giong nhu cong Ian so 8:

8 + + + = ?

(117)

CAU HOI VA BAI TAP

4.1. Co the xay di/ng bo cong day du tu hai bo nu’a cong duoc khong?

4.2. Co the xay dung bo cong day du bit ngo vao so lieu duoc khong?

4.3. Co the xay dung bo cong day du bit ngo so lieu dupe khong?

4.4. So nhi phan co dau va so nhi phan khong dau co nhung dac diem nao giong va khac nhau?

4.5. Hay giai thi'ch trudng hop so bu cua so nhi phan 1000 (+810 ) bang

1000?

4.6. Trinh bay cau tao va hoat dong cua bo nira cong

4.7. Trinh bay cau tao va hoat dong cua bo cong day du

4.8* ThUc hien phep trUnhi phan cua 20010trUcho 12510?

4.9* Hay trinh bay hoat dong cua may vi tinh thuc hien phep trU sau: 18375

- 12618 ?

4.10* Hay thuc hien phep cong hai so nhi phan co gia tri thap phan la 75010 va 53810 bang cach sir dung cac so 16 bit

4.11. Thuc hien cac phep tong nhi phan sau day: a) 0000 1111 + 0011 0111

b) 0001 0100 + 0010 1001

c) 0001 1000 1111 0110 + 0000 1111 00001000

4.12. TrU cac so sau day: a) 0100 1111 - 0000 0101 b) 1111 1000 - 1010 0011 c) 1011 1110 - 1111 0000

4.13. Bieu thi cac so duoi day duoi dang cac so co dau: a) +23

b) +123 c) -56 d) -107

4.14. Doi cac so co dau du'di day cac so thap phan tuong duong: a) 0011 0110

b) '0 1110 c) 1111 1000

d) 1000 1100 011 0101

(118)

4.15. Tinh so bu 2 cua cac so sau day: a) 0000 1111

b) 0101 1010 c) 1011 1110

d) 1111 0000 1111 0000

4.16. Thu’c hien phep trir bit cua cac so thap phan du6i day bang cach bu 2: a) + 54, +65;

b) + 68, -43; c) +16, -38; d) -28,-65

4.17* Gia du rang, FD34H la so lieu ngo vao cua bo dao co dieu khien 16 bit Hoi ngo dao co dieu khien vdi he dem thap luc phan va vdi he dem nhi phan la bao nhieu?

4.18. Bieu thi so thap luc phan hai so ngo vao Hinh 4.6 la 7FH va 4DH Ngd bang bao nhieu neu tin hieu cong/tru” mu’c L?

4.19.Cac so ngd vao Hinh 4.6 la 0001 0010 va 1011 1111 Ket qua d ngd la bao nhieu neu tin hieu cong/tru1 d mu’c H?

(119)

CHUONG 5

IC TTL VA CMOS

Sau hoc xong chuong hoc vien co the:

Hieu duoc nguyen ly cau tao cua cac loai IC TTL va CMOS.

SCr dung d'Udc cac tinh nang cua IC TTL va CMOS lip rap mach logic dung cac thong so ky thuat.

Tudng hop cac loai IC TTL vdi TTL TTL vdi CMOS va CMOS vdi TTL lip rap mach.

Xac dinh dung he so tai.

Ap dung duoc cac loai dieu khien ngoai va dieu khien tai cua IC TTL.

SCr dung duoc IC TTL trang thai lip rap he thong digital va may vi tinh.

Van dung d'Udc cac logic am va logic dudng khi phan tich mach logic.

TONG QUAN

(120)

Trong qua trinh san xuat IC, ngUOi ta chia cac loai nhu sau: IC thuoc loai SSI (Small-scale IC) la IC co it hon 12 cong

IC thuoc loai MSC (Medium-scale IC) la loai co tU 12 den 100 cong IC thuoc loai LSC (Large-scale IC) co tren 100 cong

Hai loai ky thuat co ban de che tao IC la ban dan ludng cuc va ban dan oxyt kirn loai Ky thuat ludng cue dupe dung de che tao cac tranzito ludng cuc tren chip, loai ky thuat thir hai dupe dung de san xuat cac tranzito hieu ung trudng (MOSFET) Cac IC thuoc loai SSI va MSI thudng dupe che tao bang ban dan luong cue vi toe truyen dan nhanh hon va IC thuoc loai LSI thudng duoc che tao bang chat ban dan oxyt kirn loai vi co nhieu tranzito MOSFET duoc chua chung cung mot chip, chung chiem the ti'ch nho hon cac ban dan ludng cut

Ho digital la mot nhom cac linh kien tuong hop vdi cung mot mu’c logic va cung dien ap cung cap Tuong hop co nghia la ta co the noi ngo cua IC vdi ngo vao cua IC khac Vdi cac linh kien cung ho ta co the tao nen cac loai mach logic

- Cac ho luong circ

Cac ho ludng cUc co ban la:

Mach logic dung diot - tranzito (DTL) Mach logic dung tranzito - tranzito (TTL) Mach logic dung cach ghep Emito (ECL)

Ho IC dung diot-tranzito den da loi thdi Ho IC TTL dung toan tranzito de tao nen mach logic, cac IC SSI va MSI deu dung ho TTL Ho ECL dupe dung cho cac loai mach can hoat dong vdi toe cao

- Cac ho MOS

Cac ho thuoc loai MOS la: IC P-MOS dung tranzito MOSFET kenh p loai da Idi thdi IC N-MOS cac tranzito MOSFET kenh n tao nen, thudng duoc dung de che tao LSI, nhu pP va bo nhd ban dan IC CMOS dung tranzito MOSFET bu, dac biet duoc dung cho cac thiet bi can tieu thu it nang lupng nhu may ti'nh tui

5.1 CAC IC HO 74XX

- TTL tieu chuan

TTL dupe dung thay cho cum tir Transistor-Transistor-Logic Cac tranzito dung ho TTL tieu chuan la cac tranzito ludng cuc, cd dan dien cao va sire toa nhiet thap

(121)

vao Phan lai cua mach lam nhiem vu dao tin hieu cho toan bo mach la mot cong NAND ngo vao Cac tranzito ngo (T3 va T4) co ket noi kieu totem pole (mot tranzito npn mac noi tiep voi mot tranzito npn khac); tang loai thirdng thay hau het cac linh kien TTL Vdi loai tang totem pole nay, hoac tranzito tren (T3) dan, hoac tranzito dirdi (T4) dan Neu t3 dan, ngd Y mu’c H; T4 dan, ngd Y d mu’c L

Cac dien ap ngd vao A va B hoac la mu’c L (ly tudng la OV) hoac mu’c H (ly tudng la +5V) Neu A hoac B d mu’c L, cuc goc cua T, bi keo xuong xap xi bang +0,7V do, dien ap cud goc cua T2 giam xuong OV Do do, T2 ngung dan keo theo T4 ngUng dan va cuc goc T3 duoc dUa len mu’c H Vi T3 hoat dong nhu mot mach lap Emito, nen ngd Y duoc keo len mu’c H

Mat khac, ca hai ngd vao A va B deu d mire H, cac diot cuc Emito cua tranzito T, ngung dan diot d cuc Emito dan Oieu dan den cud goc cua T2 d mUc H, lam cho T4 dan bao hoa, ngd Y duoc dat d mu’c L Bang 5.1 tom tat tat ca cac trang thai d ngd va ngd vao Khi khong cd diot D, mach, T3 se cd ddng dan nhd ngd Y d mu’c L De tranh dieu do, ta can cd diot Dv Sut ap tren D, giu cho diot giua cac cud Emito - Bado cua T3 duoc phan cuc nguoc Bang cach nay, chi cd T4 dan ngd Y d mUc L

Bang 5.1: Co’ng NAND ngd vao

A B Y

0

0 1

1

1

- Ngo totem pole

Cac tranzito totem pole duoc dung de tao trd khang ngd thap Hoac T3 hoat ddng nhu mot mach lap Emito, hoac T, dan (ngd mu’c L) Khi T3 dan, trd khang xap xi 70 Q Khi T4 dan, trd khang ngd deu d mu’c L Dieu cd nghia la dien ap ngd cd the thay doi nhanh td trang thai sang trang thai khac, vi dien dung tap tan d ngd duoc nap va phong nhanh qua trd khang thap d ngd

- Thdi gian tre truyen dan va cong suat tieu tan

Mot cong TTL tieu chuan cd cong suat tieu tan khoang 10mW Thdi gian trd truyen dan la thdi gian can de ngd cua mot cong thay doi sau cac ngd vao thay doi Thdi gian tre truyen dan cua cong TTL xap xi 10 ns

Do thay doi thiet ke nhu o' Hinh 5.1 nha thiet ke cd the thay doi so ngd vao va chuc nang logic Tru' mot it ngoai le, cac ngd vao gom nhieu Emitd va cac ngd totem pole dude dung doi vo'i cac IC TTL khac Liet ke mot so loai IC TTL 74XX Vi du IC 7400 la IC cd cong NAND ngd vao Tu'o'ng tu' IC 7402 la IC cd cong NOR ngo vao, IC 7404 cd cong Invecto' v.v

(122)

Bang 5.2: Loai IC TTL tieu chuan

K f HIEU m6t a KY H liU Md TA

7400 cong NAND ngo vao 7420 cong NAND ngo vao

7402 cong NOR ngo vao 7421 cong AND ngo vao

7404 cong Invecto 7425 cong NOR ngo vao

7406 cong AND ngo vao 7427 cong NOR ngo vao

7410 cong NAND ngo vao 7430 cong NAND ngo vao

7411 cong AND ngo vao 7486 cong X-OR ngo vao

- Loai IC 54XX

Loai IC 74XX lam viec d giai nhiet tirO°C den 70°C va dien ap cung cap la +4,75V den +5,25V Day la IC thi/dng pham Con loai IC 54XX dung cho quan sir, IC 54XX lam viec giai nhiet tu” -55°C den 125°C, dien ap cung cap la +4,5V den +5,5V IC 54XX co cung chu t nang v6i cac IC loai 74XX, nen chung co the lip Ian hoac thay the cho du’Oc, loai IC 54XX co gia cao

- IC TTL toe cao

Mach dien tren Hinh 5.1 du’Oc goi la IC TTL tieu chuan Do giam trd khang ngo ra, IC loai co hang so thdi gian thap, nen thdi gian tre truyen d in nho Tuy nhien, trd khang nho lam tang cong suat tieu tan Cac IC ky hieu 74HXX la loai IC TTL co toe truyen dan cao IC TTL toe truyen dan cao co cong suat tieu tan vao khoang 22 mW va thdi gian tre truyen dan khoang ns cho mot cong

- IC TTL cong suat thap

(123)

- IC TTL Schottky

Khi tranziito chuyen tu” trang thai dan sang trang thai ngirng dan, can co thdi gian tre bao hoa De giam thdi gian tre bao hoa ngirdi ta dung IC TTL- Schottky

Hinh 5.2 minh hoa viec lap rap them diot Schottky cung v6i tranzito ludng circ cua mach TTL Vi diot Schottky co dien ap thuan tir 0,2V den 0,4V,_no tranh cho tranzito khoi hien tirong qua bad hda, dd loai trir du’Oc thdi gian tre bao hoa, lam cho toe chuyen trang thai nhanh hdn Ky hieu IC loai la 74SXX

D Schottky +V

i

Hinh 5.2: Diot Schottky tranh cho tranzito qua bao hoa

Cac IC TTL- Schottky hoat dong vdi toe cao, co kha nang hoat dong mot cach tin cay d tan so 100 MHz IC 74SXX co cong suat tieu tan khoang 20mW mot cong va thdi gian tre truyen dan khoang ns

- IC TTL Schottky-cong suat thap

Do vira tang noi trd vira dung diot Schottky, nha san xuat da dung hoa du’Oc ca yeu cau ve ccng suat thap Ian toe chuyen trang thai cao IC loai dirpc gci la IC TTL Schottky-cong suat thap, ky hieu la 74LSXX Moi cong loai TTL Schottky-cong suat thap co cong suat tieu tan khoang 2mW va thdi gian tre truyen dan khoang 10ns

Bang 5.3 gidi thieu cac loai IC TTL va tirong irng la cac gia tri ve cong suat tieu tan va thdi gian tre truyen dan

Bang 5.3: Cac gia tri cong suat va tre cua IC TTL

LOAI CAM GSUAT (mwn THffl GIAN T R l (ns)

Cong suat thap 35

Schottky-cong suat thap 10

Tieu chuan 10 10

Toe cao 22

Schottky 20

IC TTL Schottky-cong suat thap la loai IC dung hoa tot nhat giCra cong suat tieu tan va thdi gian tre truyen dan, no du’Oc nhirng ngirdi thiet ke mach digital hay dung Con can dong Idn, ta co the dung IC TTL tieu chuan Hoac can toe chuyen trang thai nhanh, ta dung IC TTL Schottky, loai IC cong suat thap va toe cao it du'Oc sir dung

(124)

5.2 CAC THONG SO CUA IC TTL

Cac IC TTL loai 74XX lam viec mot cach tin cay giai nhiet tir JC den 70°C va giai dien ap cung cap tCr +4,75V den +5,25V phan dirdi day, thuat ngir trudng hdp xau nhat cc nghia la cac thong so (dong vao, dien ap ra, v.v ) dUdc dudi dieu kien xau nhat cua nhiet va dien ap

- Cac ngo vao tha noi

Khi ngo vao cua IC TTL d mu’c H (ly tudng la +5V), dong Emitd xap xi

(Hinh 5.3a) Khi ngo vao cua IC TTL tha noi (khong noi vdi mach Hinh 5.3b) mach bi hd nen khong co dong Emitd Do do, ngo vao TTL tha noi tUdng dUdng vdi ngo d mu’c H Vi ly dc nay, ddi cac ngo vao cua TTL dUdc tha noi khong dung tdi Doi vdi mot so IC, co mot ngo vao ho mach, cac ngo vao khac dupe noi vdi mach, thi co’ng van lam viec chinh xac

Nhupc diem cua ngo vao tha no’i la mot co’ ng vao ho mach, no nhu mot anten thu cac nhieu dien tir Trong mot vai moi trudng, nhieu du manh gay hoat dong sai Vi ly nay, co loai cong ta noi cac ngo vao khong dung vdi dien ap cung cap +Vcc (Hinh 5.3c), cung co loai co’ng ta phai noi cac chan khong dung vdi dat (xem muc 5.8) Doi vdi cac IC 74SXX va 74LSXX ta co the noi cac chan khong dung tdi nhu Hinh 5.3c, con doi vdi cac IC 74XX, 74L, va 74H ta phai dung dien trd keo len nhu tren Hinh 5.3d.

+ 5V - +5V~

4k

+5V-a) Ngo vao a milc H

+5V

U K

4 k

Mo

b) Ngo vao mo ti/ong d Jong voi ngo vao o m(lc H +5VI

l k

A E3 ‘

c) Ket noi tr iIc tiep vb\ nguon cung cap d) Ngo vao o mijfc H nho dien tro keo len

Hinh 5.3.

- Trirdng hop xau nhat doi vdi cac dien ap ngo vao

(125)

tang VIL len den 0,8V van dupe coi la trang thai L ngo vao, vi ngo v ln giu dirpc mu’c H Noi cach khac, trang thai L ngo vao co gia tri tu" OV den 0,8V So lieu ky thuat cua ngo vao trirdng hop xau nhat mu’c L ghi la:

VUmax = 0,8V

Neu dien ap ngo vao I6n hon 0,8V thi trang thai ngo khong chac chan, gia tri dien ap b ngo khong xac dinh

4 k

1 1 , k

i 130

T3

> r D l

-+5V

vi x

-• * - • —I T2

TI

VO

i

• —I T4

a) Inverter l k

5V

2V

0.& \

OV

Ngd vao a mtic H chac chan

Khong xac dinh

Ngo vao a mtic L chac chan

b) Tieu chuan dien ap ngd vao

Hinh 5.4: IC TTL

5V

Ngo a miic H chac chan

2,4V-Khong x ic dinh

0 ,4 \

OV

Ngd a mtic L chac chan c) Tieu chuan dien ap ngo

Gia du, V, bang +5V n h iro Hinh 5.4a Day la trang thai H va du’Oc ky hieu la V,H Dien ap co the giam den 2V ma khong thay doi trang thai ngo Noi cach khac, trang thai H d ngo vao VIH cho phep tir +2V den +5V So lieu ky thuat cua ngo vao trirdng hop xau nhat mu’c H ghi la:

VIH v IH = +2V

Khi dien ap ngo vao nho hon +2V thi trang thai ngo khong doan trirdc dupe Hinh 5.4b tom tat cac thong so dien ap ngo vao da trinh bay tren Nhu da biet, dien ap ngo vao nho hon +0,8V la trang thai L chac chan O ngo vao dien ap Idn hon +2V la trang thai H chac chan Con dien ap ngo vao giua +0,8V va +2V la khong xac dinh vi se khong dam bao dien ap ngo dung nhuyeu cau

- Trirdng hop xau nhat doi vdi dien ap ngo ra

Mot cach ly tudng, ngo ra, trang thai L la OV va trang thai H la +5V Ta khong the co cac gia tri ly tuong vi co sut ap ben cac linh kien TTL Vi du, dien ap ngo mu’c L nhu Hinh 5.4a, T4 dan va co sut ap nho tren T4 Vdi IC TTL, dien ap ngo tii OV den +0,4V dupe coi nhu la mu’c L va ky hieu la VQ, Dieu co nghia la trang thai L ngo cua linh kien TTL co the co cac gia tri tir OV den +0,4V So lieu ky thuat cua ngo trudng hop xau nhat mu’c L ghi ia:

^OL Max = +0,4V

(126)

Khi dien ap ngo d mu’c H, T3 hoat dong nhu" mot tang lap Emito Vi sut ap tren T3, D, va tren dien trd 130Q nen dien ap ngo se nho hon dien ap cung cap +Vcc Vdi cac IC TTL, dien ap ngo d trang thai H du’Oc ky hieu la VOH, co gia tri tu1 +2,4V den +3,9V thuoc vao dien ap cung cap, nhiet va tai So lieu ky thuat doi vdi IC TTL co ngo d mu'c hi trudng hop xau nhat la:

VoHmin = +2,4V

Hinh 5.4c tom tat cac trang thai d ngo Nhu da chi ra, neu dien ap ngo nhd hon +0,4V thi ngo d trang thai L; neu dien ap ngo Idn hon +2,4V thi trang thai ngo chac chan d mu’c H va neu dien ap ngo d giuTa gia tri tCr +0.4V den +2,4V thi khong xac dinh dupe mu’c dien ap dudi cac dieu kien xau nhat

- Cac mat cat va cua so

Cac dac ti'nh ngo vao d Hinh 5.4b dupe goi la mat cat ngo vao TTL Moi o chu nhat tren Hinh 5.4b dupe goi la cira so Co cira so d mu’c L (OV den +0,8V), cira so khong xac dinh (+0,8V den +2V) va cira so d mu’c H (+2V den +5V) Tuong tu, Hinh 5.4c la mat cat ngo day, ta thay cira so d mu’c L tir OV den +0,4V; cira so khong xac dinh tu" +0,4V den +2,4V va cira so d mu’c H tCr +2,4V den +5V

- Cac gia trj can nhd

Ta da biet cac trang thai L va H doi vdi cac dien ap ngo vao va ngo Cac gia tri dien ap la:

V |L max — +0,8V

V |H — +2V

^ O L max — +0,4V

* OH +2,4V

Day la cac gia tri trudng hop xau nhat nhu tren Hinh 5.4 b va c 6 ben ngo vao, dien ap phai nhd hon +0,8V de xac djnh la trang thai L d ngo vao va phai Idn hon +2V de dupe coi nhu la trang thai H d ngo vao ben ngo ra, dien ap phai nhd hon +0,4V de xac djnh la trang thai L d ngo va Idn hon +2,4V de xac djnh la trang thai H d ngo

- Kha nang tirong hop

Cac IC TTL co kha nang tuong hop vi d ngo cac cira so mu’c L va mu’c H lot vao cac cira so mu’c L va mu’c H d ngo vao Do do, ngo cua IC TTL dieu khien thich hop vdi ngo vao cua cac IC TTL khac Vi du, Hinh 5.5a la mot IC TTL dieu khien mot IC TTL khac, IC dau dupe goi la dieu khien va IC thir hai la tai

Hinh 5.5b la tang cua dieu khien TTL noi vdi tang vao cua tai TTL Ngo cua dieu khien dang d trang thai thap, vi ngo vao cd dien ap nhd hon +0,8V la mu’c L d ngo vao, ngo cua dieu khien (OV den +0,4V) tuong hop vdi cac yeu cau d ngo vao cua tai (Idn hon +2V)

- Cap dong, nhan ddng

(127)

den Colecto cua T4 Vi T4 dan bao hoa, nen no hoat dong nhu mot nhan dong, dong qui Udc chay qua T4 xuong dat nhu dong nude chay xuong be

Tuy vay, ngo cua IC TTL tieu chuan mu’c H (Hinh 5.5c), dong Emito khoang 40 |jA (trudng hop xau nhat) nhu hudng da chi Dong qui Udc chay tu" T3 den Emito Tv Trong trudng hop nay, T3 dang hoat dong nhu mot cap dong So lieu ky thuat cho biet dong vao trudng hop xau nhat la:

IlLmax = - 16 mA IlHmax = + (jA

Dau - chi rang dong qui dinh chay tu" IC ra; dau + co nghia la dong qui dinh chay vao IC Tat ca cac so lieu ky thuat cua IC deu dung ky hieu Nhu so lieu da de cap trudc day, dong c u t dai ngo vao la 1,6 mA (hudng ra) ngo mu’c L va dong 40 pA (hudng vao) ngo vao d mu’c H

TTL OIEU KHIEN * TTL TAl

a)

(128)

(mot Ian nu’a, dau - co nghia la dong qui irdc di khoi IC va dau + co nghia la dong di vao IC) Nhu1 da biet, ngo vao TTL trirdng hop xau nhat co cac dong la:

l,Lmax = -1.6m A ^IH max = +40 MA

Vi cac dong ci/c dai gap 10 Ian Idn hon cac dong ngo vao, ta co the noi 10 Emito cua IC TTL den ngo cua IC TTL khac

- Tai tieu chuan

So lieu ky thuat cua cac IC TTL chi rang IC loai 74XX co the co nhan dong t6i 16 mA, ky hieu la:

loLmax = +16 mA va co the co cap dong tdi 400 pA, ky hieu la:

loHmax = ‘ 400 pA

Hinh 5.6a chi dien ap ngo mu’c L (trirdng hop xau nhat) Nhan thay rang mot dieu khien TTL du’Oc noi vdi 10 tai TTL day ta thay nhan dong cua dieu khien TTL la 16 mA, bang dong tong cua 10 dong tai TTL mu’c L, dien ap d ngo du’Oc bao dam mu’c L dien ap bang hoac nho hon +0,4V So tai TTL Idn nhat la 10, vdi so tai nha san xuat mdi bao dam IC hoat dong trang thai L

Oieu khien74OO

0,4V 0.4V

a) Oieu khien TTL va tai

Tai 0

Oieu khien 0 1 0,4V

0 , 4V

0,&V

k Ta i 7ADD

• w

b) Nhieu ta o nen trang thai H

D\eu khien 0 ( 0,4V

• + r " Y A / 0,8V

* Tai 0

c) Nhieu tao nen trang thai L

Hinh 5.6

Hinh 5.6b chi dien ap ngo mu’c H (trirdng hop xau nhat) vdi cap dong cua dieu khien la 400 |jA cung cap cho 10 tai TTL, moi dong tai la 40 pA Doi vdi cap dong nay, dien ap du’Oc bao dam la +2,4V hoac Idn hon dirdi dieu kien xau nhat

- Qui tac tai

(129)

Bat dau bang mat cat d Hinh 5.8a, do la mat cat cua loai IC TTL tieu chuan Phi'a ben trai la mat cat cua dac tinh ngo Cira so ngo mu’c H tir +2,4V den +5V vdi nguon dong la 400 pA; cira so ngo mu’c L tu1 +2,4V den +5V vdi nhan dong la 16 mA Phia ben phai la mat cat ngo vao cua IC TTL tieu chuan

Cira so mu’c H tu” +2V den +5V vdi dong ngo vao la 40 pA cira so mu’c L tu" OV den +0,8V vdi dong ngo vao la 1,6 mA

L h Ch n t

T Y +

— ► 10 E m it/r

b ) S o dau cua cong o tra n q th a i H

Hinh 5.7

Khac nhat cac loai TTL la cac dong Tren cac hinh tu” Hinh 5.7a

den Hinh 5.8d la cac dong ngo vao va ngo cho m6i loai IC TTL Vi du, IC dieu khien dung loai TTL Schottky-cong suat thap (Hinh 5.8d) co cap dong la 400 pA va nhan dong la mA; tai dung loai TTL Schottky-cong suat thap doi hoi dong vao la 20 pA (trang thai H) va 0,36 mA (trang thai L) Cac so lieu khac voi so lieu cua loai TTL tieu chuan (Hinh 5.8a) vi dong ngo cua chung la 400 pA va 16 mA va dong vao la 40 pA va 1,6 mA

Cac mat cat cua IC TTL toe cao khong co Hinh 5.8 vi IC TTL Schottky tren thu’c te da thay the cho IC toe cao moi ting dung Khi phan ti'ch sir tirong hop cua cac loai IC TTL ta co the ti'nh du’Oc he so tai (cac dau cua cong: fanout) Bang 5.4 tom tat cac loai dau cua cac cong tirong ting v6i cac dieu khien va cac loai tai TTL

Cac IC TTL tieu chuan co kha nang tuong hdp vi cac cira so mtic H va mtic L lot vao cira so ngo vao tirong ting Noi cach khac, +2,4V luon luon du Ion cho ngo vao mtic H cua tai TTL va +0,4V du nho cho ngo vao mtic L Ho'n ntia, ta da de dang nhan thay rang cap dong Ion gap 10 Ian dong vao mtic L So tai I6n nhat cua tai TTL co the hoat dong mot cach tin cay cac dieu kien xau nhat,

(130)

du’Oc goi la he so tai (fanout) Vdi loai IC TTL tieu chuan, so dau cua cong la 10 vi mot dieu khien TTL co the keo theo 10 tai TTL

Tat ca cac hinh lai co cung cira so dien ap Cac trang thai ngo luon luon la (0, +0,4V) va (2,4V, +5V) va cac trang thai ngo vao la (0, +8V) va (+2V, +5V) Vdi cac dieu kien do, tat ca cac IC loai TTL deu cd kha nang tirong hop, cd nghia la ta cd the dung loai IC TTL lam dieu khien va cd the dung mot loai TTL khac lam tai

5V 5V 5V 5V

2.4V

4 0 uA uA

2,4V

2 0 uA 10 uA

2V Khong xac dinh

2V

Khong xac dinh Khong xac dinh Khong xac dinh

0,5V ,6 \

0 4V 0,4V

OV 16 mA OV 1,6 mA OV ,6 mA OV 0,16 mA

5V

a) TTL tieu chuan b) TTL cong suH t th a p

1 ma

5V

5 uA

5V

4 0 uA

5V

2 uA

2,4V

2V 2,4V

2V

0,6V 0,4V

Khong xac dinh

0,6V

Khong xac dinh Khong xac

dinh

Khong xac dinh 0,4V

OV mA OV mA OV mA OV , mA

c) TTL S c h o ttk y d ) TTL S chottky-cong s u a t th a p

Hinh 5.8: Cac mat cat ngo vao/ngo cua IC TTL

Bang 5.4: So dau cua cong

TTL TAI TTL

d i£u KHIEN 74 74H 74 L 74S 74 LS

74 10 40 20

74H 12 10 50 10 25

74L 20 10

74S 12 10 100 10 50

(131)

5.3 CAC CONG HO MACH COLECTO

Mot so IC TTL dung ngo ho mach Colecto thay the cho ngo totem pole Nhu vay cac IC chi sir dung tranzito duoi (T4) cap tranzito dung lam totem pole Hinh 5.9a la cong NAND ngo vao va ngo hd mach Colecto Vi Colecto cua T4 bi ho mach, nen mot cong nhu vay chi lam viec ta noi Colecto vdi mot dien trd keo len d ben ngoai (Hinh 5.9b).

Cac ngd cua cac co'ng hd mach Colecto cd the dupe noi chung vdi va noi cung vdi mot dien trd keo len Vi du, Hinh 5.9c la cong TTL cung noi vdi dien trd keo len Cach noi nhu vay cd Uu diem la ket hop ngd cua co’ng ma khong phai them cong OR cuoi cung Viec ket hop dupe thuc hien bang cach noi true tiep cua ngd den dau dudi cua dien trd keo len chung cho cong Dieu rat tien loi cd nhieu cong dupe noi vdi theo luat OR Vi du, d mot vai he thong, cac ngd cua 16 IC ho mach Colecto dupe noi cung vdi mot dien trd keo len

Nhupc diem Idn cua cac coYig hd mach Colecto la toe chuyen mach cua IC loai cham Vi dien trd keo len cd tri so chting vai kQ, dan den h ln g so thdi gian Idn nhan tri so dien trd vdi tri so dien dung tap tan d ngd Toe chuyen mach cham cua IC TTL hd mach Colecto bde lo ro ret nhat d ngd tin hieu chuyen tu” trang thai L sang trang thai H

+5V

c ) C ac n g o her m a ch C o le c to d u o c

Hinh 5.9: TTL hd mach Colecto

(132)

5.4 CAC IC TTL BA TRANG THAl

Dien tra keo len dung chung doi vdi cac IC ho mach Colecto du’Oc goi la keo len thu dong, vi dien ap cung cap keo dien ap ngo len den mu’c H tat ca cac tranzito Hinh 5.9c ngirng dan Co mot cach keo len khac, keo len tich cue Mach sir dung ngo totem pole du’Oc cach dieu de tang toe nap cho cac tu tap tan ngo Ket qua la hang so thdi gian giam xuong, dien ap d ngo chuyen trang thai tu1 L sang H nhanh hdn

- Tai IC TTL tieu chuan khong hoat dong?

Neu ta noi cac cong TTL theo luat OR, mot hoac nhieu IC se bi pha hong Tai sao? Hinh 5.10 la mot vi du ve cach thiet ke yeu kern Hay chu y rang cac chan d ngo cua hai IC TTL tieu chuan dUdc noi v6i Neu ngo cua IC thu1 hai d mu’c L, T4 dan va hien tudng ngan mach xuat hien Neu dong thdi ngo cua IC thu” nhat d trang thai H, T, hoat dong nhu mot mach lap Emitd, mach keo dien ap ngo len mu’c H VI ca hai tranzito deu cung dan, chi co dien trd 130 Q noi giCra dien ap cung cap va dat, cuoi cung dan den mot dong qua tai lam hong mot hai IC

- Ngo vao Disable mu’c L

Nhir d tren ta thay cac IC TTL tieu chuan noi theo luat OR lam cho mach xuat hien dong qua tai va pha hong IC Chinh sir bat lire cua cac IC co tang totem pole noi theo luat OR dan den viec can thiet che tao IC TTL trang thai V6i cac linh kien loai nay, ta co the noi true tiep cac ngo totem pole ma khong so hong IC

Hinh 5.11 la mach ddn gian cua mach Invectd trang thai Khi Disable d mu’c L, circ Badd va circ Colecto cua T6 du’Oc keo xuong mu’c L, lam cho T7 va T8 ngirng dan Do do, Emitd thir hai cua T, va catot cua D, du’Oc tha noi Doi vdi dieu kien nay, phan lai cua mach hoat dong nhu mot mach dao Khi ngo vao A d mu’c thap dan den J2 va T5 ngung dan, T3 va T4 dan tao nen mu’c H d ngo Mat khac, ngo vao mu’c H lam cho T2 d in , no dieu khien T5 dan bao hoa va lam cho ngo d mu’c L Bang 5.5 tom tat hoat dong cua cong dao trang thai

+5V

(133)

- Ngo vao Disable mure H

Khi Disable d mu’c H, c u t Bade va c u t Colecto cua T6 len mu’c H, lam cho T7 dan va T8 d in bao hoa Mot cach ly tudng, T8bi keo xuong mu’c L, lam cho T2 va T5 ngung dan va T3 cung ngung dan, vi Dt dan Noi cach khac, cu t Bado cua T3 cung ngung d in vi Dt dan, c u t Bado cua T3 chi dat +0,7V so vdi dat, dien ap khong du de cho T3 va T4 dan vi ca hai tranzito T4 va T5 ngung d in , nen ngo Y tha noi Trudng hop ly tudng, trd khang Y cua ngo nhin tir phi'a sau vao la vo cung

Bang 5.5 tom t i t hoat dong cua trang thai tro khang cao Nhu Bang 5.5

trinh bay, Disable d mu’c H, khong can quan tarn den ngo vao A, vi no khong gay tac dong den ngo Y Luc do, ngo Y khong noi v6i phan mach phi'a trUdc, Y dUdc tha noi Tom lai, ngo cua mach Hinh 5.11 d mot trang thai: d mu’c L, mu'c H hoac tha noi

- Ky hieu logic

Hinh 5.12a la mach tuong dUdng cua Invectd trang thai Khi Disable d mu’c L, chuyen mach dong lai, mach hoat dong nhu mot cong dao binh thudng Khi Disable d mu’c H, chuyen mach bi hd, ngo Y dUdc tha noi

Hinh 5.12b la ky hieu logic doi vdi Invectd trang thai Khi thay ky hieu nay, ta hieu la Disable d mu’c L, Invectd hoat dong dung nhu mot Invectd binh thudng, nhung d mu’c H, ngo Y dUdc tha noi

+5V

Hinh 5.11: Invectd trang thai

A - * j ^ » * — O - Y A ^

Disable Disable

a) M ach tu o n q dirong cua In ve cto b) Ky hieu logic cua Invecto c) Ky hieu logic cua bo dem

Hinh 5.12: Sd logic trang thai:

(134)

- Tang dem trang thai

Nhd cach dieu mach dien d Hinh 5.11 ta co tang dem trang thai Ky hieu logic cua tang dem trang thai duoc gidi thieu nhu1 tren Hinh 5.12c Tang dem trang thai duoc coi nhu la mot chuyen mach binh thudng Khi Disable d mirc L, mach hoat dong nhu mot tang dem khong dao, chuyen mach dong lai, mach dan, luc do, Y = A Nhung Disable d mu’c H, ngo dUdc tha noi, chuyen mach bi hd, mach ngung dan

- Cau tao BUS

Trong Hinh 5.13 cac bo ghi chuyen dUdc noi v6i mot BUS chung Cac tang dem trang thai dieu khien luong so lieu nhi phan giUa cac bo ghi chuyen Vi du, neu muon dUa noi dung cua bo ghi chuyen A len BUS, ta dat Disable mire L cho bo ghi chuyen A va doi vdi cac bo ghi chuyen B va C thi dat Disable mu’c H Khi do, tat ca cac chuyen mach trang thai d bo ghi chuyen A kin mach tat ca cac chuyen mach trang thai khac ho mach Ket qua la noi dung cua bo ghi chuyen A duoc dUa len BUS

Y tudng cot loi de cau tao nen BUS la lam cho Disable cua tat ca cac bo ghi chuyen deu mu’c H, chi trU bo ghi chuyen nao can dua noi dung cua no len BUS thi Disable dat mu’c L Thuc hien dieu khong chi giam tong so day noi ma don gian thiet ke cho cac he thong vi ti'nh va digital

(135)

5.5 OIEU KHIEN NGOAI DOI VOI CAC TAI TTL

De dieu khien mot tai bang nguon ben ngoai, ta can dap uTig cac yeu cau d ngo vao cua IC TTL ve dien ap va dong dien Doi vdi IC TTL tieu chuan mu’c L, dien ap ngo vao phai ti/OV den +5V va dong dien xap xi 1,6mA O mu’c H, dien ap phai tu" +2V den +5V va dong dien xap xi 40 |jA Sau day la mot vai cach dieu khien tai TTL

- Oieu khien bang chuyen mach

Hinh 5.14 la phi/dng phap dieu khien ngo vao TTL bang chuyen mach Khi chuyen mach ho, ngo vao du’Oc keo len den +5V Trong trudng hop xau nhat, dong ngo vao cua IC khoang 40 juA Do do, dien ap ngo vao hoi nho hon dien ap cung cap mot chut vi cd sut ap nho tren dien trd keo len:

Vin = V -(4 n A )(1 kQ) = 4,95V

Dien ap van Idn hon dien ap yeu cau toi thieu la +2V Khi chuyen mach ddng, chuyen mach dan dien, ngo vao dupe keo xuong mu’c L (tiep dat) Trong trudng hop xau nhat, ddng ngd vao la 1,6 mA Nhan ddng khong gay trd ngai, vi no chay qua chuyen mach xuong dat

- Tinh I6n cua dien trd keo len

Binh thudng dien trd keo len khoang kQ Sau day la mot so yeu to de xem xet lua chon tri so dien trd keo len O Hinh 5.14, nhan ddng chuyen mach dan dien la:

5V

I = - = mA kQ

Dien trd keo len cang nhd, nhan ddng cang Idn Neu nhan ddng qua Idn lam anh hudng den nguon cung cap, nen ta phai dung dien trd du idn de cd nhan ddng pham vi dung thCr

Mat khac, dien trd keo len qua Idn cGng anh hudng den toe truyen dan Trudng hop xau nhat xay chuyen mach hd Vi du, dien dung ngd vao la 10 pF, nhu Hinh 5.14, hang so thdi gian la:

Rc = (1 kQ) (10pF) = 10 ns

+5V

k

lk

V

1

Hinh 5.14: Chuyen mach dieu khien ngd vao TTL

(136)

Neu dien trd keo len cang I6n thi hang so thdi gian cung cang Idn, cd nghia la toe chuyen trang thai cang cham vi dien dung ngd vao phai nap qua dien tro keo len Dien trd keo len khoang tu’ 1 kQ den 10 kQ, cho ta nhan ddng va hang so thdi gian chap nhan duoc nhieu mach ting dung

- Dieu khien blng tranzito

Hinh 5.15a la mot cach dieu khien tai TTL Ta dung chuyen mach bang tranzito de dieu khien trang thai cua ngd vao TTL Khi Vin d mtic L, tranzito ngirng d in , tudng dudng vdi trudng hdp chuyen mach hd Luc dd, ngd vao TTL dUdc keo len +5V qua dien trd kQ Khi Vin d mtic H, tranzitc bao hoa, tUdng dUdng vdi trudng hdp chuyen mach dan dien Trong trudng hdp nhan ddng ngd vao la

1,6 mA Tranzito dao tin hieu dieu khien Vin Neu khong muon dao Vin, ta them mot cong dao nh ud Hinh 5.15b.

- Dieu khien bang khuech dai toan tur OP-AMP

Doi ngudi ta dung OP-AMP de dieu khien ngd vao TTL Vi OP-AMP duoc cung cap bang dien ap doi xting +15V va -15V, nen ta phai can than noi vdi tai TTL Hinh 5.16 la cach dung OP-AMP 741 de dieu khien ngd vao TTL Mot cach ly tudng, ngd cua OP-AMP cd dien ap dao dong tti +15V en - 15V Dien ap duong cua OP-AMP ddng mach tranzito, lam cho ngd vao TTL xap xi cd mtic dien ap +5V Can chu y den diot d cuc Badd cua tranzito No bao ve cho circ Badd khoi bi dien ap ngUdc Tranzito 2N3904 cd dien ap cuc dai giua Badd va Emitd la:

VBE max = - 6V

+5V +5V

lk

2N 3904 y,1 k ■/ l k

A

-B

a) Tranzito dieu khien ngo vao TTL

2N 3904

b) Invecto loai bo ddng nguoc

Hinh 5.15

5V

(137)

Vi dien ap am ngo cua OP-AMP khoang -15V, nen ta can su" dung diot bao ve giCra cuc Bado va dat nhu chi Hinh 5.16 Diot giu cho dien ap cuc Bado khoang - 0,7V dien ap ngo cua OP-AMP co gia tri am

- Dieu khien blng bo so sanh

15V

+ 15V + 5V

b) Giao dien cua bo so sanh LM 3 9

Hinh 5.17

Hinh 5.17a la so bo so sanh dien hinh Doi can duoc phat hien dien ap vao la am hoac duong de cung cap cho ngo vao cua IC Can chu y hai dieu: thCr nhat la dien ap cung cap bo so sanh la +15V; thir hai la bo so sanh co tranzito ngo ho mach Colecto Tranzito co nhan dong co the duoc noi den cac nguon cung cap khac

Hinh 5.17b chi cach noi bo so sanh dien hinh LM 339 vdi tai TTL Vi ngo hd mach Colecto, nen ta co the noi ngo cua bo so sanh v6i nguon cung cap +5V qua dien tro keo len kQ Khi Vjn duong, nhan dong cua tranzito lam cho T5 ngung dan, ngo vao cua TTL duoc keo len +5V Khi Vin am, T5 dan bao hoa, ngo vao TTL mu’c

5.6 CAC IC TTL OIEU KHIEN TAI NGOAI

Vi TTL tieu chuan co nhan dong len t6i 16 mA, nen ta co the dung TTL dieu khien mot tai ngoai nhu role, LED v.v Hinh 5.18a la cach dieu khien tai ngoai Khi

(138)

ngo cua TTL mu’c H, khong co dong tai, nhirng ngo cua TTL d mu’c L, dau cuoi cua dien trd RL dUdc xem nhir tiep dat Ddng tai du’Oc xac dinh nhir sau:

5V Ic

■RL

R L

Vi TTL co nhan ddng c u t dai bang 16 mA, nen dien trd tai co gia tri gidi han circ tieu la:

5V

Rl = - = 312 Q

16 mA

- Oieu khien LED

Hinh 18b la mach dieu khien LED Khi TTL co ngo d mu’c H, LED khong phat sang Khi TTL co ngo d mu’c L, LED phat sang Neu sut ap tren LED la 2V, dong LED khi ngo cua TTL d mu’c L bang:

5 V -2 V

I led = = 11,1 mA

270 Q

- Dien ap cung cap khac vdi +5V

Neu co dien ap cung cap khac vdi+ 5V, ta co the dung IC TTL ho mach Colecto Vi du, Hinh 5.19a la cong hd mach Colecto dieu khien mot tai dien tro noi vdi nguon cung cap +15V Vi IC hd mach Colecto co nhan ddng circ dai la 16 mA, dien trd tai circ tieu nho hon k£2 mot chut nhir tren Hinh 5.19a.

Neu muon co ddng tai Idn hon 16 mA, ta dung tranzito ngoai, nhu tren Hinh 5.19b Khi IC ho mach Colecto co ngo mu’c L, tranzito T, ngung dan va ddng tai bang Khi IC co ngo mu’c H, tranzito t1 dan bao hoa va ddng tai dat cuc dai

+5V +5V

O O

a ) Ngo TTL dieu khien t i i dien tro b ) Ngo TTL dieu khien LED

Hinh 5.18 Bao hoa curng

Dudi day la mot vi du ve bao hoa cirng Neu RB bang k ^ nhu tren Hinh 5.19b, dong cuc Badd xap xi 15 mA doi vdi ngo TTL mu’c H Dien trd tai 100 Q

(139)

cirng la RB = k£2, RL = 100 Q Khi ngo hd mach Colecto d mu’c L, nhan dong cua IC TTL xap xi bang 15 mA Khi ngo hd mach Colecto d mu’c H, dong 15 mA chay qua circ Bado

+15V

OC: Ha mach Colecto n

+15V

OC^CH

RL

RB RL

a) IC ha mach Colecto ngo dien ap l6n hon 5V b) Dung T ranzito ta n g dong dieu khien

Hinh 5.19

5.7 LOGIC D I/O N G V A LOGIC AM

Cho den nay, ta dung so nhi phan de chi mu'c dien ap thap L va so nhi phan de chi mu’c dien ap cao H Oieu duoc goi la logic duong Ngudi ta thay thuan tien dung logic duong, vi cac dieu xay cam thay hop v6i le thudng Nhung co loai ma khac, goi la logic am, vdi loai logic nay, so nhi phan thay cho mire dien ap H va so rihi phan thay cho mu’c dien ap L Mac dau dieu neu tren co ve khong hop le tu nhien, nhung logic am lai duoc dung nhieu

- Cong dirong va cong am

Mot cong OR he thong logic duong trd cong AND he thong logic am Tai sao? Hay xem xet cong d Hinh 5.20 Ta dang goi cong la cong OR Oieu dung vi ta dang dung logic duong Trong he thong logic duong, so nhj phan thay cho mu’c L va so nhj phan thay cho mu’c H Do do, ta co the chuyen doi Bang 5.6 thanh Bang 5.7 Luu y rang Y = A = B = Dieu the hien

Bang 5.7 dung la Bang su th a t cua cong OR tren Hinh 5.20 De tranh hieu lam, ta goi cong d Hinh 5.20 la cong OR he thong logic duong, duong vi no bieu thi ham OR vdi logic duong (trong mot so tai lieu gidi thieu thong so ky thuat, nguoi ta mo ta cac cc’ng la cong OR duong, cc’ ng AND dUdng v.v )

Cong OR duong

Cong AND am

Hinh 5.20: Y nghia cua cong thuoc vao viec su" dung logic duong hay logic am

(140)

Bang 5.6 Bang 5.7 Bang 5.8

A B Y

1 1

1 0

0

0 0

Trong he thong logic am, so nhi phan thay cho mu’c L va so nhi phan thay cho mu’c H Vdi ma nay, ta co the chuyen doi Bang 5.6 thanh Bang 5.8 Ta hay xem dieu gi se xay Ngo Y bang chi ca hai ngo vao A va B deu bang Dieu the hien cong Hinh 5.20 la cong AND Dieu hoan toan dung vi ta dang xem xet cong vdi logic am Noi cach khac, cac cong du’Oc xac dinh bling cach xem cac cong xCr ly cac so nhi phan va nhir the nao Neu ta dung so nhi phan de thay cho mu’c dien ap L va so nhi phan cho mu’c dien ap H, cong logic d Hinh 5.20 la cong AND

Nhu" da thay, cong logic tren Hinh 5.20 luon luon cho mu’c H ngo neu ca hai ngo vao deu mCrc H Nhirng goi cong la cong gi thuoc vao hoac la loai logic dirong hoac la loai logic am Neu la logic dirong, ta goi cong la cong OR, neu la logic am, ta goi cong la cong AND Nhd phan ti'ch cac ngo vao va ngo v6i nhCrng qui irdc cua cac so nhi phan va 1, ta co cac tirong dirong giufa logic duong va logic am nhu sau:

OR duong * ► AND am

AND duong < — ► OR am

NOR duong <4 - NAND am

NAND duong ^ ^ NOR am

- Cac cong tirong dirong

Hinh 5.21 chi cach ve cac cong co ban Chung ta co the ve lai cac cong logic dung cac tuong duong chi dudi day Doi nho sir van dung tuong duong ta tranh dupe dao hai Ian tren cung mot dudng day Ngoai cac mach gian udc, ngudi thiet ke hay dung cac ngo vao dao Nhu hinh ve, co’ ng OR duong tuong duong vdi cong AND am, cong AND duong tuong duong vdi cong OR am, co’ ng NOR duong tuong duong vdi cong AND dao ngo vao, va cong NAND duong tuong duong vdi cong OR dao ngo vao

0 o - o

a) b)

(141)

Ta rut qui tac tu” Hinh 5.21 nhu” sau:

1) Chuyen doi cong OR cong AND hoac tCr cong AND cong OR 2) Dao tat ca cac tin hieu ngo vao va ngo

5.8 IC C M O S

Cac tranzito truong oxyt kim loai du’Oc dung ho CMOS ChCr "C" co ham y la doi xCrng bu (complementary symmetry) Ban dan oxyt kim loai hoac MOSFET co cac cuc nguon, cong va mang Co loai MOSFET, cong nghe che tao IC CMOS thudng dung MOSFET loai giau

Hinh 5.22a la loai MOSFET giau kenh n Kenh p la vung nen nam giUa vung n Cac dien tCr tu co the chuyen tCr cuc nguon (vung n phi'a dudi) den cuc mang (vung n phi'a tren) Mot I6p mong S i0 la chat dien moi nam ben trai Idp nen Cue cong la dien cuc kim loai dieu khien dong dien tCr tu giua cuc nguon va cuc mang Hinh 5.22 la phan cuc cua MOSFET Khi VGS = 0, Vpp loi cuon cac dien tCrtU tCr cuc nguon den cuc mang nhung Idp nen chi co mot it dien tCr nhiet tao nen Ngoai cac hat thieu so va dong ro ra, dong giua nguon va mang bang Cue cong va nen p nhu phien cua tu dien cach dien bang I6p dien moi S i0 Khi cuc cong duong, no thu hut cac dien tu” tu tCr cuc nguon de tao nen mot I6p mong dien tCr tu giua cuc nguon va cuc mang, tuong duong mot Idp mong ban dan loai n gan Idp dien moi S i0 L6p dien tu” tu dupe goi la Idp ngupc loai n Khi Idp dien tCr tu xuat hien, dong de dang chay tCr cuc nguon den cuc mang Dien ap cuc cong nho nhat tao nen Idp n dupe goi la dien ap nguong VGS ngu3ng co the nho hon 1V den 5V, thuoc loai linh kien dupe dung

Hinh 5.22

Khi VGS = 0, MOSFET loai giau ngung dan vi khong co kenh dan giua nguon va mang Hinh 5.23a la ky hieu cua MOSFET kenh n va Hinh 5.23b la MOSFET

(142)

kenh p Dien ap cong I6n hon dien ap ngudng tao nen I6p ngiroc loai n noi nguon vdi mang MGi ten chi Idp ngUdc nay, I6p hoat dong nhu1 kenh n MOSFET dan

a) MOSFET kenh n b) MOSFET kenh p

Hinh 5.23: Ky hieu MOSFET loai giau

Cung co MOSFET loai giau kenh p Ky hieu cua tranzito MOS bu tirong tir nhir vay, nhirng mui ten chi hudng ngoai nhir Hinh 5.23b Vdi loai MOSFET giau kenh p, tat ca cac dien ap va dong la bu doi vdi dien ap va dong cua MOSFET loai giau kenh n

5.9 IC HO 74CXX

Hang san xuat mang ten To hop ban d in quoc gia di tien phong viec che tao loai IC 74 CXX, la cac mach CMOS cd thu1 tir chan va chCrc nang hoan toan giong vdi IC TTL mang cung so hieu Vi du, IC 74C00 cd cong NAND ngo vao; IC 74C02 cd cong NOR ngo vao v.v

- Cong NAND

Tren Hinh 5.24 la mot cong NAND cau tao bang CMOS Thiet ke mach bu cua cac ngo vao va ngo la dac trirng cua cac IC CMOS Ta nhan thay rang T va T2 tao nen mach bu; T3 va T4 la mach bu khac Cac tranzito hoat dong mhir nhCrng chuyen mach Khi ngo vao A d mu’c L, T., dan va T2 ngung dan, ngo vao A d mu’c H, Tt ngung dan va T2 dan Tuong tu, ngo vao B d mu’c L, T3 ngung d in T4 d in , ngo vao B d mu’c H, T3 d in va T4 ngung d in Hinh 5.24, ngo Y duoc keo len den mu’c dien ap cung cap T, hoac T4 d in Ngo Y duoc keo xuong tiep dat chi T2 va T3 dan Ta khao sat 4 trudng hop sau day:

Trudng hap 1: Khi A = L, B = L, T., va T4 d in , Y = H

Trudng hdp 2: Khi A = L, B = H Vi A van d mu’c L nen T, d in , Y = H

Trudng hap 3: Khi A = H, B = L Vi B = L T4 d in , nen Y = H

Trudng hap 4: Khi A = H, B = H VI ca hai ngd vao A va B deu d mu'c H , T2 va T3 dan nen Y = L

(143)

Hinh 5.24: Cong NAND CMOS

- Thdi gian tre truyen dan

Cong CMOS tieu chuan co thdi gian tre truyen dan khoang 25 ns den 100 ns Thai gian tre truyen dan phu thuoc vao dien ap cung cap va cac yeu to khac Nhir da biet, la thai gian chuyen trang thai ngo sau ngo vao chuyen trang thai Khi hai hoac nhieu cong CMOS ket noi cac tang, thai gian tr§ truyen dan bang tong thai gian tre cua tirng tang Vi du, neu ta noi lien tiep tang cong CMOS, moi cong co = 50 ns, thi tong thdi gian tre truyen dan bang 150 ns

- Cong suat tieu tan

Cong suat tieu tan tinh cua IC la cong suat tieu tan trung binh ngo khong doi Cong suat tieu tan cua mot cong CMOS la vao co vai nanowatt (nW) Vi du, IC 74C00 co cong suat tieu tan xap xi 10 nW/cong Cong suat tieu tan bang ti'ch cua dien ap cung cap va dong ro

Khi ngo CMOS thay doi trang thai L sang H (hoac nguac lai), cong suat tieu tan trung binh tang len Ly la hai MOSFET cung d in Dieu san sinh cac xung dot bien a dong cung cap Hon nira, co tu tap tan a phi'a ngo phai du’Oc nap truoc dien ap ngo co the thay doi trang thai Do tu nap nen no lay dong tir nguon cung cap VI cong suat bang dong tieu thu cua IC nhan voi dien ap cung cap, nen cong suat tieu tan tire thai tang lam cho cong suat tieu tan trung binh tang len theo Cong suat tieu tan trung binh cua IC CMOS co ngo thay doi trang thai lien tuc, duoc goi la cong suat tieu tan hoat dong, cong suat phu thuoc vao tan so thay doi trang thai ngo Khi tan so tang, cac xung dot bien xuat

(144)

hien nhieu, dan den cong suat tieu tan hoat dong tang len Hinh 5.25 bieu thi cong suat tieu tan hoat dong cua IC 74C00 phu thuoc tan so doi vdi tai dien dung 50 pF Ta cung thay cong suat tieu tan/cong tang theo tan so va dien ap cung cap Doi vdi khoang tan so MHz, cong suat tieu tan/cong xap xi hoac I6n hon 10 mW (cong suat tieu tan cua TTL) De IC CMOS co uu diem hon IC TTL, ta sir dung IC CMOS tan so thap hon

Hinh 5.26: Cong suat tieu tan hoat dong cua IC 74 CXX

Mot cach khac, de giam cong suat tieu tan ta giam dien ap cung cap Nhung dieu dan den tac hai vi no lam tang thdi gian truyen d in , giam tinh chong nhieu Mac du IC CMOS co the lam viec vdi giai dien ap cung cap tir +3V den + 15V, nhirng de dung hoa cac yeu cau ve toe truyen d in , ti'nh chong nhieu nen dien ap cung cap can dupe sir dung giai tir +9V den +12V

- IC 54C0XX

Mot vai IC 74CXX lam viec giai nhiet - 40°C den +85°C Vdi giai nhiet nay, cac IC co ti'nh thuong pham lam viec thi'ch hop Loai 54CXX (dung cho quan sir) lam viec giai nhiet tCr -55°C den +125°C Mac dau cac IC 54CXX co the thay the cho cac IC 74CXX, nhung it ngUdi ta lam dieu vi gia cua IC 54CXX dat hon

- IC 74CXX

(145)

- IC CD 4XXX

RCA la hang dau tien gidi thieu IC CMOS L6p IC ban dau mang so hieu CD 4XXX C hlng bao lau sau, loai IC du’Oc thay the bang loai 4XXX A (du’Oc goi theo qui Udc) va loai 4XXX B (loai dem) Cac IC 4XXX A va B duoc dung rong rai, chung cd nhieu chtic nang ma IC loai 74CXX khong co Nhung diem chi'nh cua IC CD 4XXX la sd chan va cac chtic nang hoat dong khong trung hop vdi IC TTL

5.10 CAC DAC TINH CUA CMOS

- Cac ngo vao tha noi

Khi ngd vao TTL tha noi, no tUdng dUdng vdi ngd vao mu’c H Ta co the sir dung ngd vao tha noi cua TTL, tUdng tu nhu ngd vao dat d mu’c H Nhu da chi d phan tren, tot hon het nen noi chan tha noi vdi nguon cung cap Dieu tranh cho IC khoi bi nhieu tap tan xam nhap Neu chung ta de tha noi ngd vao cua CMOS, khong nhung lam tang nhieu, ma lam tang qua mu’c cong suat tieu tan Chan tha noi d cac cong khong dung lam cho dien ap co’ ng gay ddng tang len qua mu’c va chuyen den tang day keo Do do, nguyen tac tuyet doi cua cac IC CMOS la noi tat ca cac chan ngd vao Hau het hoac tat ca cac ngd vao thudng dUdc noi vdi dudng tin hieu Neu co ngd vao nao khong dung ta noi ngd vao vdi dat hoac vdi nguon cung cap Vi du, vdi cong NOR duong, vl neu ta noi chan khong dung ngd vao vdi nguon cung cap, se lam cho ngd a mu’c L, noi chan khong dung cua ngd vao cong NOR vdi dat, cac ngd vao khac mdi co the dieu khien ngd

Vdi co’ ng NAND duong, ta co the noi chan khong dung d ngd vao den dien ap cung cap vi neu noi chan vdi dat co’ ng se "bat ddng", vi luon luon co mu'c H Do do, dieu tot nhat la noi chan khong dung cua ngd vao vdi ngu6n cung cap, ta co the noi true tiep vdi nguon cung cap ma khong gay trd ngai nao, vi cac ngd vao cua CMOS chiu dung duoc dien ap cung cap

- De bj pha hong

Lop m6ng S i0 nam giua cuc cc’ng va nen tao nen trd khang vao rat Idn cua CMOS, gan nhu bang vc cung Lop cach dien cang mong cang lam cho co’ ng de dieu khien ddng mang NhUng vi Idp qua m6ng nen cGng de bi qua ap cong danh thung Ngoai ly tren, CMOS bi hu hong nhieu nguyen nhan khac Vi du nhu ta lap rap hoac thao gd IC CMOS mach co nguon, cac hieu ting vat ly co the xay qua ap cho cong

De bao ve khoi qua ap, ta co the noi mot diot Zener a phi'a ngd vao Nha san xuat da dung diot Zener co dien ap thap hon dien ap danh thung Idp cach dien de bao ve co’ng Hau het cac IC CMOS deu cc dang bac ve bang didt Zener

- Kha nang tirong hop

Cac IC CMOS cd kha nang tUdng hdp vdi vi ngd cua IC CMOS co the dUdc dung cho ngd vao cua IC khac nhu chi Hinh 5.27 Vi du

Hinh 5.27b la tang cua IC dieu khien noi vdi tang vao cua IC tai Dien ap cung

(146)

cap la +10V Mot cach ly tudng, mu’c chuyen mach ngo vao la +5V VI CMOS dieu khien co ngo mu’c L, CMOS tai co ngo vao mu’c H

Tuong tu, Hinh 5.27c chi CMOS dieu khien co ngo d mu’c H, dien ap Idn hon dien ap dieu khien CMOS tai ngo vao tai d mu’c H Dien ap chong nhieu xap xi +4,5V (khoang 45% cua Vcc)

CM05 i

Vo Vi

a) Ngd cua CMOS co the dieu khien ngo vao cua CMOS khac

• 10V ■ 10V

r - J a p

J

J a p

t - I

-( M

-1 uA - •

J ^ _ n

*

^jA > # o v

b) Nhan nguon

#+ 10V

c) Cap nguon

Hinh 5.27 - Cap dong, nhan dong

Khi ngo cua dieu khien CMOS tieu chuan d mu’c L, dong ngo vao den tai CMOS chi bang 1 pA Dong vao nho vi cac cong bi cach dien Dieu co nghTa la CMOS dieu khien co nhan dong chi bang pA Tuong tu, ngo cua dieu khien d mu’c H (Hinh 5.27c), CMOS dieu khien co dong nguon pA

Nhu vay, trudng hop xau nhat (dieu kien nhiet va dieu kien cung cap) cac dong ngo vao cua IC CMOS la:

l||_ Max “ ' l - * A •|H Max “ + p A

Ta sir dung cac so lieu de ti'nh he so tai

- He so tai

He so tai cua CMOS phu thuoc vao loai tai dupe dieu khien IC CMOS dieu khien tai TTL se dupe nghien ciru phan sau day, ta nghien cuU IC CMOS dieu khien IC CMOS khac So lieu ky thuat cua IC 74CXX cho biet cac dong ngo doi vdi CMOS dieu khien CMOS la:

• o L Max “ l - * A • O H Max = - p A

Do do, IC CMOS CO the dieu khien 10 tai CMOS Nhu vay, ta c d the dung 10

tai de ket noi CMOs v d i CMOS He so dang tin cay moi dieu kien hoat

(147)

5.11 GIAO DIEN CUA TTL VA CMOS

Tu1 giao dien day bao ham y chi each thirc ket noi IC dieu khien vdi IC tai muc nay, ta nghien ciru cac phuong phap giao dien IC CMOS vdi IC TTL Can nhac lai la IC TTL can dien ap cung cap la +5V, IC CMOS co the dung dien ap cung cap tir +3V den +15V Vi cac yeu cau ve nguon cung cap khac nen ta can sir dung mot vai so Sau day la mot so so kha bien

- Nguon cung cap +5V

Mot loai giao dien dung chung nguon +5V cho ca dieu khien TTL va tai CMOS Trong trirdng hop nay, cac dien ap cua IC TTL hau nhu deu tirong hop dirpc vdi cac dien ap vao cua IC CMOS (Hinh 5.28b), hau nhu” chu” khong phai hoan toan Dung la khong co van de gi xay IC TTL co cira so trang thai L (OV den +0.4V), vi no lot vao cira so trang thai L cua CMOS (OV den +1,5V) Dieu co nghTa la tai CMOS luon luon thi'ch nghi vdi dieu khien TTL trang thai L

a) M a t c a t ngo cua TTL

5V 5V

TTL mi'sc H

5,5V

CMOS mu'c H

2,4V Khong xac dinh

1,5 V Khong xac dinh

0,4V

OV TTL mu’c L OV CMOS mu'c L

b) M a t c a t ngo vao cua CMOS

Hinh 5.28

Van de sinh TTL trang thai H, vi mu’c Hmln = +2,4V (Hinh 5.28a).

Neu dung ngo TTL trang thai H nhu ngo vao doi vdi IC CMOS, ta se nhan dupe hoat dong khong xac dinh IC CMOS can it nhat la +3,5V cho ngo vao trang thai H (Hinh 5.28b) Vi ta khong the nhan dupe hoat dong tin cay noi true tiep ngo TTL den ngo vao CMOS Ta phai thuc hien mach bo sung de tuong hop hai loai IC khac

Giai phap tieu chuan la dung dien trd keo len giua dieu khien TTL va tai CMOS, nhu tren Hinh 5.29 Dien trd keo len hau nhu khong phat huy anh hudng trang thai thap, nhung no keo trang thai H len xap xi +5V

Vi du, ngo TTL d mu’c L, phi'a dudi dien trd 3,3kO dupe tiep dat Do do, nhan ddng cua dieu khien TTL khoang chirng:

5V

I = = 1,52 mA

3,3k^

(148)

Khi ngo cua TTL mu’c H, dien ap ngo dupe keo ten den +5V

Nhu tren da noi, tranzito totem pole phi'a tren keo len den +2,4V (trudng hop xau nhat) Vi co dien tro keo len, ngo tang len den tren +2,4V, no lam cho tranzito totem pole phi'a tren ngung dan Hoat dong keo len bay gid lai la thu dong vi dien ap cung cap dang keo dien ap ngo len den +5V qua dien tra keo len

+ 5V

Hinh 5.29: Oieu khien TTL va tai CMOS

Dien dung a cong cua tai CMOS duoc nap qua dien tra keo len Dien tra keo len nho nhat duoc xac dinh bang nhan dong cuc dai cua IC TTL: lOL Max = 16mA Trong trudng hap xau nhat, dien ap cung cap co the len den +5,25V, nen dien tra keo len nho nhat bang:

5,25V

R m in = = 328 Q

16 mA

Gia tri tieu chuan gan nhat la 330 Q nhieu Crng dung, dien tra keo len bang 3,3 kQ cho mach hoat dong tot Ta co the dung cac cong giao dien v6i mot so ngo vao Neu co nhieu ngo TTL dieu khien cac ngo vao CMOS, ta noi moi TTL dieu khien den mot dien tro keo len

- Cac dien ap cung cap khac nhau

Dien ap cung cap dung cho IC CMOS thi'ch hop nhat la tCr +9V den +12V Mot cach dung de dien ap cung cap Idn la sCr dung IC TTL ho mach Colecto nhu chi tren Hinh 5.30, vi tang cua IC TTL ho mach Colecto chi gom tranzito nhan dong vdi Colecto tha noi Hinh 5.30, Colecto mach duoc noi vdi nguon cung cap +12V qua dien tro keo len 6,8kQ Cung nhu vay, IC CMOS duoc cung cap nguon +12V Khi IC TTL co ngo mCrc L, ta thay dau phi'a dudi cCia dien tro 6,8k£2 duoc tiep dat Do do, IC TTL co nhan dong bang:

12V

'nhan dong — — , f T l A 6,8kQ

(149)

dieu khien tai TTL Vi du, vdi dien dung ngo vao cuc cong la 10pF, hang so thdi gian la:

Rc = (6,8kQ) (10pF) = 68 ns

+ 12V

Hinh 5.30: Dieu khien TTL ho mach Colecto co the dung dien ap cung cap cua CMOS Neu hang so thdi gian qua Idn, ta co the giam tri so cua dien trd keo len den gia tri c u t tieu cho phep la:

12V

Rn = 750Q

16mA

Luc hang so thdi gian giam xuong con: Rc = (750Q)(10pF) = 7,5ns

- Dung tranzito ngoai

Hinh 5.31 la mach dung tranzito ngoai de thuc hien giao dien giCra dieu khien TTL va tai CMOS d day TTL tieu chuan dung nguon cung cap +5V Dieu khien TTL noi vdi TTL ngoai cd dien trd keo len la 470Q ITu diem cua cach la nhan ddng khong bi han che d 16mA Vi du, 2N3904 d in bao hoa, dau dudi cua dien trd 470Q gan nhu tiep dat Do nhan dong bang:

12V

- = 25,5 ns ■nhan dong

479£2

12V

(150)

Bo phan ap giCra ngo TTL va cuc Bado cua ranzito lam tang mu’c chong nhieu len xap xi +1,4V vi no can lay +0.7V de lam tranzito chuyen trang thai Tu 68 pF la tu tang toe, no thudng duoc dung de tang toe nap cho dien dung cuc cong

Ly ta can nhan dong Idn chinh la de dieu khien nhieu tai CMOS cung mot luc Vi du, Colecto cua 2N3904 dieu khien cong CMOS Neu moi cong CMOS co dien dung 10 pF thi dien dung ngo vao tong cong la 80 pF Neu dien tro keo len la 470£2 thi hang so thdi gian la:

Rc = (470 Q) (80 pF) = 37,6ns

Hang so thdi gian tudng doi nho la ket qua cua dien trd keo len lay gia tri

470Q.

- Bo chuyen mure nguon dung CMOS

Hinh 5.32 la bo chuyen mu’c CMOS 40109 Tang ngo vao cua IC dung dien ap cung cap +5V tang ngo dung +12V Noi cach khac, tang ngd vao giao dien vdi IC TTL va tang ngo giao dien vdi CMOS

Trong Hinh 5.32, IC TTL tieu chuan dieu khien bo chuyen mu’c nguon, no keo IC TTL len it nhat la +2,4V Dien trd keo len tiep tuc dua dien ap len cao den mu’c +5V, mu’c dam bao chac chan ngo vao d mu’c H Phi'a ngd cua bo chuyen mire nguon noi vdi 12V, no cd thdi gian t r i truyen dan va kha nang chong nhieu tot hdn

Hinh 5.32: Bo chuyen mu’c CMOS cho phep sir dung hai loai nguon +5V va +12V Tom lai, IC TTL hoat dong vdi nguon +5V, IC CMOS lam viec vdi nguon +12V Do la ly dung bo chuyen mu’c nguon lam giao dien giua dieu khien TTL va tai CMOS

5.12 GIAO DIEN CUA CMOS VA TTL

(151)

Hinh 5.33 la mach cung cap +5V cho dieu khien va tai Theo so lieu ky thu^t cua IC 74CXX cho biet, trirdng hop xau nhat, dong ngo cua CMOS dieu khien TTL la:

Ir

- Dien ap cung cap +5V

'O L Max = 360 fiA •o h Max ~ " f i A

Oieu co nghTa la dieu khien CMOS co the cho nhan dong la 360 fiA trang thai L, la dong vao doi vdi IC TTL loai Schottky-cong suat thap Mat khac, dieu khien CMOS co the cho ddng nguon 360 |xA, no Idn hon mu’c can thiet de dieu khien ddng vao trang thai H Nhir vay, nhan ddng chi cho he so tai CMOS/74LS la

IC CMOS cung cd the dieu khien IC TTL loai cong suat thap Yeu to gidi han he so' tai cung la nhan ddng Trong trirdng hop xau nhat, IC TTL cong suat thap cd ddng ngd vao bang 180 |xA Vi dieu khien CMOS cd the cho nhan ddng la 360 ^A, no cd the dieu khien IC TTL cong suat thap Tom lai, he so tai cua CMOS/74L la 2.

IC CMOS khong the dieu khien true tiep IC TTL tieu chuan, vi ddng ngd vao trang thai L yeu cau la -1,6 mA Van de la cho, tranzito nhan ddng cua IC CMOS cd dien trd xap xi 1,11kQ (trirdng hop xau nhat) Dien ap ngd cua IC CMOS bang tich cua 1,6 mA va 1,11kQ bang 1,78V Oien ap qua Idn doi vdi ngd vao trang thai L cua IC TTL

Hinh 5.33: Oieu khien dung CMOS va tai TTL dung IC Schottky-cong suat thap

- Dung tang dem bang CMOS

Hinh 5.34 la mach dieu khien IC CMOS vdi he so tai qua tang dem Tang dem cho ddng d ngd Idn Vi du, IC 74C902 cd tang dem CMOS, moi tang dem cd ddng ngd trirdng hop xau nhat la:

Ioi Max - 3,6 mA

•o h M ax

-Vi tai TTL tieu chuan cd ddng d ngd vao trang thai L bang 1,6 mA va ddng ngd vao d trang thai H bang 48 |iA, 74C902 cd the dieu khien hai tai TTL tieu chuan Neu dung mot phan sau so tang dem cua IC CMOS nhir tren Hinh 5.34, thi he so tai CMOS/TTL la Cac IC khac duoc dung lam tang dem tuong tu nhu

Hinh 5.34 la IC CD4049A: dao; CD405CA: khong dao; 74C901: dao

(152)

i-J Tang dem CMOS Dieu khien CMOS

■ 5V

T ii TTL

Hinh 5.34: Tang dem CMOS co the dieu khien tai TTL tieu chuan

- Cac dien ap cung cap khac nhau

Cac tang dem CMOS nhir 74C902 co the dung dien ap cung cap tir +3V den +15V va dien ap ngo vao tCr -0,3V den +15V Dien ap ngo vao co the I6n hon dien ap cung cap ma khong lam hong loai IC dung lam tang dem Vi du, ta co the dung dien ap ngo vao trang thai H la +12V dien ap cung cap chi bang +5V

Hinh 5.35 la mach dieu khien CMOS dung dien ap cung cap +12V, tang dem CMOS co dien ap cung cap la +5V Do do, ngo vao cua tang dem CMOS bang +12V tang dem co dien ap cung cap +5V

12V 5V

Tang dem CMOS

Dieu khien CMOS TTL

Hinh 5.35: Dieu khien CMOS hoat dong thich hop nhat v6i nguon cung cap 12V

- Giao dien cua hd mach mang

Ta da biet IC TTL ho mach Colecto, tang ngo co tranzito nhan dong vdi Colecto tha noi Tirong tir nhir vay doi vdi IC CMOS Doi vdi IC ho mach mang, tang ngo chi co mot MOSFET nhan dong Vi du, IC 74C906 co tang dem hd mach mang

(153)

- Tang he so tai (Fanout)

Mot tang dem hd mach mang nhir Hinh 5.36 co he so tai gidi han la 2, vi nhan dong c u t dai xap xi 3,6 mA Co mot cach tang he so tai bang cach dung tranzito nhan dong nhu" trinh bay tren Hinh 5.37 Khi ngo cua CMOS d mu’c L, tranzito 2N3904 ngifng d in , cuc Colecto duoc keo len +5V Tuy nhien, ngo cua CMOS d mu’c H, tranzito 2N3904 dan bao hoa, co nhan dong chay qua Mach tren Hinh 5.37 dupe thiet ke co he so tai xap xi 10 tai TTL Nhu da thay, 10 tai TTL noi vdi Colecto, cac dong la:

•0 L Max = 16 mA •o h Max = 400 flA

Khi tranzito 2N3904 ngung d in , dien ap Colecto duoc keo len den +5V, trir di sut ap tren dien trd keo len Vi cap dong 400 ^A chay qua dien trd 3,3k£2, nen dien ap ngo vao TTL la:

V, = 5V - (400 |iA) (3,3 kQ) = 3,68V Trong trudng hop xau nhat, dien ap cung cap chi cd +4,7V, luc do:

V, = 4,7V - (400 |oA) (3,3 kQ) = 3,43V Va mu’c chong nhieu = 3,43V - 2V = 1,43V

Hinh 5.37: Mot cach khac de tang dong nhan

(154)

Tiep theo, ta xem xet dieu khien d trang thai L Khi tranzito 2N3904 dan bao hoa, nhan dong cho 10 tai TTL la 16 mA va nhan dong cho dien tra keo len la 1,5 mA Nhu vay, nhan dong tong cong la 17,5 mA, dong chay qua Colecto cua tranzito 2N3904 De co bao hoa cifng, dong cuc Bada phai bang 1/10 dong Colecto, do, dong Bado phai xap xi 1,75 mA Khi sut ap giua cuc Bado va Emito la VBE = 0,7V doi v6i tranzito 2N3904 va dien tro dan cua tranzito nguon CMOS la 1,11 kQ, tu" ta tinh dupe dong cUc Bado la:

1 V -0 ,7 V

lB = - = 1,94 mA 4,7 kQ. +1,1 k£2

Gia trj hoi I6n hon 1,75 mA, gia tri dong lB can thiet de co bao hoa cirng Do do, trang thai L, mach co du kha nang dieu khien 10 tai TTL

(155)

CAU HOI VA BAI TAP

5.1 Trang thai trd khang cao la gi? Vi trd khang cao lai co vai tro quan trong mach IC?

5.2 Dac trung cua IC hd mach Colecto, trudng hop nao su1 dung IC hd mach Colecto?

5.3* Gia du rang can IC TTL co cong suat tieu tan it hon mW cho moi cong va thdi gian t r i nhd hdn 20 ns Loai IC TTL dUdc lua chon?

5.4 Sir dung Bang 5.3 de tinh tong thdi gian t r i cua cac cong ghep tang cho moi mot cac loai dudi day:

a) Cong suat thap (Low-power) b) Low-power Schottky

c) Tieu chuan d) Toe cao e) Schottky

5.5* He so tai cua IC 7400 la bao nhieu IC dieu khien cac tai TTL cong suat thap (Low-power)

5.6 He so' tai cua IC Schottky cong suat thap (Low-power Schottky) la bao nhieu IC dieu khien cac tai TTL tieu chuan?

5.7* He so tai cua IC TTL tieu chuan la bao nhieu IC dieu khien cac tai 74LS?

5.8 Ngo Y tren Hinh 5.38 d mu’c logic nao (mu’c L hoac mu’c H) doi vdi cac dieu kien sau day:

a) Ca hai chuyen mach deu hd mach, A d mu’c L b) Ca hai chuyen mach deu ddng mach, A d mu’c H

c) Chuyen mach ben trai hd mach, chuyen mach ben phai ddng mach, A d mu’c L

d) Chuyen mach ben trai ddng mach, chuyen mach ben phai hd mach, A d mu’c H

+5V

Hinh 5.38

(156)

5.9* Tren Hinh 5.9a, l0L.max = 16 mA Neu cong ho mach Colecto giong nhir cac day du’Oc ket noi theo luat OR nhu tren Hinh 5.9c, hoi gia tri cuc tieu cua dien trd keo len la bao nhieu de tranh khong bi pha hong IC?

5.10 Gia du rang tong dien dung ngo bang 20 pF doi vdi trudng hop mach ve tren Hinh 5.9c Neu dien trd keo len la 3,6 k£2, hoi hang so thdi gian nap dien la bao nhieu?

5.11* Neu muon cd noi dung cua bo ghi chuyen B xuat hien tren BUS nhu mach ve tren Hinh 5.13 Hoi cac gia tri Disable can phai nhu the nao?

5.12 Cd mach nhu Hinh 5.39, gia tri ngo Y bang bao nhieu, cac chuyen mach hd mach? Khi cac chuyen mach kin mach?

5.13* Cung vdi Hinh 5.39, ddng mang chay qua cac dien trd keo len bang bao nhieu ca hai chuyen mach deu kin mach? Hang so' thdi gian doi vdi moi ngo vao bang bao nhieu cac chuyen mach hd mach?

3 ,3k

+5V

A

3 3k

-Y

Hinh 5.39

5.14* Mach cho tren Hinh 5.40a, dien ap ngo TTL la 0,4V va dien ap cua LED la V Hoi ddng nhan la bao nhieu LED sang?

+5V +12V

7/" LEDl LEDl

180 2, 2k

A - A

-3 -'1— » * OC p - * -y

a) b)

Hinh 5.40

(157)

C H U O N G 6

FLIP-FLOP,

XUNG NHIP VA DINH THOI■ ■

Sau hoc xong chuong hoc vien co the:

Hieu duoc cau tao, ky hieu, hoat dong va tinh nang cua cac loai flip flop.

Xay dung dUdc cac flip flop bang cac cong logic cd ban.

Lfng dung dUdc cac tinh nang cua cac flip flop trong cac mach dien tCr digital cu the.

Tinh toan dUdc chu ky T, tan so f cua xung nhip khi ISp cac mach dung IC TTL/CMOS va thach anh, hoac dung IC 555.

Ap dung tinh nang cua tri-gd SCHMITT vao cac mach cu the.

TONG QUAN

Mot cong-tic co trang thai on djnh, cong-tic kin mach hoac ho mach thuoc vao vi tri cua dong (Hinh 6.1a) Cong-tac cung du’Oc xem nhu1 la mot bo nh6 vi no giur trang thai xac lap cho den thay doi vi tri dong

Cac mach dien tir co trang thai on dinh du’Oc goi la mach song on Flip flop la mach dien tu1 song on co hai trang thai on dinh, ngo cua no hoac la OV hoac la +5V, nhu chi tren Hinh 6.1b Flip flop cung la mot bo nhd vi ngo duoc tri trang thai xac lap cho den mot tac dong nao lam no thay doi trang thai Thuc te, mot mach song on co the duoc dung de luu tru mot so nhi phan (bit) Vi du, flip flop co ngo xac lap OV, no dupe coi nhu la lUu tru bit va ngo xac lap mu’c +5V, no luu tru bit

(158)

Vcc

Thanh dona

X

T rang th a i "O" (H a m ach)

Trang th a i T (Km m ach) a) C o n g -ta c tra n g th a i

Trang th a i "O"

Ngo

OV DC

_ I

b) Flip flo p tr a n g th a i Vcc

FLIP FLOP

Trang t h a i "1"

Ngo V D C

Hinh 6.1: Cong-tac va flip flop hai trang thai 6.1 FLIP FLOP RS

Mot nhung cach don gian nhat de xay dung mach flip flop la mac noi tiep hai cong nhir tren Hinh 6.2a Day noi ngo cua cong Invecto B (Inv B) den ngo vao cua cong Invecto A (Inv A) du’Oc goi la day hoi tiep

Tren Hinh 6.2b, bo day hoi tiep, coi nhu Vi la dien ap vao va V3 la dien ap Chi co hai loai tin hieu co the co he thong digital va tri/dng hop nay, ta dinh nghTa mu’c = OV va mu’c = +5V Neu V : du’Oc xac lap OV, thi luc V3 se d mu’c OV Neu bay gid ta noi lai day hoi tiep nhir tren Hinh 6.2b, V1 khong tiep dat nhirng V3 van tri mu’c OV Oieu dung vi mot ngo vao Inv A dupe tiep dat, ngo Inv B se o mu’c OV, sau co the tri ngo vao cua Inv A dao mu’c bang cach sir dung day hoi tiep Day la mot trang thai on dinh: V3 = OV

Ngiroc lai, neu V1 bang +5V, V3 cung se bang +5V nhir chi tren Hinh 6.2c.

Day hoi tiep neu du’Oc sir dung thi luc V, bang +5V vi V3 bang +5V Day la trang thai on dinh thCr hai: V3 = +5V

P ay hoi tie p

VI ^>0 • VZ • ^>o

Inv A Inv 3

a ) Mach song on

V1 = OV

Inv A Inv 3

b)

Hinh 6.2: Mach song on

= OV V1 = + y l \ „ _V2 = OV K ' / ^ r + 5 V

Inv A Inv 3

c)

(159)

a) b)

Hinh 6.3: Flip flop dung cong NOR

Mach du’Oc ve lai dirdi dang quen thuoc nhir Hinh 6.3b Flip flop co hai ngd ra, duoc dinh nghia theo thuat ngu chung la Q va Q ma Q la phan bu cua Q. Co hai ngo vao flip flop la R va S Bang 6.1 la bang sir that cua flip flop cong NOR

Trudng hdp thUnhat, dieu kien ngo vao la: R = va S = Ta da biet la cong NOR mot ngo vao d mu’c thi khong gay tac dong den ngo flip flop, Q khong doi trang thai

Trudng hop thU hai, dieu kien ngo vao la R = va S = 1, dan den ngo cong NOR B mu’c Ca hai ngo vao cong NOR A o mu’c 0, dan den ngo mu’c Nhu vay, mu’c ngo vao S lam cho flip flop trang thai xac lap (Set), no chuyen sang trang thai on dinh Q =

BANG 6.1: Bang sir that flip flop RS

R s H O A T D O N G

0 Gia trj trirdc Khong thay doi

0 1 Xac lap (Set)

1 0 Phuc hoi (Reset)

1 ? Cam

Trudng hdp thU ba, dieu kien ngo vao la R = va S = Dieu kien d in den ngo cua cong NOR B mu’c Nhu vay, mu’c ngo vao R lam cho flip flop trang thai phuc hoi (Reset), no chuyen sang trang thai on d in h ,U = (hoac = 1)

Trudng hdp cuoi cung Bang 6.1 la R = va S = Day la dieu kien bi cam, no dan den cac ngo cua ca hai cong NOR d trang thai Noi cach khac, ca hai ngo Q = va Q = cung mot luc Ket qua mau thuan vdi dinh nghTa cd ban cua flip flop la Q phai la phan bu cua Q, vi vay, dieu kien R = va S = khong the chap nhan dUdc N g lu nhien, neu dieu kien bi cam xay vi ly nao do, thi dan den ket qua la trang thai cua Q khong the doan trudc du'dc

(160)

Q

~R Q

b) Ky hieu logic

Hinh 6.4a: Flip flop R S

/ 1

1 o

O 1

o o

Q

Trang th a i trUOC

1

O ? (C a M )

c) Dang su that

Vcc 51 51 52

a ) Chan IC

51 52

0 0 X 1 0 X 1 0

? C3m

1

1

0

Trang thai trucrc

x: khSnq quan tiim

b) Bang e J t h a t

Hinh 6.4b: Bon chot Set-Reset

6.2 FLIP FLOP RS D O N G BO TINH

Co hai cach cau tao nen flip flop RS nhir Tiet 6.1 vi/a trinh bay Hai loai mach cung co_chung bang sir that va cung chung ky hieu Sir thay doi thong tin d ngo vao R va S diroc truyen den ngo Q va Q tirong Crng vdi bang sir that

(161)

s Qn+1

5

-> ~ > Qt Q 0 0 Qn

E N A B LE

► — CLK

0 1

_ 0 0

K - 3 — > K Q

R Q

1 a t hop phap

a) 5 a do logic b ) l\y h ie u va Dang s jth a t

Hinh 6.5: Flip flop RS dong bo tinh

Nhir vay la co mot thdi diem de cho flip flop lull tru thong tin roi thong tin dupe tri mot khoang thdi gian, flip flop dupe goi la flip flop RS dong bo tinh, ky hieu va bang suth at cua flip flop dupe bieu thi tren Hinh 6.5b Chu y rang flip flop RS dong bo ti'nh cd ngd vao: R, S va xung nhip, ky hieu la CLK (hoac CK) Bang sU that cung khong chi ghi don thuan Q ma la Qn+1, vi ta phai quan sat thdi gian ngay trUdc khi xung nhip CLK chuyen xuong mu’c (nhip n) va

ngay sau khi xung nhip chuyen xuong mu’c (nhip n+1)

6.3 FLIP FLOP D

Flip flop RS cd hai ngd vao so lieu Be luu tru bit 1, ta can cd S = 1; de luu tru bit 0, ta can cd R = Trong nhieu ting dung, rat bat tien can hai tin hieu dieu khien flip flop Them vao do, dieu kien cam R = S = so suat cung cd the xay Oieu tren day dan den viec ddi flip flop D, loai mach flip flop chi can mot ngd vao so lieu

Hinh 6.6 la mach flip flop D Loai mach chi cho gia tri cua D den ngd Q xung nhip xuat hien Hoat dong cua mach nhu sau: xung nhip d mtic 0, ca hai co’ ng AND deu khong hoat dong, do, du D cd thay doi gia tri cung khong anh hudng den gia tri cua Q; xung nhip d mtic 1, ca hai cong AND deu cd the hoat dong Trong trudng hop nay, Q cd gia tri cua D Khi xung nhip xuong mtic 0, Q tri va lull trti gia tri den ngd vao so lieu D trUdc Cd nhieu cach thiet ke mach flip flop D Noi chung, flip flop D la mach song on, d ngd vao D sd lieu dupe truyen den ngd sau flip flop nhan dupe xung nhip

CLK D Qn+1

0 X Qn (Trang thai trUoc)

1

0

0

a) Mach Flip Flip V b) K.y hieu Flip Flop D c) Pang eu th a t

Hinh 6.6: Flip flop D

(162)

6 phan nay, ta noi den mach flip flop D ma ngo Q nhan gia tri D xung nhip len mu’c 1, noi cach khac, la so lieu D thay doi xung nhip mu’c Gia tri cuoi cung cua D trUdc xung nhip tro ve mu’c la gia tri D dupe luu tru Loai flip flop D thudng du’Oc goi la chot D

Hinh 6.6a la mach logic, Hinh 6.6b la ky hieu logic va Hinh 6.6c la bang su that cua flip flop D Trong bang su that, hang thCr nhat, xung nhip CK d mu’c va gia tri D khong xac dinh, Q dupe chot lai d trang thai trUdc hang thir hai, xung nhip CK d mu’c v a D d mu’c 0, Q lay gia tri cua D va bang hang thir ba, xung nhip CK d mu’c va D d mu’c 1, Q cung d mu’c TCr do, ta cd nhan xet la xung nhip CK d mu’c 1, so lieu dupe dua tCr ngd vao D den ngd Q

Hinh 6.7: Liru trUtCrbon bit

Hinh 6.7 la flip flop D dupe dieu khien bdi cung xung nhip CK Khi xung nhip len mu’c 1, so lieu ngd vao dupe nap vao flip flop va xuat hien d ngd Khi xung nhip xuong mu’c 0, ngd van tri so lieu Vi du, so lieu ngd vao la:

D3 D2 D1 D0 = 0111

Khi xung nhip len mire 1, tu” dupe nap vao chot D, cho ket qua ngd la: Q3 Q2 Qt Q0 = 0111

Sau xung nhip trd ve mu’c 0, ngd so lieu dupe IlTu tru, lau chC/ng nao

(163)

Vcc

| |

5 D3 D2 Dl DO

Vcc CLK2

IC 7475

12 _ CLK1

GND Q3 Q3 Q2 Q2 Q1 Q1 QO Q 13

■ = ■ & 10 lb 14 16

a) 5 a chan IC 7475

CLK D

Hinh 6.8: So chot song on bit

6.4 FLIP FLOP D TAC DONG BANG S l/O N XUNG NHjP

Mac du chot D dupe dung de luu tru” tarn thdi cac thiet bi dien tCr, cung loai flip flop D khac, kha bien, dupe dung cac he thong va cac may vi ti'nh digital Do la loai flip flop lay m lu bit so lieu tai mot thdi diem nhat dinh

Hinh 6.9 la mach RC d ngd vao cua chot D Do thiet ke cd ti'nh toan, nen hang so thdi gian RC nho hon nhieu so vdi rong xung Vi dieu do, tu dien cd the dupe nap day xung nhip len mu’c 1, nap theo qui luat ham mu, tao nen mot dien ap dinh duong va hep, chuyen qua dien trd Sudn sau cua xung tao nen dinh xung am va hep Mach dupe goi la mach vi phan

Dinh xung duong va hep (xung mao dau) tac dong tire thdi den cong AND; dinh xung am va hep khong gay tac dong nao Ket qua tac dong cua dinh xung duong den co’ ng AND giong nhu la lay mau gia tri D tufc thdi, tai thdi diem nay, D va phan bu cua no tac dong den cac ngd vao flip flop, dan den Q xac lap hoac phuc hoi (trir Q da bang D)

CLK *j^|

CLK D Qn-i-1

0 X Qn

t 0

(trang th a i trdO c) 0

t 1

X Qn

Trar\e\ th a i Xr\J(Jc)

a) S o do mach b) f'ana, $u th a t

Hinh 6.9: Mach vi phan d ngd vao xung nhip

(164)

Loai hoat dong du’Oc goi la tac dong bang sudn xung, vi flip flop chi dap ting xung chuyen trang thai SU tac dong nhu Hinh 6.9 xay sudn di/Ong cua xung nhip Vi vay, ta goi la xung nhip tac dong bang siren duong

Bang su that duoc trinh bay tren Bang 6.2, tom tat hoat dong cua flip flop D, dupe tac dong bang sudn duong cua xung nhip CK Khi xung nhip mtic va D khong xac dinh, Q dupe chot lai trang thai lien trirdc Sudn trirdc cua xung nhip dupe ky hieu bang mui ten hudng di len ( f ), bit so lieu du’Oc nap vao flip flop va Q lay gia tri cua D sirdn sau cua xung nhip dirpc ky hieu mui ten hudng di xuong (|), va D khong xac dinh, Q tri trang thai lien trirdc Thoat dau, ddng mach, cac lip flop cd trang thai ngau nhien De cac may vi ti'nh bat dau lam viec, nhan vien van hanh phai nhan phi'm Reset Tin hieu Clear hoac Reset dupe dira den tat ca cac flip flop Trong mot so he thong digital, viec lam cho tat ca cac flip flop xac lap trirdc la can thiet

Hinh 6.10 la mach flip flop D cd ca hai chtic nang: xoa va xac lap trirdc Cong OR cd them ngd vao, Preset (xac lap trirdc) va Clear (xoa) de thirc hien hai chtic nang Khi Preset d mtic 1, d in den Q = 1, neu Clear mtic 1, phuc hoi Q ve mtic

Preset va Clear dupe goi la cac ngd vao khong dong bo vi Preset va Clear tac dong den flip flop doc lap vdi xung nhip Mat khac, ngd vao D la ngd vao dong bo, vi so lieu vao ngd vao D chi di den ngd Q sudn xung nhip xuat hien nhir trinh bay tren Hinh 6.10.

PRESET

Hinh 6.10: Cac chtic nang Preset va Clear cua flip flop D

Hinh 6.11a la ky hieu cua flip flop dupe tac dong bang sirdn duong cua xung nhip Ngd vao xung nhip cd hinh tam giac nho la dau hieu nhac ta nhd la sirdn duong tac dong den mach, thay ky hieu nay, ta can nhd den y nghTa cua no Ngd vao D dupe lay mau va liru trir theo sudn duong cua xung nhip

Doi ting dung, ngirdi ta cho sudn am xung nhip tac dong vao flip flop Trong trudng hop nay; mot mach dao IC lay phan bu cua xung nhip trUdc tiep xuc vdi cac cong AND Dieu cd nghTa la sirdn am xung nhip tac dong den cac co'ng, cho phep cac so lieu dirpc lull tru Hinh 6.11b la ky hieu cua flip flop D dupe tac dong bang sirdn am xung nhip Ky hieu dao va tam giac nhac ta nhd la sudn am xung nhip tac dong len flip flop Cac Hinh 6.11a va Hinh 11b

(165)

nghia la CLR tac dong mu’c se phuc hoi flip flop IC 54/74175 co flip flop D IC co 16 chan, dang DIP (Dual in line package: IC co dang khoi hop vdi hai hang chan a hai canh cua khoi hop) va dUdc goi la bo flip flop D co chan xoa

Hinh 6.11: Flip flop D

6.5 THOI GIAN CHUYEN TRANG THAI CUA FLIP FLOP

Diot va tranzito khong the chuyen trang thai lap tire, ma luon luon can thdi gian de chuyen tu' dan sang ngung dan hoac ngUdc lai Doi voi cac diot va tranzito ludng cue, thdi gian chuyen mach la nano giay (ns) Thdi gian chuyen mach la nguyen nhan chinh gay tre truyen dan, ky hieu la Do chinh la tho'i gian de ngd cua cong logic hoac flip flop thay doi trang thai sau ngd vao thay doi trang thai Vi du neu thong so ky thuat cua flip flop D cho biet = 10 ns, la thdi gian khoang 10 ns de Q thay doi trang thai sau D duoc lay mau bang sudn xung Trong nhieu ting dung, tre truyen dan qua nho den noi cd the bo qua dude

Tu tap tan d ngd vao D cung vdi cac yeu to khac doi hoi bit so lieu D phai cd mat ngd vao trUdc sudn xung nhjp tdi Thdi gian xac lap tXL la thdi gian nho nhat ma bit so lieu phai cd mat trUdc sudn xung nhip tac dong

Vi du, neu flip flop D cd thdi gian xac lap la 15 ns bit so lieu dUdc luu trti phai cd mat cong vao D it nhat la 15 ns trUdc xung nhip tdi, neu khong thi nha san xuat khong the dam bao chinh xac cong viec lay mau va luu trti

Hdn ntia bit so lieu D phai cd thdi gian tri du Idn de cho cac tranzito mach kip chuyen trang thai Thdi gian tri t~T la thdi gian cuc tieu ma bit so lieu D phai cd mat sau xung nhip tdi Vi du neu tx = 15 ns, tDT - ns bit so lieu phai cd mat ngd vao D it nhat 15 ns trUdc xung nhip tdi va dude tri it nhat la ns sau sudn xung nhip tdi

Hinh 6.12: Cac yeu cau ve tin hieu D, xung nhip CLK thdi gian xac lap t thdi gian tri t?Tva thdi gian tre t, thuc hien chuyen trang thai

(166)

Hinh 6.12:

Vi du: Cac dang xung dien hinh cho viec xac lap bit flip flop tac dong vdi sudn duong xung nhip dupe bieu thi tren Hinh 6.12 Hay neu y nghTa cua cac thdi gian xac lap, thdi gian tri va thdi gian truyen dan cua xung hinh ve

Ldi giai: Tren true thdi gian cd danh dau nhung thdi diem can thiet TCr dau den t, so lieu cd the la hoac 0, hoac cd the dang thay doi trang thai Dieu duoc bieu thi bang cac dudng ke cho ca mu’c H va mu’c L D

TCr t, den t2: So lieu D phai dupe tri (trong trudng hop la mu’c 1) Day la thdi gian xac lap tXL So lieu dupe dua vao flip flop d thdi diem t2, nhung no khong xuat hien Q ma mai tan t3 no mdi xuat hien

Thdi gian tCr t2 den t3 la thdi gian truyen dan De dam bao hoat dong chinh xac so lieu phai dupe tri tu thdi diem t2 den tan thdi diem t4, day la thdi gian tri tDT Sau t4, D tu thay doi trang thai, no dupe bieu thi bang dudng ke d mu’c va mu’c

6.6 FLIP FLOP JK

Cac mach flip flop cd the dupe dung de xay dung bo dem, thuc chat la mach dung de dem so lupng cac sudn duong hoac am cua xung nhip di den ngd vao cua xung nhip Flip flop JK la linh kien ly tudng tao nen bo dem

Hinh 6.13 la mot cach de cau tao nen flip flop JK Cac bien J va K dupe goi la cac ngd vao dieu khien, vi chung xac dinh flip flop chuyen trang thai nao sirdn duong xung nhip tdi Nhu tren da trinh bay, mach RC cd hang so thdi gian nho, nhu vay, no chuyen doi xung nhip cd cau dang chCr nhat xung mao dau cd rong xung hep Vi cd co’ ng AND nen mach dupe tac dong bang sudn duong xung nhip

(167)

- Khi J = va K = 1, cong AND tren khong hoat dong, nen khong co cach nao de xac lap flip flop Flip flop luc chi co kha nang phuc hoi (Reset) Khi Q = thi trudng hop cong dudi se Reset flip flop sudn duong cua xung nhip tdi Dieu dan den Q chuyen trang thai ve mu’c Day la trang thai thir hai bang sU that Do do, J = va K = 1, cd nghTa la sudn duong xung nhip tdi se Reset (phuc hoi) flip flop (tru” trudng hop flip flop da duoc Reset, luc flip flop tri mu’c 0)

- Khi J = va K = 0, cong AND dudi khong hoat dong nen khong cd kha nang Reset flip flop Luc do, flip flop dupe xac lap (Set) nhu sau: Q = 0, Q = 1, do, cong AND tren se Set flip flop sudn duong xung nhip tdi, no chuyen Q sang trang thai (trang thai thir ba bang su” that) Nhu vay, J = va K = 0, cd nghTa la sudn duong xung nhip tdi se Set flip flop (tru" trudng hop Q da d trang thai thi flip flop tri trang thai do)

Hinh 6.13: Flip flop JK

- Khi ca hai J va K deu d mu’c (chu y, day la trudng hop cam cua flip flop RS) Luc nay, flip flop vira cd kha nang Set vira cd kha nang Reset, thuoc vao Q d mu’c nao trudc luc sudn duong xung nhip tdi Neu Q = 1, cong AND dudi Reset flip flop sudn duong xung nhip tdi Neu Q = 0, cong AND tren Set flip flop, sudn dUOng xung nhip tdi Mot hai trudng hop tren, Q chuyen sang trang thai bu doi vdi gia tri trudc (trang thai thu” tu bang su that) Do do, J = va K = cd nghTa la flip flop se chuyen trang thai bu xuat hien sudn duong xung nhip d ngd vao CLK "Toggle" cd nghTa la chuyen trang thai doi lap

Tre truyen dan tranh cho flip flop JK khoi chuyen trang thai doi lap nhieu Ian cd sudn duong xung nhip d ngd vao CLK tac dong Trong Hinh 6.13 cac ngd chuyen trang thai sau sudn duong xung nhip tac dong Cac gia tri mdi xuat hien sudn duong xung nhip tac dong Vi luc cac gia tri mdi cua Q va Q xuat hien qua cham de cung vdi xung mao dau duong dieu khien cac cong AND

Vi du: Neu = 20 ns, cac ngd chuyen trang thai xap xi 20 ns sau xung mao dau cua xung nhip xuat hien Neu cac xung mao dau cd rong xung hep hon 20 ns, thi Q va Q tdi qua tre de khong gay hien tuong chuyen trang thai khong dung

Hinh 6.14a la ky hieu cua flip flop JK Neu ket hop ca cac cong OR ta cd flip flop JK va them chuc nang Preset va Clear, nhu trinh bay tren Hinh 6.14b Can

(168)

chu y rang ky hieu d Hinh 6.14b thong bao cho ta biet flip flop JK chuyen trang thai sudn dUdng xung nhip xuat hien va PR cung nhu CLR doi hoi xung d mu'c de xac lap hoac phuc hoi flip flop Hinh 6.14c la ky hieu cua flip flop JK thudng pham, loai 54/74LS76 Flip flop chuyen trang thai sudn am xung nhip tac dong va PR mCrc 0, flip flop xac lap (Set) va CLR mu’c 0, flip flop phuc hoi (Reset)

!

Q -C> CLK

PR

CLK

CLR Q

PR

> CLK

CLR

—©—

a) Ky hieu FF JK

b) FF JK xac lap va

phuc hoi 6 mtic H

c) FFJK xac lap va

phuc hoi O mtic L

Hinh 6.14: Flip flop JK

6.7 FLIP FLOP JK MASTER-SLAVE

Hinh 6.15 la sd nguyen ly ve cau true cua flip flop JK Master-Slave Flip flop JK Master-Slave gom flip flop: flip flop Master va flip flop Slave, flip flop JK Master-Slave hoat dong nhu sau: flip flop Master chuyen trang thai b§ng sudn duong xung nhip va flip flop Slave chuyen trang thai bang sudn am xung nhip Do do, flip flop Master dap ting vdi ngd vao J va K cua no trudc so vdi flip flop Slave Neu J = 1 va K = 0, flip flop Master xac lap sudn di/Cng xung nhip tdi ngd vao cua CLK Ngd Q = 1 se dieu khien ngd vao J cua flip flop Slave, nen sudn am xung nhip xuat hien, flip flop Slave xac lap, chep lai hoat dong cua flip flop Master

Hinh 6.15: Flip flop Master-Slave

(169)

Neu co hai ngo vao J va K cua Flip flop Master deu^d muc 1, ngo Q se chuyen trang thai bu sUo'n duong xung nhip xuat hien d ngo vao CLK cua flip flop Master Khong can quan tam la flip flop Master da chuyen trang thai nao chi biet la f|jp f|0p Slave chep giong het hoat dong cua flip flop Master, flip flop Slave cung phuc hoi (Reset)

Hinh 6.16a la ky hieu cua flip flop J K Master-Slave Flip flop co chu’c nang Preset va Clear Vong tron nhd d ngo vao CLK nhac ta nho la ngo chuyen trang thai sudn am xung nhip xuat hien d ngd vao CLK Flip flop JK Master- Slave hay ducfc dung cac bo dem IC 54/74 LS76 cd mot cap flip flop JK Master-Slave, dupe dung rong rai ky thuat mach digital Chan IC 54/74LS76 va bang su that duoc trinh bay tren Hinh 6.16b va c.

a) Ky hieu cua

Flip Flop JK chu-ta b) Ky hieu logic va chan cua IC 54/74L S 76

Input Output

Tai thai diem tn Tai thai diet

J K Qn+1

0 0 Qn

0 1 0

1 0 1

1 1 Qn

c) Dang su th a t

Hinh 6.16: Flip flop JK Master-Slave

6.8 TRI-GO SCHMITT

Tri-go Schmitt la mot mach dien tir dupe dung de phat hien xem dien ap cd vupt qua mu’c tham chieu hay khong Mach tri-go Schmitt cd hai trang thai on dinh va dac biet dupe sir dung nhu la bo dieu chinh tin hieu Cd xung hinh sin, xung tam giac, hoac xung chu ky cho trudc nao d ngd vao, tri-go Schmitt se tao xung hinh chu nhat d ngd ra, cd sudn trudc va sudn sau th in g dirng, nhir yeu cau ve xung doi vdi cac mach dien tir so

VO UT

M i'ic H

Muc L

VOUT (V)

3.4

i '

a)

Hinh 17: Dac tinh ddng thai chuyen Hinh 6.18: Invectd tri-go’ Schmitt mu'c cua tri-gd Schmitt a) Ky hieu logic b) Dac tinh chuyen mu'c

(170)

Hinh 6.17 bieu thi chCrc nang di chuyen (VOUT doi v6i VIN) cua tri-gd Schmitt Gia tri VIN tao d ngo budc nhay tir mu’c L len mu’c H, duoc goi la dien ap ngudng dirong VT+, gia tri VIN tao ngo budc nhay tir mu'c H xuong mu’c L du’Oc goi la dien ap ngudng am VT

Dien ap ngo hoac mu’c H hoac mu’c L Khi ngo d mu’c L, can tang dien ap d ngo vao Idn hon mot chut so vdi VT+ de cd the chuyen mu’c Sau do, dien ap d ngd dupe chuyen trang thai tu’ mu’c L len mu’c H va tri trang thai cho den nao dien ap ngd vao giam nho hon gia tri VT_ mot chut, do, ngd se chuyen trang thai tir mu’c H xuong mu’c L Cac mui ten va dudng dut net bieu thi cac dong thai chuyen mu’c

Sir phan biet giua hai dien ap ngirdng dupe biet nhir la dudng tre Cd the loai bo hien tupng trd thiet ke mach, nhirng mot lirpng nho cua hien tirpng tre la can thiet, vi no dam bao cho dong thai chuyen mu’c nhanh tren mot giai rong cua nhiet Tre cung cd the la mot dac ti'nh cd Ipi Vi du, tre cd the du’Oc sir dung de loai tru" nhieu cac Crng dung nhat dinh

IC 7414 cd mach Invecto dung tri-go Schmitt, dang DIP Hinh 6.18a la ky hieu logic chuan cua Invecto dung tri-go Schmitt IC 7414 Trong Hinh 6.18b, khi dien ap ngd vao virpt qua mu’c 1,7V, dien ap ngd se chuyen trang thai xuong mu’c L Khi dien ap ngo vao xuong nho hon 0,9V, dien ap ngd se chuyen trang thai len mu’c H Dong thai chuyen mu’c dupe cac mGi ten va cac dirdng dut net bieu thi

Hinh 6.19: Cac dang xung ngd vao ngo cua tri-go Schmitt

Hinh 6.19 chi dang xung ngd vao va ngd cua trigo Schmitt Hinh mo ta tin hieu d ngd vao va ngd cua co’ ng dao sir dung trigo Schmitt Trigo Schmitt da thay doi dang xung tir dang song hinh sin d ngd vao dang xung chu nhat cd sudn trirdc va sudn sau th in g dirng Hoat dong cua trigo Schmitt cung tirong tu doi vdi cac dang xung ngd vao la cac xung cd chu ky, xung ngd cung v in la xung chCr nhat

6.9 CAC DANG XUNG NHIP

(171)

digital That khong can xung nhip co dang that doi xirng nhi/ chi tren

Hir>h 6.20a, ma co the la mot chudi xung di/dng (hoac am) nhu” chi tren Hinh 6.20b, dang xung la xung vuong khong doi xirng

CTi gian chu ky xung nhip jThgi gian chu ky xung nhip

Hinh : Cac dang xung nhip ly tifcng

Hinh 6.20

Can chu y rang xung nhip dirpc xac dinh la khoang thdi gian cd ban, khoang qua trinh hoat dong logic phai du’Oc dien Khoang thdi gian cd ban di/dc dinh nghTa la thdi gian cua mot chu ky xung nhip Nhi/vay, tat ca cac phan tCf logic, flip flop , cac cong v.v phai hoan ch u t nang cua chung khoang thdi gian nhd hon thdi gian cua mot chu ky xung nhip

Dang xung nhip ve tren true thdi gian nhi/ d Hinh 6.21- ThCr nhat, xung nhip phai co mu’c logic tuyet doi on dinh Khi xung nhip d trang thai 1, mu’c logic phai tri dung d dien ap +5V, nhi/ chi tren true thdi gian giCra diem a va b xung nhip d trang thai 0, mu’c phai khcng thay ddi va bang OV nhi/ chi giCra diem b va c Tren thirc te, ti'nh <5n dinh cua xung nhip quan hon nhieu so vdi gia tri tuyet doi cua mu’c dien ap Vi du, dang le d trang thai 1, mu’c dien ap la +5V, nhi/ng xung nhip du’Oc coi nhi/ hoan hao neu co mu’c dien ap la + 4,8V, nhi/ng gia tri phai ben vCrng , khong thay doi

- ThCr hai, thdi gian chuyen trang thai tir 1 xuong hoac ngi/dc lai, ddi hoi phai bang N hi/tren Hinh 6.21, chuyen trang thai tir len 1 tai thdi diem a phai

la doan th in g dirng CGng nhi/vay, chuyen trang thai t i r xuong tai thdi diem b Nhi/ vay, xung nhip ly ti/dng co thdi gian chuyen trang thai bang Dang xung nhip hcan had c6 the xuat hien tren man hien s6ng cac vach nhi/ tren Hinh 6.21b Thcat nhin, ta ti/dng nhi/ la co hai vach nam ngang gom cac doan ngan Kiem tra ky, co the thay dang song dung nhu” Hinh 6.21a, neu bo cac doan th in g dung Cac doan khong hien len man hien song vi cac thdi gian chuyen trang thai rat nhd (gan nhu” bang 0) va may hien song khong co kha nang dap C/ng vdi thdi gian rat ngan Doan th in g di/ng du’Oc the hien tren man hinh bang cach tang "ci/dng do" hoac giam "thdi gian quet" cua may hien song

Hinh 6.21c la hinh anh mot xung nhip giam thdi gian quet de thay ro thdi gian chuyen trang thai cua xung nhip tren Hinh 6.21b Rc rang la xung nhip can phai co mot khoang thdi gian de chuyen trang thai tir mu’c len mu’c 1, thdi gian dirpc ky hieu la tr, la thdi gian hinh sudn tri/dc cua xung nhip; can phai co mot khoang thdi gian de chuyen trang thai tu1 mu’c xuong mu’c 0, thdi gian dude ky hieu la tf, la thdi gian hinh sudn sau cua xung nhip Thcng thirdng thdi gian hinh sudn trirdc va sirdn sau cua xung nhip nhir sau: thdi gian hinh sudn trirdc ti'nh tir mu’c dien ap bang 10% den mu’c dien ap bang 90%

(172)

cua dien ap xung nhip mu’c Trong trirdng hop 100% mu’c dien ap xung nhip bang +5V, nen 10% bang 0,5V va 90% bang 4,5V Nhu1 vay, thdi gian hinh sirdn trirdc cua xung nhip ti'nh tir luc xung nhip tang tir 0,5V len den 4,5V Tirong tii nhu” vay, thdi gian hinh sirdn sau cua xung nhip ti'nh tCr luc xung nhip chuyen tu” 4,5V xuong 0,5V

— , i | I -5 V

-o v -1 1 - I -1 > - 0 v

-1 lime

t> c i t> e

11 mug ly tuong *61 vweh tren may htan w r ,i • V ■

4.5 V

0 V —

0-5 V _ _ I I

Hinh 6.21

- ThCr ba, xung nhip ly tirong phai co tan so on dinh Ngirdi ta chia tan so on dinh lam hai loai: on dinh thdi gian ngan, yeu cau tan so xung nhip khong du’Oc phep thay doi vai phan tram thdi gian khoang vai gid; on dinh thdi gian dai, co the la mot vai ngay, thang hoac nam Tin hieu xung nhip on dinh thdi gian dai thirdng la nhCrng mach dac biet, du’Oc dat Id on nhiet de dam bao dieu khien du’Oc nhiet do, do, on dinh du’Oc tan so Cac mach nhir vay co the cung cap tan so xung nhip co on dinh it hon vai phan cua 109 mot

6.10 XUNG NH|P TTL

IC 7404 gom cong Invecto du’Oc dung de lam bo phat xung nhip tirong hop vdi cac IC TTL khac rat tot Mach tao xung nhip du’Oc trinh bay tren Hinh 6.22.

Mach tao xung nhip rat quen thuoc va du’Oc dung rong rai Hai cong Invecto du’Oc dung lam hai tang khuech dai, dich pha 360° giCra chan va chan Tin hieu d chan du’Oc dira hoi tiep ve chan qua thach anh va mach dao dong d tan so thach anh quyet dinh Vi phan tir hoi tiep la thach anh nen tan so dao dong rat on dinh Mach hoat dong nhu” sau:

(173)

loi cua no bang A2 = - R2 Hai bo khuech dai dupe noi v6i qua tu dien 0,01 |uF de tao nen mach khuech dai co Ipi chung bang A = A, x A2 = R, x R2 Chu y rang Ipi chung co dau dirong bieu thi dich pha 360° Trong trudng hpp nay, A = 330 x 330 = 1,09 x 105 V/A Vi du, neu tang lIN len 45 (iA, se lam tang dien ap len +5V chan cua cong dao Tin hieu chan du’Oc hoi tiep ve chan 1, se lam tang l(N (hoi tiep duong) va lam cho mach dao dong

C r y s t a l

—^ ^ R l : 3

Inv '

IC 4

R : 3 O lu F

6

♦-Inv 2

11 rv 10

+ V c c

GND

Inv 3

Tai mo phong

3

X

Ngo cua xung nhip

lO O p F

Hinh 6.22: Mach xung nhip TTL

Thach anh mac theo kieu noi tiep du’Oc dung nhu1 phan tir hoi tiep de dira mot phan tin hieu chan ve chan Thach anh hoat dong nhir la mach RLC noi tiep va tan so cong hudng, thach anh co trd khang thap va khong dich pha Do tin hieu hoi tiep co tan so la tan so cong hudng cua thach anh, hai co’ ng Invecto noi vdi thach anh tao nen dao dong tai tan so cong hudng cua thach anh

Do Ipi chung du Idn de dieu khien mdi co’ ng Invecto dan bao hoa va ngung dan va ngd cho dang xung chu ky nhu chi d ngd cua mach tao xung dupe bieu thi tren Hinh 6.22 Xung nhip d ngd cd mu’c dien ap tU 0V den +5V, cd thdi gian hinh sudn xung trudc va sudn xung sau nhd hon 10 ns Ve co ban, xung nhip dupe xem nhu la dang xung vuong Tan so cua tin hieu xung nhip thach anh quyet dinh, noi chung, gia tri tan so tU MHz den 20 MHz

Co’ng Invecto dupe dung lam khuech dai dem ngd va thich hpp vdi viec dieu khien tai 330 Q noi song song vdi tu 100 pF, dong thdi cho thdi gian hinh sudn trudc tr va sudn sau I, cua xung nhip nho hon 10 ns

6.11 BO DjNH THC5I DUNG IC 555

IC 555 dupe dung lam bo dao dong de cung cap xung nhip Mach dinh thdi dung IC 555 la mach rat co ban cd hai mUc khac d ngd Vdi cac linh kien dupe bo sung them cd tri so phu hpp, mach cung cap tan so dao dong mong muon Noi cach khac, d ngd co dao dong chu ky, dang xung vuong Tan so dao

(174)

dong du’Oc dieu khien chinh xac nhd hai dien trd va mot tu don lap phu them phi'a ngoai

So nguyen ly cua bo dinh thdi dung IC 555 du’Oc trinh bay tren Hinh 23.

Tu dinh thdi C du’Oc nap den + Vcc qua dien tro RA va RB Thdi gian nap t, du’Oc ti'nh theo cong thu’c:

t, = 0,693 (RA + Rb) C

Tu dinh thdi C phong dien qua dien tro RB xuong dat Thdi gian phong dien t2 du’Oc ti'nh theo cong thu’c :

t2 = 0,693 RB C Chu ky T cua xung nhip la tong cua t, va t2:

T = t, + t2 = 0,693 (RA + 2RB) C

Tan so dao dong la:

1,44 f = 1/T =

(Ra + Rb) C

Ngo ra

V cc

■ n 5

G n d Vcc Trg Dis Out Thr Rst Ctl .OluF RA RB f t 4 '

C(u F)

- (

V

I

-\

i k \ V \ L >

j ,

\

<4 0m 1>] w v s n

v N

\

\ \

^ i

1 - i

-X

> -At -N N

\

N

.1

Hinh 6.23: Mach dinh thdi dung IC 555

10 100 Ik 10k 100k f (Hz)

Vi du:

Xac dinh tan so dao dong cua bo dinh thdi dung IC 555, neu RA= Rb = k Q

va C = 1000 pF Ldi giai:

Dung cac he thu’c tren, ta co:

1,44 F =

[1000 + 2(1000)] 10"

(175)

6.12 DAO DONG DON ON DUNG IC DjNH THCJl 555

Chi vdi si/ thay doi nho, bo dinh thdi trinh bay phan 6.10 chuyen bo dao dong cd mot trang thai on dinh (don on) Loai mach di/pc dung rong rai ky thuat Hoat dong cua bo dinh thdi la d ngd vao nhan du’Oc mot xung tac dong, no chuyen sang trang thai gia on dinh, no tri trang thai nijy mot khoang thdi gian t du’Oc dinh tri/dc Sau do, mach trd lai trang thai on dinh cua no cho den lai nhan du’Oc mot xung tac dong mdi VI mach chi co mot trang thai on dinh nen du’Oc goi la mach don on

TRIGGER TRIGGER Q 0

O-a) Ky hieu logic b) Dang song

Hinh 6.24: Mach don on

Hinh 6.24a la ky hieu logic tieu chuan_cua mach don on Ngd vao du’Oc ky hieu tri-go, ngd ky hieu Q va phan bu la Q Thirdng thi ngd Q co trang thai mach trang thai on dinh Hinh 6.24b gidi thieu dang xung cua ngd vao tri-go va ngd Q Trong tri/dng hpp nay, mach du’Oc tac donq vdi sirdn am cua xung tri-go va ngd cd mu’c mach phuc hoi ve trang thai on dinh Mot du’Oc tac dong, Q len mu’c va tri d mu’c khoang thdi gian xac dinh tri/dc t va chuyen ve trang thai on dinh cua no cho den sirdn am xung tri-go khac xuat hien d ngd vao

Hinh 6.25a la mach don on Trong trang thai on dinh, tu dinh thdi C phong dien hoan toan qua tranzito ben cua IC, noi tu C vdi chan 7, luc do, ngd d chan cd dien ap bang (tiep dat)

RL

Tai "dong mach'

Ngo ra

RL

Tai "cat mach1

t r igI er

-f RESET -rt* 555 Gnd Vcc Trg Dis Out Thr Rst Ctl

+ Vcc

+ 5V den + 15V

1

f?ien ap dieu khiet, O lu F

RA

Phong dien NgUcnig

X J

~ a) Mach dan on

100 10 01 -; / > ' / lom / / / / / / / / >/ // /

•001 1 ms 100 ms 10 s

100 us 10 ms 1 s 1 0:

b) Thai gian tre t = 1.1RA x C

Hinh 6.25: Mach don on dung IC 555

(176)

Xung am cua ngo vao tri-go (chan 2) lam cho mach chuyen trang thai gia on dinh Luc do, ngo chan len mu’c va tranzito phong dien chan se chuyen trang thai lam cho ngo co mu’c 0, nhu vay, luc tu dinh thdi C blit dau nap dien cho den dat mu’c + Vcc

Khi dien ap tu C dat t6i 2/3 dien ap +Vcc, mach se tro ve trang thai on dinh, tranzito phong dien, dong mach trd lai va tu C phong dien xuong dat, ngo se tro lai mu’c (tiep dat), mach tri trang thai cho den mot xung khac den ngo vao tri-go

Ngo cua bo dao dong don on co the du’Oc xem la cac xung duong va rong xung duoc xac dinh nhu sau:

t = 1,1 (Ra x C)

(177)

CAU HOI VA BAI TAP

6.1 Neu dac diem cua flip flop Diem khac co ban giura flip flop va mach logic to hpp la gi?

6.2 Hay so sanh iru nhi/pc diem cua cac loai flip flop RS va JK

6.3 Neu cac diem giong va khac giCra cac flip flop RS Master- Slave va JK Master-Slave

6.4 Giai thi'ch hoat dong cua flip flop D

6.5 Giai thi'ch hoat dong cua flip flop JK Master-Slave

6.6 Gia du rang xung nhip co dang xung vuong, thdi gian tre khong dang ke va trang thai ban dau cua flip flop a mu’c Hay ve dang xung tai diem Q2 nhir tren mach dien Hinh 6.26.

+5V

JTTL CLK

J1 Q1 -CJ>CLK

K1

J 2 r C ( > CLK

K2

Hinh 6.26

6.7* Ve lai f!ip_flop_sir dung cong NAND nhir tren Hinh 6.4a va_gan cac mu’c logic vao cac chan S = R = Lap lai doi vdi cac trirdng hpp: S = R = 1; S = 1, R = 0; va S = 1, R =0

6.8* Cac dang xung cho tren Hinh 6.27 dieu khien flip flop RS dong bo tinh nhir tren Hinh 6.5 Xung nhip chuyen tir mu’c L len mu’c H tai cac thdi diem A, C, E va G Neu Q mu’c logic L trirdc thdi diem A, Hoi:

a) Tai thdi diem nao Q len mu’c H? b) Khi nao Q phuc hoi ve 0?

CLK-TLnLTLTU

A B C P E F G H

n

Hinh 6.27

6.9* Hinh 6.28 (Hinh 8.12) cho biet cac dang xung ngd vao cua R S va CLK du’Oc dat vao flip flop RS dong bo tinh Hay giai thi'ch dang xung ngd Q

(178)

Thai gian ■

CLK

Q

1

O-1

0-1

-0 1

o

-t1 t2

-i -i H -i -i

t3 t4 t5 t6

I I I I

I I I I

JL n

t7 t3

Hinh 6.28

6.10* Cd flip flop JK Master-Slave nhir tren Hinh 6.29 co cac ngo vao J va K diroc noi den +Vcc va chudi xung vuong dirpc dat vao ngo vao xung nhip CLK Hay mo ta dang xung ngo Q

+Vcc

CLK-J Q

c>

K- Q

Hinh 6.29 a BAI TAP

6.11 Trinh bay nguyen tac hoat dong cua cac ngo vao phu (Clear, Preset) cua cac flip flop

6.12 Ti'nh gia tri cua cac dien trd R „ R2 va tu dien C tren Hinh 6.23 de ngo co cac dao dong vdi cac tan so:

a) 100 Hz b) 500 kHz

6.13* Tinh rong xung ngd doi vdi bo djnh thdi cho tren Hinh 6.25 vdi cac dir lieu sau:

Ra = 10 kQ

C = 0,1 pF

6.14* Xac dinh gia tri cua C can thiet de chuyen doi rong xung bai tap 6.13 10 ms

6.15* Xac dinh tan so dao dong va cac gia tri t1 va t2 cua bo dinh thdi sir dung IC 555 nhir tren Hinh 6.23 vdi cac gia tri nhir sau: Ra = 5000 Q, Rb = 7500Q

Ngày đăng: 01/04/2021, 10:18

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w