You are on page 1of 299

1

K THUT S
Ngy nay cc thit b s, t ng ang thay th v ln t cc thit b tng t, chng hn nh radio, trc y, ngi s dng phi dng tay vn v chnh cc nt trn radio d i, cn cc thit b mi hin nay, cc thao tc c thay th ch bng mt hoc hai nt nhn rt d s dng. Cc thng tin di dng s d dng c x l v lu tr, mt khc thng tin c truyn i c kh nng chng nhiu rt cao.

1.1.GII THIU CHUNG V H THNG S V QUI UC CA H THNG S


1.1.1 H thng tng t (Analog System) L thit b thao tc cc i lng vt l c biu din di dng tng t. Trong h thng tng t cc i lng c th thay i trong mt khong gi tr lin tc. Mt vi h thng tng t thng gp nh: b khuch i m tn, thit b thu pht bng t,Tn hiu tng t c minh ho bng hnh 1.1

Hnh 1.1 1.1.2 H thng s (digital system) L tp hp cc thit b c thit k thao tc thng tin logic hay i lng vt l c biu din di dng s, tc l nhng i lng ch c gi tr ri rc. y thng l cc h thng in t nhng i khi cng c h thng t, c hay kh nn. Mt vi h thng k thut s ta thng gp l: my vi tnh, my tnh tay, thit b nghe nhn s v h thng in thoi. Tn hiu s c minh ha nh hnh 1.2

Hnh 1.2

2
Mch s c nhiu u im hn so vi mch tng t do mch s ngy cng c nhiu ng dng trong ngnh in t, cng nh trong hu ht cc lnh vc khc. Mt s u im ca k thut s: - Thit b s d thit k hn - Thng tin c lu tr v truy cp d dng v nhanh chng - Tnh chnh xc v tin cy cao - C th lp trnh h thng hot ng ca h thng k thut s. - Mch s t b nh hng bi nhiu, c kh nng t lc nhiu,t pht hn sai v sa sai. - Nhiu mch s c th c tch hp trn mt chp IC. - chnh xc v phn gii cao. Nhc im ca k thut s Hu ht cc i lng vt l c bn cht tng t, v chnh nhng i lng ny thng l u vo v u ra c mt h thng theo di, x l v iu khin. Nh vy mun s dng k thut s khi lm vic vi u vo v u ra dng tng t ta phi thc hin s chuyn i t dng tng t sang dng s, sau x l thng tin s t ng vo v chuyn ngc li t dng s x l sang dng tng t, y l mt nhc im ln ca k thut s. s dng c h thng k thut s i vi u vo v u ra l dng tng t ta cn thc hin cc bc sau y: Bin i thng tin u vo dng tng t thnh dng s X l thng tin s Bin i u ra dng s v li dng tng t hiu c qu trnh chuyn i ta xem v d minh ha hnh 1.3 sau:

Theo s khi hnh 1.3 th nhit di dng tng t c o, sau gi tr o c s c chuyn sang i lng s bng h thng bin i tng t sang s (Analog to Digital Converter ADC). i lng s ny c x l qua mt mch s. u ra s c a n b bin i s sang tng t (Digital to Analog Converter DAC), cui cng u ra tng t c a vo b iu khin tin hnh iu chnh nhit . Mt nhc im khc ca h thng s l gi thnh cao, v d nh truyn hnh s s tn km hn truyn hnh tng t. 1.1.3 H thp phn Trong cc h thng s th h thp phn gn gi nht v n c ta s dng hng ngy. Khi hiu cc c im ca n s gip hiu hn nhng h thng s khc. H thp phn hay cn gi l h c s 10. Bao gm 10 ch s (k hiu) l 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. H thp phn l mt h thng theo v tr v trong gi tr ca mt ch s ph thuc vo v tr ca n. hiu r iu ny ta xt v d sau: xt s thp phn 345. Ta bit rng ch s 3 biu th 3 trm, 4 biu th 4 chc, 5 l 5 n v. Xt v bn cht, 3 mang gi tr ln nht trong ba ch s, c gi l ch s c ngha ln nht (MSD). Ch s 5 mang gi tr nh nht, gi l ch s c ngha nh nht (LSD). din t mt s thp phn l ngi ta dng du chm thp phn chia phn nguyn v phn phn s. ngha ca mt s thp phn c m t nh sau:

V d 1: S 435.568 435.568 = 4x102 + 3x101 + 5x100 + 5x10-1 + 6x10-2 + 8x10-3 Tm li, mt s thp phn; nh phn hay thp lc u l l tng ca cc tch gia cc gi tr ca mi ch s vi gi tr v tr (cn gi l trng s) ca n.

1.1.4 H nh phn Trong h thng nh phn (binary system) ch c hai gi tr s l 0 v 1. Nhng c th biu din bt k i lng no m h thp phn v h cc h thng s khc c th biu din c, tuy nhin phi dng nhiu s nh phn biu din i lng nht nh. Tt c cc pht biu v h thp phn u c th p dng c cho h nh phn. H nh phn cng l h thng s theo v tr. Mi nh phn u c gi tr ring, tc trng s, l lu tha ca 2. biu din mt s nh phn l ta cng dng du chm thp phn phn cnh phn nguyn v phn l. ngha ca mt s nh phn c m t nh sau:

tm gi tr thp phn tng ng ta ch vic tnh tng cc tch gia mi s (0 hay 1) vi trng s ca n. V d2 : 1100.1012 = (1x 23) + (1x 22) + (0x21) + (0x20) + (1x2-1) + (0x2-2) + (1x 2-3 ) = 8 + 4 + 0 + 0 + 0.5 + 0 + 0.125 = 12.125

CCH GI NH PHN Mt con s trong s nh phn c gi 1 bit (Binary Digital). Bit u (hng tn cng bn tri) c gi tr cao nht c gi l MSB (Most Significant Bit bit c ngha ln nht), bit cui (hng tn cng bn phi) c gi tr nh nht v c gi LSB (Least Significant Bit bit c ngha nh nht). S nh phn c 8 bit c gi l 1 byte, s nh phn c 4 bit gi l nipple. Mt nhm cc bit nh phn c gi mt word (t) khi s c 16 bit, s 32 bit gi l doubleword, 64 bit gi l quadword. Ly tha ca 210 = 1024 c gi tt l 1K (c K hay kilo), trong ngn ng nh phn 1k l 1024 ch khng phi l 1000. Nhng gi tr ln hn tip theo nh:

6
211 = 21 . 2
10

= 2K

212 = 22 . 210 = 4K 220 = 210 . 210 = 1K . 1K = 1M (Mega) 224 = 24 . 220 = 4. 1M = 4M 230 = 210 . 220 = 1K. 1M = 1G (Giga) 232 = 22 . 230 = 4.1G = 4G Bng tr gi ca 2n

TN HIU S V BIU THI GIAN

Biu thi gian dng biu din s thay i theo thi gian ca tn hiu s, c bit l biu din hai hay nhiu tn hiu s trong cng mt mch in hay mt h thng. CCH M NH PHN Cch m mt s nh phn c trnh by theo bng sau

Nu s dng N bit c th m c 2N s c lp nhau

8
V d 3: 2 bit ta m c 22 = 4 s ( 002 n 112 ) 4 bit ta m c 24 = 16 s ( 00002 n 11112 ) bc m cui cng, tt c cc bit u trng thi 1 v bng 2N 1 tong h thp phn. V d: s dng 4 bit, bc m cui cng l 1111 2 = 24 1 = 1510 1.1.5 H thng s bt phn (Octal Number System) H bt phn c c s 8 ngha l c 8 k s : 0, 1, 2, 3, 4, 5, 6, 7, mi k s ca s bt phn c gi tr bt k t 0 n 7. Mi v tr k s ca h bt phn c trng s nh sau:

1.1.6 H thng s thp lc phn (Hexadecimal Number System) H thng s thp lc phn s dng c s 16, ngha l c 16 k s. H thp lc phn dng cc k s t 0 n 9 cng thm 6 ch A, B, C, D, E, F. Mi mt k s thp lc phn biu din mt nhm 4 k s nh phn. ngha ca h thng s thp lc phn c m t bng bng sau:

Mi quan h gia cc h thng thp lc phn, thp phn v nh phn c trnh by bng bng sau:

CCH M S THP LC PHN: khi m s thp lc phn, mi v tr c tng dn 1 n v t 0 cho n F. khi m n gi tr F, vng m li tr v 0 v v tr k s k tip tng ln 1. Trnh t m c minh ha nh di y:0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13,...,1A, 1B,...,20, 21,..,26, 27, 28, 29, 2A, 2B, 2D, 2E, 2F,..., 40, 41, 42 ., 6F8, 6F9, 6FA, 6FB, 6FC, 6FD, 6FE, 6FF,700,.

1.2 M S

1.2.1 M BCD Trc tip lin quan n mch s (bao gm cc h thng s dng s) l cc s nh phn nn mi thng tin d liu d l s lng, cc ch , cc du, cc mnh lnh sau cng cng phi dng nh phn th mch s mi hiu ra v x l c. Do phi c quy nh cch thc m cc s nh phn c dng biu th cc d liu khc nhau, kt qu l c nhiu m s (gi tt l m) c dng. Trc tin m s thp phn thng dng nht l m BCD ( Binary Coded Decimal: m s thp phn c m ha theo nh phn ). S chuyn i thp phn sang BCD v ngc li gi l m ho v s lp m. 1.2.1.1 Chuyn i thp phn sang BCD v ngc li

10
Ngi ta biu th cc s thp phn t 0 n 9 bi s nh phn 4 bit c gi tr nh bng di y. Chng ta nn ch rng: m BCD phi c vit 4 bit v s tng ng ch c p dng cho s thp phn t 0 n 9, nn s nh phn t 1010 (= 10 10) n 1111 (= 1510) ca s nh phn 4 bit khng phi l m BCD.

Khi chuyn i qua li gia thp phn v BCD ta lm nh v d minh ha sau y: V d 1: i 48910 sang m BCD

V d 2: i 53710 sang m BCD

V d 23: i 00110100100101012 (BCD) sang s thp phn

11

1.2.1.2 So snh BCD v s nh phn iu quan trng l phi nhn ra rng BCD khng phi l h thng s nh h thng s thp phn, nh phn, bt phn v thp lc phn. Tht ra, BCD l h thp phn vi tng k s c m ha thnh gi tr nh phn tng ng. Cng phi hiu rng mt s BCD khng phi l s nh phn quy c. M nh phn quy c biu din s thp phn hon chnh dng nh phn; Cn m BCD ch chuyn i tng k s thp phn sang s nh phn tng ng. M BCD cn nhiu bit hn biu din cc s thp phn nhiu k s (2 k s tr ln. iu ny l do m BCD khng s dng tt c cc nhm 4 bit c th c, v vy c phn km hiu qu hn. u im ca m BCD l d dng chuyn i t thp phn sang nh phn v ngc li. Ch cn nh cc nhm m 4 bit ng vi cc k s thp phn t 0 n 9. Phi hp cc h thng s Cc h thng s trnh by c mi tng quan nh bng sau y:

12
1.2.1.3 CNG BCD Khi tng nh hn hoc bng 9 th ta thc hin php cng BCD nh cng nh phn bnh thng. V d: xt php cng 6 v 2, dng m BCD biu din mi k s

mt v d khc, cng 45 vi 33

Tng ln hn 9 ta xt php cng 5 v 8 dng BCD:

Tng ca php cng trn l 1101 khng tn ti trong m BCD. iu ny xy ra do tng ca hai k s vt qu 9. Trong trng hp ny ta phi hiu chnh bng cch cng thm 6 (0110) vo nhm tnh n vic b qua 6 nhm m khng hp l. V d:

Mt v d khc:

13

1.2.2 M ASCII M ch s c s dng rng ri nht hin nay l m ASCII (American Standard Code for Information Interchange). M ASCII l m 7 bit, nn c 2 7 = 128 nhm m, biu th tt c k t ca mt bn phm chun cng nh cc chc nng iu khin. Bng di y minh ha mt phn danh sch m ASCII. K t M bit A B C D E F G H I J K L M N O P 100 0001` 100 0010 100 0011 100 0100 100 0101 100 0110 100 0111 100 1000 100 1001 100 1010 100 1011 100 1100 100 1101 100 1110 100 1111 101 0000 101 102 103 104 105 106 107 110 111 112 113 114 115 116 117 120 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 ASCII 7 Bt phn Thp phn

14
Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 <k t ring> . ( + $ * ) _ / , 101 0001 101 0010 101 0011 101 0100 101 0101 101 0110 101 0111 101 1000 101 1001 101 1010 011 0000 011 0001 011 0010 011 0011 011 0100 011 0101 011 0110 011 0111 011 1000 011 1001 010 0000 010 1110 010 1000 010 1011 010 0100 010 1010 010 1001 010 1101 010 1111 010 1100 121 122 123 124 125 126 127 130 131 132 060 061 062 063 064 065 066 067 070 071 040 056 050 053 044 052 051 055 057 054 51 52 53 54 55 56 57 58 59 5A 30 31 32 33 34 35 36 37 30 39 20 2E 28 2B 24 2A 29 2D 2F 2C

15
= <RETURN> <LINEFEED> 010 1101 000 1101 000 1010 075 015 012 2D 0D 0A

1.2.3 M THA 3 (Excess 3 code) Bng di y cho bit m s tha 3 ng vi s thp phn t 0 n 9. chuyn i s thp phn sang m tha 3 trc tin ta thm 3 vo s thp phn ri chuyn sang nh phn bnh thng.

V d: 210 2 + 3 = 510 = 0101 510 5 + 3 = 810 = 1000 Do cch vit s thp phn ra m tha 3 tng t nh cch vit s thp phn ra m BCD ni trc, nn ngi ta c th hiu m tha 3 l mt dng ca m BCD. d phn bit m BCD ni n phn trc c gi l m BCD 8421. 1.2.4 M GRAY Bng di y trnh by m s Gray cng vi m s nh phn v thp phn t 0 n 15. M Gray c chn sao cho ch thay i mt v tr bit gia hai m k nhau.

16

1.2.5 THM BIT CHN L PHT HIN SAI Tn hiu biu th s nh phn truyn t mch ny sang mch khc, v nht l truyn i xa b mo dng v nhim nhiu khin s nh phn nhn c c th sai so vi s cn truyn. khc phc hin tng ny ngi ta thm vo m ASCII 7 bit mt bit chn l (Parity bit) v tr c ngha cao nht (bn tri) c d liu 8 bit (1 bit chn l, 7 bit d liu gc). cch dng l (Odd parity) th bit parity thay i lm cho tng s bt 1 trong byte l l. V d:

cch dng chn (Even parity) th bit parity thay i cho tng s bit 1 trong byte l chn. V d:

17
Bng cc thut ton, cc mch s s m tng s bit cng loi trong byte nhn c x l, nu d liu x l khng khp vi qui c v bit chn l, s s c mch nhn bit l s b sai.

1.3 CHUYN I GIA CC H THNG S


1.3.1 I T NH PHN SANG THP PHN Mi k s nh phn (bit) c mt trng s da trn v tr ca n. Bt k s nh phn no cng u c th i thnh s thp phn tng ng bng cch cng cc trng s ti nhng v tr c bit 1. hiu r hn ta xt mt vi v d sau y:

1.3.2 I T THP PHN SANG NH PHN C hai cch chuyn i mt s thp phn sang nh phn tng ng. Phng php th nht l cch i ngc li qu trnh i nh phn sang thp phn, l : s thp phn c trnh by di dng tng cc ly tha ca 2, sau ghi cc k s 0 v 1 vo v tr bit tng ng.

18

Cch th hai gip chuyn i t s thp phn nguyn sang nh phn l dng phng php lp li php chia cho 2. V d, vi mt s thp phn 27 ta thc hin php chia s ny cho 2 v ghi li s d sau mi ln chia cho n khi thu c thng s bng 0, v kt qu nh phn hnh thnh bng cch vit s d u tin l LSB v s d cui cng l MSB.

19

Qu trnh chuyn i bng phng php ny c minh ha bng lu sau y:

20

Lu trn biu din phng php lp li php chia chuyn i s nguyn thp phn sang nh phn. Phng php ny cng c s dng chuyn i s nguyn thp phn sang bt k h thng s no khc.

1.3.3 I T BT PHN SANG THP PHN Ta d dng i s bt phn sang thp phn tng ng bng cch nhn tng k s bt phn vi trng s ca n, ri cng kt qu vi nhau. V d 7: i s bt phn 4708 thnh s thp phn 4758 = 4x(82) + 7x(81) + 5x(80) = 4x64 + 7x8 + 5x1 = 31710 V d 8: i s bt phn 34.6 thnh s thp phn 34.68 = 3x(81) + 4x(80) + 6x(8-1) = 24 + 4 + 0.75 = 28.7510

21

1.3.4 I T THP PHN SANG BT PHN C th dng phng php lp li php chia i mt s nguyn thp phn sang bt phn tng ng, vi s chia l 8. V d 9: i s thp phn 36510 thnh s bt phn tng ng

Ch mt iu l: s d u tin l s c gi tr nh nht (LSB) ca s bt phn, s d cui cng l s c gi tr ln nht (MSB) ca s bt phn.

1.3.5 I T BT PHN SANG NH PHN Php i t bt phn sang nh phn uc thc hin bng cch i tng k s bt phn sang s nh phn 3 bit tng ng. Tm k s bt phn c i nh bng sau y:

V d 10: i s 3468 sang nh phn Nh vy s bt phn 3468 tng ng vi s nh phn 0111001102

22
i s 324710 sang nh phn

Nh vy s bt phn 32478 tng ng vi s nh phn: 011010100111 2

1.3.6 I T NH PHN SANG BT PHN i t s nguyn nh phn sang bt phn c thc hin ngc li vi qu trnh i t bt phn sang nh phn. Cc bit ca s nh phn c nhm thnh tng nhm 3 bit, bt u t LSB. Sau mi nhm c i sang s bt phn tng ng. V d 11: i s nh phn 1001101102 thnh s bt phn

Nh vy s nh phn 1001101102 tng ng vi s bt phn 4668 khi khng 3 bit cho nhm cn li, trng hp ny ta s thm mt hoc hai bit 0 vo bn tri MSB ca s nh phn cho nhm sau cng. V d 14: i s 110111012 thnh s bt phn

Cch m trong h bt phn: trong h bt phn k s ln nht l 7 v vy trong cch m bt phn, v tr k s tng t 0 n 7, tip ta lp li t 0 cho n vng k tip v tng v tr k s ln 1.

23

Nh vy vi N v tr s bt phn th ta c th m t 0 n 8N 1, tng cng c 8N s m khc nhau. V d: vi 4 v tr k s bt phn ta c th m t 0000 8 n 77778.

1.3.7 I T THP LC PHN SANG THP PHN Mt s thp lc phn c th c i thnh s thp phn tng ng da vo d liu mi v tr k s thp lc phn c trng s l ly tha 16. LSD c trng s l 160, k s thp lc phn v tr tip theo c s m tng ln. Qu trnh chuyn i nh sau: V d ta i mt s thp lc phn 45616 sang s thp phn tng ng ta lm nh sau: 45616 = 4x162 + 5x161 + 6x160 = 4x256 + 5x16 + 6x1 = 1024 + 80 + 6 = 111010 Mt v d khc i s thp lc phn 4BE16 thnh s thp phn tng ng 4BE16 = 4x162 + 11x161 + 14x160 = 1024 + 176 + 14 = 121410 Ch , trong v d th 2 thay 11 vo B v 14 vo E khi i sang thp phn. Theo cch chuyn i nh 2 v d trn th ta c th i bt k mt s thp lc phn sang thp phn tng ng.

1.3.8 I T THP PHN SANG THP LC PHN

24
Tng t nh cch i t thp phn sang nh phn hay bt thn, khi i t thp phn sang thp lc phn ta cng dng cch lp li php chia cho 16 v ly s d nh trc. V d 15: i s 76510 thnh s thp lc phn. Ta thc hin php chia, ta c:

V d 16: i 72410 thnh s thp lc phn

Chng ta nn nh rng bt k mt s d no trong php chia ln hn 9 u c biu din bi cc ch t A n F khi i sang s thp lc phn.

1.3.9 I T THP LC PHN SANG NH PHN Cch i t s thp lc phn sang s nh phn cng ging nh i t bt phn sang nh phn, ngha l mi k s thp lc phn c i sang gi tr nh phn 4 bit tng ng. V d17: i s 8D216

25

1.3.10 I T NH PHN SANG THP LC PHN i t s nh phn sang thp lc phn ta lm ngc li cch i t thp lc phn sang nh phn. Ngha l ta nhm thnh tng nhm 4 bit, mi nhm c i sang k s thp lc phn tng ng. S 0 c th c thm vo hon chnh 4 bit cui cng. V d18: i s 110011011012 thnh s thp lc phn

V d 19: i s 10101001112 thnh s thp lc phn

TM TT CC PHP CHUYN I GIA CC H THNG S: Khi thc hin php bin i t h nh phn (hoc bt phn hay thp lc phn), ta ly tng trng s ca tng v tr k s. Khi i t h thp phn sang h nh phn (bt phn hay thp lc phn), ta p dng phng php lp li php chia cho 2 (8 hay 16) v kt hp cc s d. Khi i t s nh phn sang bt phn (hay thp lc phn), ta nhm cc bit thnh tng nhm 3 (hoc 4) bit v i tng nhm ny sang k s bt phn (hay thp lc phn) tng ng.

26
Khi i t s bt phn (hay thp lc phn) sang nh phn, ta i mi k t thnh s nh phn 3 (hoc 4) bit tng ng. Khi i t s bt phn sang thp lc phn (hay ngc li), ta i sang nh phn trc, sau i sang h thng s mong mun.

1.4 TNH TON VI H THNG S


1.4.1 .CNG S HEX (THP LC PHN) Php cng s hex c thc hin ging nh cng thp phn. Sau y l cch thc cng s hex: Cng hai k s hex trong h thp phn, tnh nhm gi tr thp phn tng ng cho nhng k s ln hn 9 Nu tng nh hn hoc bng 15, c th biu din trc tip dng k s hex Nu tng ln hn hoc bng 16, tr 16 v nh 1 n v tr k s k tip. Sau y l mt s v d cng cc s hex minh ha

v d 1 ta cng cc LSD (7 v 4) cho ra 11, l B h hex. Khng c s nh, cng 5 v 3 cho ra 8. v d 2 ta bt u cng 8 v A, tnh nhm A ra gi tr thp phn l 10 . Do tng l 18, s ny ln hn 16 nn ta tr cho 16 c 2, vit s 2 v nh 1 sang v tr k tip. Cng s nh cho 4 v 3 ta c tng l 8. v d 3 tng ca C v D xem nh 12 + 13 = 2510, s ny ln hn 16 nn ta tr cho 16 cn 9, v nh 1 sang v tr k tip. Cng s nh ny vi B v 3 ta c 15 10 i sang s hex l F , nh 1 sang v tr k tip. Cng s nh ny vi 4 v 4 ta c 9, v kt qu cui cng l 9F9. 1.4.2 CNG NH PHN Php cng hai s nh phn c tin hnh ging nh cng s thp phn. Cc bc ca php cng nh phn c p dng cho s nh phn. Tuy nhin, ch c bn

27
trng hp c th xy ra trong php cng hai s nh phn (bit) ti v tr bt k. l:

Di y l mt vi v d v cng hai s nh phn (s thp phn tng ng trong du ngoc):

Php cng l php ton s hc quan trng nht trong h thng k thut s. Nh ta s thy, cc php tr, nhn v chia c thc hin hu ht my vi tnh v my tnh bm tay hin i nht thc ra ch dng php cng lm php ton c bn ca chng.

1.4.3 TR NH PHN Trong php tr nu s tr nh hn s tr, c th l khi 0 tr 1, th phi mn 1 hng cao k v l 2 hng ang tr v s mn ny phi tr li cho hng cao k tng t nh php tr ca hai s thp phn. V d 1: trng hp tr hai s nh phn 1 bit

V d 2: Tr hai s nh phn nhiu bit

28

1.4.4 BIU DIN CC S C DU Do a s my tnh x l c s m ln s dng nn cn c du hiu no biu th du ca s ( + hay - ). Thng th ngi ta thm vo mt bit ph gi l bit du. Thng thng chp nhn bit 0 l bit du biu th s dng, bit 1 l bit du biu th s m. Dng b 1 c b 1 ca s nh phn, ta thay mi bit 0 thnh bit 1 v mi bit 1 thnh bit 0. Ni cch khc, ta thay i mi bit trong s nh phn cho thnh bit b (o) tng ng. V d :

Dng b 2 B 2 ca mt s nh phn c hnh thnh bng cch ly b 1 ca s v cng 1 vo v tr nh nht. V d 3: Tm dng b 2 ca s 1101012 = 5310

V d 4:

29

Biu din s c du bng b 2 B 2 biu din nhng s c du theo cch sau y: Nu l s dng, th tr tuyt i c biu din theo dng nh phn thc s ca n, v bit du l 0 c t vo trc MSB. Nu l s m, tr tuyt i c biu din dng b 2, v bit du l 1 c t trc MSB. V d minh ha:

Cc php tnh trong b 2 tng t nh php tnh s nh phn bnh thng.

1.4.5 NHN NH PHN Php nhn s nh phn c thc hin tng t nh nhn s thp phn. Qu trnh tht ra n gin hn v k s ca s nhn ch l 0 v 1, v vy ta ch nhn cho 0 hay 1. V d:

30

1.4.6 CHIA S NH PHN Php chia mt s nh phn (s b chia) cho mt s khc (s chia) c thc hin ging nh php chia s thp phn. Tin trnh thc t cn n gin hn do khi kim tra xem c bao nhiu ln s chia i vo s b chia, ch c hai kh nng l 0 v 1. Qu trnh chia c minh ha bng v d sau:

Trong v d u tin ta c 10012 chia cho 112, tng ng 910 chia cho 310 Thng s l 00112 = 310. Trong v d th 2, 10102 chia cho 1002 tc l 1010 chia cho 410 kt qu l 0010.12 = 2.510 Php chia s c du c thc hin nh php nhn. S m c bin thnh s dng bng php b, sau mi thc hin php chia. Nu s b chia v s chia c du ngc nhau, thng s i sang s m bng cch ly b 2 n v gn bit du l 1. Nu s b chia v s chia cng du, thng s s l s dng v c gn bit du l 0.

Bi 2:I S BOOLE V NG DNG


Trang 1

31
2.1 THIT K BIU THC LOGIC 2.1.1 CC PHP TON I S BOOLE Bi v cc i lng ch c hai trng thi nn i s Boole rt khc i s thng v d tnh ton hn. i s Boole khng c phn s, s thp phn, s o, s phc, cn s m ch thc hin ch yu 3 php tnh ton c bn sau: Php OR Php AND Php ph nh NOT Cc php tnh trn khi p dng cho logic 0 v 1:

2.1.2 THIT LP BIU THC LOGIC Lp hm logic cho tng cng ta bit cho bt c kt ni no ca cc cng. T biu thc bit c ta c th tnh logic ra tng ng vi mt t hp logic vo, v lp bng s tht ca cc ng vo (bin s) v ng ra (hm). tnh logic ra tng ng vi mt t hp logic v ta thng l tnh thng trn mch. V d:

32

V d vi mch trn vi 4 ng vo nn ta c tng cng 16 t hp vo nn ta phi tnh 16 trng thi ra khc nhau mi lp c bng s tht (Truth Table). 2.1.3 THC HIN MCH T BIU THC LOGIC Ngc li vi vit biu thc t mch l thc hin mch t biu thc logic. V d cho biu thc logic cho l: nhn vo biu thc ta thy ng ra l OR

ca 3 s hng nn ta thc hin mi s hng Y trc. Vi s hng u ta dng AND, s hng th 2 ta O C sau AND vi B, s hng th 3 ta cng thc hin tng t , sau cng ta OR 3 ba s hng li.

2.2 CC NH L I S BOOLE Mt bin s

33

Giao hon

Phi hp

Phn phi

Mt s ng thc hu dng

nh l De Morgan

34

Cc nh l ca i s Boole c chng minh hay kim chng bng nhiu cch. Cc cch chng minh hay kim chng ny tng i n gin, ngi c c th t chng minh hay kim chng. V d 1: Thit k mch dng hai cng logic tha bng s tht sau y

Gii: V ng ra bng 0 ch mt trng hp nn ta vit h thc logic trng hp ny. Y= 0 khi A= 0 V B = 1 nn . c Y ta o , nn . Mch v B (hnh

thc hin cng NOT to ra A o, tip theo l cng NAND ca 1.30a)

Mt khc ta c th da vo bng s tht d vit hm logic cho Y v kt qu l: s dng cc nh l ca i s Boole ta bin i v c kt qu cui cng l V d 2: Chng t Gii: (hnh 1.30b). .

Vn dng cc cng thc ta d dang bin i c:

Mt cch chng minh khc l ta c th dng bng s tht chng minh biu thc trn.

35
2.3 S CHUYN I GIA CC LOI CNG LOGIC Cc cng logic c th chuyn di qua li ln nhau t cng ny thnh cng khc. thun tin cho vic thit k mch logic nn phi chuyn i gia cc cng vi nhau, ch yu l chuyn i AND thnh OR v ngc li, chuyn i AND OR thnh NAND NAND. a s cc bi ton thit k logic u yu cu s dng cng NAND(vic ch to cng NAND n gin hn cc cng khc). thun li cho vic chuyn i cn phi nm vng cc nh l ca i s Boole v c bit l nh l De Morgan. Sau y l mt s chuyn i gia cc cng vi nhau:

36

2.4 P DNG CC NH L I S BOOLE RT GN BIU THC LOGIC Cc nh l Boole gip n gin cc biu thc logic. Vic n gin l cn thit mch thit k thc hin n gin v kinh t hn. Rt gn biu thc l vn dng cc nh l t hm mt bin cho n hm nhiu bin v nhng ng thc hu dng. t bit l hai nh l De Morgan gip ch cho rt nhiu trong vic rt gn biu thc logic v cng l cng c chnh chuyn i cc dng mch. vic rt gn biu thc logic v chuyn i mch d dng cn phi nm vng cc nh l ca i s Boole v phi thng tho chuyn i gia cc cng logic.

37
V d 3: Rt gn cc biu thc sau:

V d 4: n gin hm Gii:

Ngoi vic rt gn biu thc logic bng i s boole, cn s dng i s boole n gin mch logic. n gin mch logic ta lm cc bc sau: - T mch logic xc nh biu thc cho ng ra ca mch - Sau khi xc nh c hm ng ra, tin hnh rt gn biu thc bng cch dng cc nh l ca i s boole, c bit l s dng nh l De Morgan. - Sau khi c biu thc mi, chng ta c c mch logic mi tng ng vi mch logic cho. V d 5: n gin mch hnh 1.32 (a)

38

Gii: Trc tin ta vit biu thc logic cho ng ra:

Rt gn biu thc ta c:

T biu thc va rt gn c ta thnh lp c mch logic mi nh hnh 1.32b.

Bi 2:I S BOOLE V NG DNG


Trang 2
2.5 THIT K LOGIC T HP Khi lm mt bi ton thit k logic t hp ta cn thc hin ng cc bc sau y: Bc 1: Da vo yu cu ca bi ton t ra, chng ta t cc bin cho ng vo v cc hm ca ng ra tng ng. Bc 2: Thit lp bng s tht cho ng ra v ng vo theo yu cu ca bi ton Bc 3: T bng s tht vit ra biu thc m t s lin h logic gia ng ra v cc ng vo.

39
C hai cch vit biu thc logic cho ng ra, hoc cho trng hp logic ra bng 1, hoc cho trng hp logic bng 0 (hai trng hp ny l tng ng nhau). Cch vit biu thc thng dng tng-cc-tch v tch-cc-tng. Bc 4: p dng cc nh l ca i s boole rt gn biu thc logic ng ra. Sau chuyn sang dng logic khc thun li hn cho vic thc hin mch logic. Bc 5: T biu thc logic rt gn c ta chuyn sang mch logic tng ng. V d 6: Mt ngi nh c 3 cng tc, ngi ch nh mun bng n sng khi c 3 cng tc u h, hoc khi cng tc 1 v 2 ng cn cng tc th 3 h. Hy thit k mch logic thc hin sao cho: a. S cng l t nht. b. Ch dng mt cng NAND 2 ng vo. Gii: Bc 1: Gi 3 cng tc ln lt l A, B, C. Bng n l Y. Trng thi cng tc ng l logic 1, h l 0. Trng thi n sng l logic 1 v tt l 0. Bc 2: T yu cu bi ton ta c bng s tht:

Bc 3: T bng s tht,ta vit biu thc ng ra theo trng hp logic 1 v ng ra logic 1 xut hin t nht, nh vy biu thc tnh ton s n gin hn nhiu. Biu thc logic ng ra

40
Nu khng rt gn biu thc logic ta thc hin mch logic th s cng logic s dng s rt nhiu hnh 1.33 (b). Bc 4: Rt gn biu thc logic:

n y th ta thy rng biu thc logic gn v s cng logic s dng l t nht. Bc 5: Mch logic tng ng ca biu thc: hnh 1.33 a

b. bin i mch logic ch s dng mt loi cng NAND 2 ng vo. Xut pht t biu thc ban u, ta s dng nh l De Morgan bin i.

Ly o ca Y ta c:

Khng khai trin

v l mt cng NAND. Biu thc cn dng tng nn ta

o mt ln na, ta c:

41
n y ta thy rng tha s trong ngoc cha NAND c vi C nn ta cn o hai ln na c kt qu tt c u l cng NAND 2 ng vo:

T biu thc trn ta c s mch logic hnh 1.34

2.6 NGHA CA K HIU LOGIC. Mch logic (mch s) nhn d liu cc ng vo v xut d liu ng ra. D liu l tn hiu nh phn ch gm hai mc: mc cao (logic 1) hoc mc thp (logic 0). thun li cho vic thit k mch logic. Khi khng c vng trn nh ng vo hay ng ra trn k hiu mch logic, ng gi l kch hot (tch cc) mc cao (active-HIGH). Cn nu c vng trn nh ng vo hay ng ra, ng gi l kch hot mc thp (activeLOW). S c mt hay vng mt ca vng trn s quyt nh trng thi kch hot mc cao/kch hot mc thp ca u ra hay u vo, n cng c dng gii thch hot ng ca mch. Sau y l minh ha bng cng NAND (hnh 1.35).

42

Trn k hiu ny (hnh 1.35 (a)) c vng trn u ra, nhng khng c vng trn u vo. V vy u ra tch cc mc thp v u vo kch hot mc cao. Trn k hiu hnh 1.35 (b) c u ra kch hot mc cao v cc u vo kch hot mc thp. V sao chng ta phi tm hiu ngha ca k hiu logic? L do l chng ta s s dng k hiu thay th ny biu v v phn tch logic theo dng tc ng kch hot v cch thay th k hiu logic nh sau: c k hiu thay th cho mt cng logic, ta hy ly k hiu chun ri thay i k hiu i s ca n (OR thnh AND, hoc AND thnh OR ), v i vng trn trn c hai u vo ln u ra. gii thch hot ng ca mt cng logic, ta cn ch trng thi logic no, 0 hay 1, l trng thi kch hot ca u vo v u ra. V du 7: Cho ng ra ca mch nh hnh 1.36 a, v li mch m t ng ra tc ng mc thp. Gii: V ng ra tc ng mc thp nn thm vng trn ph nh. Do i OR thnh AND vi cc vng trn ph nh ng vo. Theo quy lut ta thm vng trn ph nh cho ng ra ca cng OR v NAND cn cng NOT th khng v c vng trn ph nh. Tip theo chuyn i cng OR v NAND m bo logic (hnh 1.36 b).

43

Bi 3:VI MCH S H TTL


Trang 1
Trc khi i vo cu trc ca mch TTL c bn, xt mt s mch in cng c kh nng thc hin chc nng logic nh cc cng logic trong vi mch TTL:

44
Mch hnh 1.46 hot ng nh mt cng AND. Tht vy, ch khi c hai u A v B u ni vi ngun, tc l mc cao, th c hai diode s ngt, do p u ra Y s phi mc cao. Ngc li, khi c bt c mt u vo no thp th s c diode dn, p trn diode cn 0,6 hay 0,7V do ng ra Y s mc thp. Tip theo l mt mch thc hin chc nng ca mt cng logic bng cch s dng trng thi ngt dn ca transistor (hnh 1.47). Hai ng vo l A v B, ng ra l Y. Phn cc t hai u A, B Q hot ng trng thi ngt v dn bo ho Cho A = 0, B = 0 Q ngt, Y = 1 A = 0, B = 1 Q dn bo ho, Y = 0 A = 1, B = 0 Q dn bo ho, Y = 0 A = 1, B = 1 Q dn bo ho, Y = 0 C th tm tt li hot ng ca mch qua bng di y

Nghim li thy mch thc hin chc nng nh mt cng logic NOR V c cu to ng vo l in tr, ng ra l transistor nn mch NOR trn c xp vo dng mch RTL Vi hnh trn, nu mch ch c mt ng vo A th khi ny s c cng NOT, cn khi thm mt tng transistor trc ng ra th s c cng OR By gi c cng logic loi DTL, ta thay hai R bng hai diode ng vo (hnh 1.48) Khi A thp, B thp hay c 2 thp th diode dn lm transistor ngt do ng ra Y cao. Khi A v B cao th c hai diode ngt => Q dn => y ra thp R rng y l 1 cng NAND dng DTL (diode u vo v transistor u ra)

45
Cc mch RTL, DTL trn u c kh nng thc hin chc nng logic nhng ch c s dng dng n l khng c tch hp thnh IC chuyn dng bi v ngoi chc nng logic cn phi m bo ngi ta cn quan tm ti cc yu t khc nh : Tc chuyn mch (mch chuyn mch nhanh v hot ng c tn s cao khng). Tn hao nng lng khi mch hot ng (mch nng, tiu tn mt nng lng di dng nhit). Kh nng giao tip v thc ti, thc mch khc. Kh nng chng cc loi nhiu khng mong mun xm nhp vo mch, lm sai mc logic. Chnh v th mch TTL ra i, thay th cho cc mch loi RTL, DTL. Mch TTL ngoi transistor ng ra nh cc mch trc th n cn s dng c cc transistor u vo, thm mt s cch ni c bit khc, nh m bo c nhiu yu t ra. Hnh 1.49 l cu trc ca mt mch logic TTL c bn :

Mch ny hot ng nh mt cng NAND. Hai ng vo l A v B c t cc pht ca transistor Q1 (y l transistor c nhiu cc pht c cu trc mch tng ng nh hnh bn ) Hai diode mc ngc t 2 ng vo xung mass dng gii hn xung m ng vo, nu c, gip bo v cc mi ni BE ca Q1 Ng ra ca cng NAND c ly ra gia 2 transistor Q3 v Q4, sau diode D0

46
Q4 v D0 c thm vo hn dng cho Q3 khi n dn bo ho ng thi gim mt mt nng lng to ra trn R4 (trng hp khng c Q4,D0) khi Q3 dn. in p cp cho mch ny cng nh cc mch TTL khc thng lun chun l 5V Mch hot ng nh sau : Khi A thp, B thp hay c A v B thp Q1 dn in; phn cc mch p st trn Q1 nh sao cho Q2 khng dn; ko theo Q3 ngt. Nh vy nu c ti ngoi th dng s i qua Q4, D0 ra ti xung mass. Dng ny gi l dng ra mc cao k hiu l IOH Gi s ti l mt in tr 3k9 th dng l:

Khi c A v B u cao, nn khng th c dng ra A v B c, dng t ngun V cc s qua R1, mi ni BC ca Q1 thc vo cc B lm Q2 dn bo ha. Nu mc ti t ngun Vcc ti ng ra Y th dng s qua ti, qua Q3 lm n dn bo ho lun. Ng ra s mc thp v p ra chnh l p VCE ca Q3 khong 0,2 n 0,5V tu dng qua ti. Khi ny ta c dng ra mc thp k hiu l IOL. S d gi l dng ra v dng sinh ra khi cng logic mc thp (mc d dng ny l dng chy vo trong cng logic) V d nu ti l 470 ohm th dng IOL khi ny l:

Vy mch logic trn c chc nng hot ng nh 1 cng NAND 2 ng vo Nu h hai ng vo A v B th Q1 vn ngt, Q2 vn dn, ko theo Q3 dn khi c ti ngoi tc l ng ra Y vn cao, do ging nh trng hp ng A v B ni ln mc cao. Nu A v B ni chung vi nhau hay Q1 ch c 1 cc pht th mch NAND chuyn thnh mch NOT Vic sp xp th t Rc, Q4, D0, Q3 thnh hnh ct ging nh hnh ct chm-totem pole-hnh t vt ca ngi M da nn dng mch ny c gi l mch logic ng ra ct chm, cu trc ca cc loi cng logic khc nh and, or, exor cng ging

47
nh vy. Tuy vy ta cng s gp cc mch logic c ng ra kiu khc nh mch ng ra cc thu h, ng ra ba trng thi. Nhng mch ny ta s tm hiu phn sau. Ring i vi mch loi ny, khi ng ra chuyn tip trng thi t thp ln cao c th xy ra trng hp c Q3 v Q4 cng dn (Q3 cha kp tt). iu ny lm cho dng b ht t ngun ln hn hn v c th lm st p ngun trong vi ns. Vn ny ta cng s ni k hn bi s dng cng logic. Mch ng ra ct chm thuc loi mch ra ko ln tch cc (active pull up) tc l ng ra c cp ngun thng qua Q4 (linh kin in t tch cc). Cn cc mch khc nh RTL, DTL ng ra c cp in thng qua R (linh kin in t th ng) tng tc chuyn mch cao hn hn loi trn, mt s ci tin mi v cng ngh mi c thm vo Diode thng c c thay th bi diode schottky. Cu trc lp tip xc loi ny l Si_Al (cht bn dn loi p). p ngng ch cn 0,35V. K hiu ca diode nh

Tip n, transistor c mc thm diode schottky gia cc nn v cc thu nh hnh. k hiu ca transistor s nh hnh trn. Khi ny thay v dn bo ho, transistor s ch dn gn bo ho do diode dn khong 0,3V ri. iu ny c ngha l transistor s chuyn mch nhanh hn. QUY M TCH HP Cc mch cng logic nh trn c tch hp li thnh mt mch t hp bn dn rt rt nh v c t vo gia mt v bc, c dy kim loi ni ra ngoi cc chn.

48
Thng th vi mch cng nand nh trn s c bn mch nh th c tch hp trong mt v bc, chng thuc loi tch hp c nh: small scale integration (SSI), mt s IC c bit c s cng ln hn mt cht hay quy m phc tp hn nn thuc loi tch hp c va: medium scale integration (MSI). Khi nm trong IC tch hp, s sp xp mch v cc chn ra vo cho loi cng chun ny (v d vi loi cng nand) s l:

C nhiu mch khc s tch hp nhiu cng hn v tt nhin thnh phn chnh ca nhng mch ny s l cc transistor v quy m tch hp c th t hng trm n hng trm triu transistor trn mt phin bn dn, ch c t trong mt v bc khng ln qu vi xen ti mt vung. Chng hn Cc mch chuyn i m, dn tch knh, mch logic v s hc m chng ta s tm hiu phn sau thuc loi tch hp c va, mt s l loi tch hp c ln : large scale integration (LSI) v cu trc mch gm khong t 12 n 100 cng c bn (MSI) hay 100 n 1000 cng c bn (LSI) Cc mch nh, vi iu khin, vi x l, lp trnh c th tch hp t hng ngn n hng triu cng logic trong n v c xp vo loi tch hp c rt ln (VLSI) siu ln (ULSI).

49

Bi4: VI MCH S H CMOS


Cng ngh MOS (Metal Oxide Semiconductor-kim loi oxit bn dn) c tn gi xut x t cu trc MOS c bn ca mt in cc nm trn lp oxit cch nhit, di lp oxit l bn dn. Transistor trong cng ngh MOS l transistor hiu ng trng, gi l MOSFET (metal oxide silicon field effect transistor). C ngha in trng pha in cc kim loi ca lp oxit cch nhit c nh hng n in tr ca . Phn nhiu IC s MOS c thit k ht bng MOSFET, khng cn n linh kin no khc. u im chnh ca MOSFET l d ch to, ph tn thp, c nh, tiu hao rt t in nng. K thut lm IC MOS ch rc ri bng 1/3 k thut lm IC lng cc (TTL, ECL,...). Thm vo , thit b MOS chim t ch trn chip hn so vi BJT, thng thng, mi MOSFET ch cn 1 mi li vung din tch chip, trong khi BJT i hi khong 50 mi li vung. Quan trng hn, IC s MOS thng khng dng cc thnh phn in tr trong IC, vn chim qu nhiu din tch chip trong IC

50

lng cc. V vy, IC MOS c th dung np nhiu phn t mch trn 1 chip n hn so vi IC lng cc. Bng chng l ta s thy MOS dng nhiu trong vi mch tch hp c LSI, VLSI hn hn TTL. Mt tch hp cao ca IC MOS lm chng c bit thch hp cho cc IC phc tp, nh chip vi x l v chip nh. Sa i trong cng ngh IC MOS cho ra nhng thit b nhanh hn 74, 74LS ca TTL, vi c im iu khin dng gn nh nhau. Do vy, thit b MOS c bit l CMOS c s dng kh rng ri trong mch MSI mc d tc c thua cc IC TTL cao cp v d b h hng do b tnh in. Mch s dng MOSFET c chia thnh 3 nhm l: - PMOS dng MOSFET knh P - NMOS dng MOSFET knh N tng cng - CMOS (MOS b) dng c 2 thit b knh P v knh N Cc IC s PMOS v NMOS c mt ng gi ln hn (nhiu transistor trong 1 chip hn) v do kinh t hn CMOS. NMOS c mt ng gi gn gp i PMOS. Ngoi ra, NMOS cng nhanh gn gp 2 ln PMOS, nh d kin cc in t t do l nhng ht ti dng trong NMOS, cn cc l trng (in tch dng chuyn ng chm hn) l ht ti dng cho PMOS. CMOS rc ri nht v c mt ng gi thp nht trong cc h MOS, nhng n c im mnh l tc cao hn v cng sut tiu th thp hn. IC NMOS v CMOS c dng rng ri trong lnh vc k thut s, nhng IC PMOS khng cn gp mt trong cc thit k mi na. Tuy nhin MOSFET knh P vn rt quan trng bi v chng c dng trong mch CMOS. Trc khi i vo cng ngh CMOS ta hy tm hiu qua v NMOS. Cng cn phi bit rng PMOS tng ng cng ging ht NMOS, ch khc chiu in p. Hnh 1.64 l cu to ca 1 cng NOT loi NMOS c bn

51

Mch gm 2 MOSFET: Q2 lm chuyn mch cn Q1 lm ti c nh v lun dn, in tr ca Q1 khong 100 k Ng vo mch t cc G ca Q2, cn ng ra ly im chung ca cc S Q1 v cc D Q2. Ngun phn cc cho mch gi s dng 5V. Khi Vin = 5 V, ng vo mc cao kch cho Q2 dn, tr trn Q2 cn khong 1K cu phn p gia RQ1 v RQ2 cho php p ra cn khong 0,05V tc l ng ra mc thp Khi Vin = 0V, ng vo mc thp, Q2 ngt, tr trn n kh ln khong 1010 ohm. Cu phn p RQ1 v RQ2 s t p ng ra xp x ngun, tc l ng ra mc cao. Vy mch hot ng nh mt cng NOT. Cng NOT c xem l mch c bn nht ca cng ngh MOS. Nu ta thm Q3 mc ni tip v ging vi Q2 th s c cng NAND. Nu ta mc Q3 song song v ging vi Q2 th s c cng NOR. Cng AND v cng OR c to ra bng cch thm cng NOT ng ra ca cng NAND v cng NOR va c to ra. Nh ni trc, NMOS khng phi to ra cc cng m thng dng xy dng mch t hp, mch tun t quy m thng c MSI tr ln, nhng tt c nhng mch v c bn vn ch l t hp ca cc mch cng logic c k ra y.

52

Mt s c im ca NMOS : Tc chuyn mch: chm hn so vi loi TTL do in tr u vo kh cao ng thi b nh hng bi ti dung tnh m n thc Gii hn nhiu khong 1,5V vi ngun 5V v s tng t l khi ngun cp tng. Nh vy l tnh khng nhiu km hn TTL H s ti: v l thuyt l rt ln do tr u vo ca mch rt ln, tuy nhin, nu tn s hot ng cng cao (trn 100KHz) th in dung sinh ra c th lm suy gim thi gian chuyn mch ko theo gim kh nng giao tip ti. So vi TTL th NMOS vn c h s ti cao hn hn trung bnh l 50 cng cng loi. Cng sut tiu tn: y l u im ni bt ca logic MOS. Tht vy, chng hn vi cng NOT trn khi u vo thp RQ1 = 100k, RQ2 = 1010ohm nn dng tiu th I = V/R = 0,5nA => P =U.I = 2,5nW Khi u vo cao RQ1 = 100k, RQ2 1k nn dng tiu th I = V/R = 50uA 0,25mW Vy cng sut trung bnh ch cao hn 0,1 mW mt cht, so vi TTL th n qu nh. Chnh nh u im ny m CMOS c th tch hp c LSI v VLSI, ni m nhiu cng, nhiu flip flop, nhiu mch khc c tch hp trong mt chp m khng sinh ra nhit ln lm hng chip. Cng cn lu l logic MOS do u c xy dng t cc transistor MOSFET nn rt nhy tnh in, phn sau ta s cp chi tit n vn ny.

CMOS
2.1 Cu to

53

CMOS (Complementary MOS) c cu to kt hp c PMOS v NMOS trong cng 1 mch nh tn dng c cc th mnh ca c 2 loi, ni chung l nhanh hn ng thi mt mt nng lng cn thp hn so vi khi dng ri tng loi mt. Cu to c bn nht ca CMOS cng l mt cng NOT gm mt transistor NMOS v mt transistor PMOS nh hnh 1.65

Hot ng ca mch cng tng t nh NMOS Khi ng vo (ni chung cc cng 2 transistor) cao th ch c Q1 dn mnh do p ra ly t im chung ca 2 cc mng ca 2 transistor s xp x 0V nn ng ra thp. Khi ng vo thp Q1 s ngt cn Q2 dn mnh, p ra xp x ngun, tc ng ra mc cao. l khc vi cng NOT ca NMOS, y 2 transistor khng dn cng mt lc nn khng c dng in t ngun qua 2 transistor xung mass nh cng sut tiu tn gn nh bng 0. Tuy nhin khi 2 transistor ang chuyn mch v khi c ti th s c dng in chy qua mt hay c 2 transistor nn khi ny cng sut tiu tn li tng ln. Trn nguyn tc cng o, cng ging nh trc bng cch mc song song hay ni tip thm transistor ta c th thc hin c cc cng

54

logic khc (hnh 1.66). Chng hn mc chng 2 NMOS v mc song song 2 PMOS ta c cng NAND. Cn khi mc chng 2 PMOS v mc song song 2 NMOS ta c cng NOR.

2.2 Phn loi

C nhiu loi IC logic CMOS vi cch ng v (package) v chn ra ging nh cc IC loi TTL. Cc IC c quy m tch hp nh SSI v DIP (dual inline package): vi hai hng chn thng hng 14 hay 16 c dng ph bin. CMOS c h 4000, 4500 Hng RCA ca M cho ra i loi CMOS u tin ly tn CD4000A. V sau RCA c ci tin cho ra lot CD4000B c thm tng m ra, sau ny hng li b sung thm lot CD4500, CD4700. Hng Motorola (M) sau cng cho ra lot CMOS MC14000, MC14000B, MC14500 tng thch vi sn phm c ca RCA. c im chung ca lot ny l :

in p ngun cung cp t 3V n 18V m thng nht l t 5 n 15 V.

55

Chng c cng sut tiu hao nh Ring loi 4000B do c thm tng m ra nn dng ra ln hn, khng nhiu tt hn m tc cng nhanh hn loi 4000A trc .

Tuy nhin cc loi trn v tc th t ra kh chm chp v dng cng nh hn nhiu so vi cc loi TTL v CMOS khc. Chnh v vy chng khng c s dng rng ri cc thit k hin i. Loi 74CXX

y l loi CMOS c sn xut ra tng thch vi cc loi TTL v nhiu mt nh chc nng, chn ra nhng khon ngun nui th rng hn. Cc c tnh ca loi ny tt hn loi CMOS trc mt cht tuy nhin n li t c s dng do c nhiu loi CMOS sau thay th loi CMOS tc cao 74HCXX v 74HCTXX. y l 2 loi CMOS c pht trin t 74CXX. 74HCXX c dng ra ln v tc nhanh hn hn 74CXX, tc ca n tng ng vi loi 74LSXX, nhng cng sut tiu tn th thp hn. Ngun cho n l t 2V n 6V. Cn 74HCTXX chnh l 74HCXX nhng tng thch vi TTL nhiu hn nh ngun vo gn ging TTL : 4,5V n 5,5V. Do 74HCTXX c th thay th trc tip cho 74LSXX v giao tip vi cc loi TTL rt bnh thng. Ngy nay 74HC v 74HCT tr thnh loi CMOS hay dng nht m li c th thay th trc tip cho loi TTL thng dng. Loi CMOS tin tin 74AC, 74ACT Loi ny c ch to ra c nhiu ci tin cng ging nh bn TTL, n s hn hn cc loi trc nhng vic s dng cn hn ch cng vn l do gi thnh cn cao.

56

Chng hn cu trc mch v chn ra c sp xp hp l gip gim nhng nh hng gia cc ng tn hiu vo ra do chn ra ca 2 loi ny khc vi chn ra ca TTL. Khng nhiu, tr hon truyn, tc ng h ti a u hn hn loi 74HC, 74HCT. K hiu ca chng hi khc mt cht nh 74AC11004 l tng ng vi 74HC04. 74ACT11293 l tng ng vi 74HCT293. Loi CMOS tc cao FACT y l sn phm ca hng Fairchild, loi ny c tnh nng tri hn cc sn phm tng ng c. Loi CMOS tc cao tin tin 74AHC, 74AHCT y l sn phm mi c nhng ci tin t loi 74HC v 74HCT, chng tn dng c c 2 u im ln nht ca TTL l tc cao v ca CMOS l tiu tn thp do c th thay th trc tip cho 74HC v 74HCT. Bng sau cho php so snh cng sut tiu tn v tr hon truyn ca cc loi TTL v CMOS ngun cp in 5V.

57

Ngoi cc loi trn cng ngh CMOS cng pht trin mt s loi mi gm: BiCMOS y l sn phm kt hp cng ngh lng cc TTL vi cng ngh CMOS nh tn dng c c 2 u im ca 2 cng ngh l tc nhanh v cng sut tiu tn thp. N gim c 75% cng sut tiu tn so vi loi 74F trong lc vn gi c tc v c im iu khin tng ng. N cng c chn ra tng thch vi TTL v hot ng p ngun 5V. Tuy nhin Bi CMOS thng ch c tch hp quy m va v ln dng nhiu trong giao din vi x l v b nh, nh mch cht, b m, b iu khin hay b thu pht. Loi CMOS in th thp y l loi CMOS kh c bit c p ngun gim xung ch cn khong 3V. Khi p gim s ko theo gim cng sut tiu tn bn trong mch nh mt tch hp ca mch tng ln, ri tc chuyn mch cng tng ln iu ny rt cn thit trong cc b vi x l b nh ... vi quy m tch hp VLSI. Cng c kh nhiu loi CMOS p thp, v y l xu hng ca mai sau, y ch ni qua v mt s loi ca hng Texas Instruments 74LV (low voltage) : l lot CMOS in th thp tng ng vi cc vi mch s SSI v MSI ca cc cng ngh khc. N ch hot ng c vi cc vi mch 3,3V khc 74LVC (low voltage CMOS ) : gm rt nhiu mch SSI v MSI nh lot 74. N c th nhn mc 5V cc ng vo nn c th dng chuyn i cc h thng dng 5V sang dng 3,3V khc. Nu gi dng in ng ra thp in th ng ra nm trong 1 gii hn cho php, n cng c th giao tip vi cc ng vo TTL 5V. Tuy nhin p vo cao ca cc CMOS 5V nh 74HC hay 74AHC khin chng khng th iu khin t cc vi mch LVC

58

74ALVC (advanced low voltage CMOS ) : l lot CMOS in th thp, ch yu dng cho cc mch giao din bus hot ng 3,3V 74LVT (low voltage BiCMOS) : ging nh 74LVC c th hot ng logic 5V v c th dng nh mch s chuyn mc 5V sang 3V Bng sau so snh mt s c tnh ca cc loi CMOS p thp

CMOS cc mng h, CMOS ra 3 trng thi v CMOS ny schmitt trigger Tng t nh bn TTL, cc cng CMOS cng c cc loi ra h mng, ra 3 trng thi v ny schmitt trigger, v c nhiu loi CMOS c sn xut tng thch v thay th cho loi TTL tng ng. CMOS racc mng h Do dng MOSFET nn ng ra khng phi l cc thu m l cc mng hnh 1.67 trrnh by hai cng NOT CMOS thng c ng ra ni chung vi nhau

59

Nu 2 u vo cao th 2P ngt, 2N dn ng ra mc cao bnh thng. Nu 2 u vo thp th 2P dn, 2N ngt ng ra mc thp bnh thng. Nhng nu ng vo cng 1 thp cn ng vo cng 2 cao th P1 dn N1 ngt, P2 ngt N2 dn p ng ra s l na p ngun Vdd. p ny ri vo vng bt nh khng th dng kch cc ti c hn na vi p Vdd m cao, dng dn cao c th lm tiu 2 transistor ca cng. Vy cch cc D ra h l hp trong trng hp ny. Trong cu trc mch s khng cn MOSFET knh P na, cn MOSFET knh N s h cc mng D. Ta c th ni cc ng ra theo kiu ni AND hay OR v tt nhin l cng phi cn in tr ko ln to mc logic cao, gi tr ca R ko ln tnh ging nh bn mch loi TTL. CMOS ra 3 trng thi Tng t mch bn TTL, mch c thm ng iu khin G (hay C).

60

G cao 2 cng nand ni, nn Y = A, ta c cng m khng o G thp ng ra ca 2 cng nand ln cao lm PMOS v NMOS cng ngng dn v y l trng thi th 3 hay cn gi l trng thi tr khng cao (high Z), lc by gi t ng ra Y nhn ngc vo mch th mch nh khng c (in tr ng ra Y ln ngun v xung mass u rt ln). Ng G cng c th tc ng mc thp K hiu logic ca mch

Cng ny schmitt trigger tng t ny schmitt trigger bn mch TTL Cng truyn dn CMOS (transmission gate :TG)
y l loi cng logic m bn cng ngh lng cc khng c; cng truyn dn hot ng nh mt cng tc ng m (s) cho php d liu (dng s) truyn qua li theo c 2 chiu. Trc ht l cu to ca cng truyn NMOS

61
Tn hiu truyn c th l tng t hay s min nm trong khong 0 n Vdd. Nhng y d minh ho ta gi s ly ngun cp l 10V, p ngng ca NMOS s l 2V Khi ng vo thp, t s khng c np nn tt nhin ng ra cng l mc thp Khi ng vo cao m ng khin G vn thp th ng ra cng vn thp Khi ng vo cao v G cao => NMOS dn vi p ngng 2V nn t np y n 8V th NMOS ngt, ng ra c th hiu l mc cao, do tn hiu c truyn t tri sang phi Khi ny m ng vo xung mc thp th t s x qua NMOS do ng ra ln cao tr li tc l d liu truyn t phi sang tri Tuy nhin ta c nhn xt l, khi b truyn nh vy d liu gim bin i mt 2V. Vi mch s c th vn hiu l mc cao mc thp, cn vi mch tng t th nh vy l mt mt nng lng nhiu ri, v n cn b nh hng nng hn khi nhiu cng truyn mc ni tip nhau. Cng truyn CMOS : Hnh 1.70 cho thy cu trc ca 1 cng truyn CMOS c bn dng 1 NMOS v 1PMOS mc song song, cng vi nhng gi s nh trn bn s thy CMOS khc phc c im d ca NMOS v chnh n c s dng rng ri ngy nay.

62
Khi G thp, khng cho php truyn. Khi G cao, nu ng vo thp ng ra khng c g thay i. Cn nu ng vo cao th c 2 transistor u dn d liu truyn t tri sang phi np cho t, ng ra mc cao nhng c 1 im khc y l khi t np n 8V th NMOS ngt trong khi PMOS vn dn mnh lm t np 10V. Khi ng ra ang 10V, ng G vn cao m ng vo xung thp th t s x ngc tr li qua 2 transistor lm ng vo ln cao tr li. Cc k hiu cho cng truyn nh hnh

2.3 c tnh k thut

Cng sut tiu tn Khi mch CMOS trng thi tnh (khng chuyn mch) th cng sut tiu tn PD ca mch rt nh. C th thy iu ny khi phn tch mch mch cng nand hay nor trc. Vi ngun 5V, PD ca mi cng ch khong 2,5nW. Tuy nhin PD s gia tng ng k khi cng CMOS phi chuyn mch nhanh. Chng hn tn s chuyn mch l 100KHz th PD l 10 nW, cn f=1MHz th PD= 0,1mW. n tn s c 2 hay 3 MHz l PD ca CMOS tng ng vi PD ca 74LS bn TTL, tc l mt dn i u th ca mnh. L do c iu ny l v khi chuyn mch c 2 transistor u dn khin dng b ht mnh cp cho ph ti l cc in dung (sinh ra cc xung nhn lm bin ca dng b y ln c khi c 5mA v thi gian tn ti khong 20 n 30 ns). Tn s chuyn mch cng ln th

63

sinh ra nhiu xung nhn lm I cng tng ko theo P tng theo. P y chnh l cng sut ng lu tr in dung ti. in dung y bao gm cc in dung u vo kt hp ca bt k ti no ang c kch thch v in dung u ra ring ca thit b.

Tc chuyn mch (tn s chuyn mch) Cng ging nh cc mch TTL, mch CMOS cng phi c tr hon truyn thc hin chuyn mch. Nu tr hon ny lm tPH bng na chu k tn hiu vo th dng song vung s tr thnh xung tam gic khin mch c th mt tc dng logic Tuy nhin tc chuyn mch ca CMOS th nhanh hn hn loi TTL do in tr u ra thp mi trng thi. Tc chuyn mch s tng ln khi tng ngun nhng iu ny cng s lm tng cng sut tiu tn, ngoi ra n cng cn nh hng bi ti in dung. Gii hn tc chuyn mch cho php lm nn tn s chuyn mch ti a c tnh da trn tPH. Bng sau cho php so snh fmax ca mt s loi cng nand loi TTL vi CMOS

64

Trong vic s dng cc IC logic CMOS ta phi bit nhiu c tnh v gii hn ca chng. Cc c tnh thng dng nh p nui, s to ra, kh nng dng ra,... thng d vn dng. Tt c cc IC logic u dng c ngun nui 5V. S to ra vi cng loi logic t nht l gn chc trong lc thng ch cn vi. Tuy nhin i khi c nghi ng hay s dng trng hp p cp Vmax, fmax, ti thun dung thun cm... hay giao tip gia cc IC khc loi, khc p ngun, ni chung l cc trng hp c bit. th ta phi tham kho ti liu data sheet hay data book. Cng nh bn TTL, mt s c tnh chnh ca CMOS c ni n y l: p ngun nui k hiu l Vdd (khc vi bn TTL k hiu l Vcc) rt khc nhau do cn rt cn thn vi n, c th dng ngun 5V l tt nht. Bng sau a ra cc khong p ngun cho tng loi CMOS.

in p vo v ra ca cc loi CMOS Cng ging nh bn TTL v k hiu, tn gi nhng bn CMOS c phc tp hn do ngun nui cho cc loi IC th khc nhau, ta ch c th rt ra tng i iu kin ngun Vdd = 5V. Hnh v bng di nu ra cc thng s p ra v vo. Ring loi 74HCT l CMOS tc cao tng thch vi TTL nn thng s cng ging nh bn TTL.

65

Dng in ng vo v ng ra bng so snh dng vo ra ca mt s loi CMOS vi mt s loi TTL

Ni chung ta quan tm n dng ra nhiu hn v l dng ra max cho php m vn m bo cc mc logic ra ng nh phn trn. Cn cc p ra cng ch quan tm khi tnh n vic giao tip cng khc loi khc p nui. H s ti

66

Dng ra ca cc CMOS kh ln trong lc in tr vo ca cc CMOS li rt ln (thng khong 1012 ohm) tc dng vo rt rt nh nn s to ra rt ln. Nhng mi cng CMOS c in dung ng vo thng cng khong 5pF nn khi c nhiu cng ti mc song song s in dung tng ln lm tc chuyn mch chm li khin s to ra tn s thp (di 1MHz) l vi chc, cn tn s cao s to ra gim ch cn di 10. Tnh khng nhiu V c tnh chuyn (trng thi) ni chung cc loi CMOS u chuyn trng thi kh dt khot tr loi 4000A bi v chng c tng m trc ng ra V gii hn nhiu ni chung l tt hn cc loi TTL. Tt nht l loi 4000A,B. Gii hn nhiu s cn tt hn nu ta tng ngun nui ln hn 5V, tuy nhin lc ny tn hao cng v th tng theo. Cch tnh l nhiu mc cao v mc thp vn nh trc, tc l: VNH = VOH(min) VIH(min) VNL = VIL(max) VIH(max) CC IC CNG LOGIC C rt nhiu IC loi CMOS c m s v chc nng logic tng t nh cc IC TTL chng hn bn TTL IC 4 cng nand 2 ng vo l 7400, 74LS00, 74AS00,... th bn CMOS cng tng t c 74C00, 74HC/HCT00, 74AC11000,... Tuy nhin khng phi tt c bn TTL c th bn CMOS cng c. CMOS cng cn c nhng loi ring, chng hn vi cng ny schmitt trigger ngoi 74HC/HCT14 gm 6 cng o, 74HC/HCT132 gm 4 cng nand 2 ng vo cn c 4014, 4534 cng gm 6 cng o, 4093 cng gm 4 cng nand 2 ng vo; hay 4066 l cng truyn 2 chiu s tng t vv...

67

Hnh 1.74 l s chn ra ca mt s cng logic loi 4000 cng hay dng

Bi 5:S DNG CNG LOGIC


1.1 Chng xung nhn cho ngun cp

Hy tr li xem xt cu trc ca mt cng logic loi ct chm nh hnh 1.75. Ng ra Y gi s ang i trng thi t thp ln cao do Q3 s chuyn trng thi t ngt dn ang dn bo ho cn Q4 th t dn bo ho sang ngng dn. Q4 s cn mt khong thi gian vi chc ns ngng ch dn bo ho trc , trong thi gian ny Q3 cng dn lun nh th dng ngun cp tng ln vi mA. Gi s

68

trong 1 h thng mch ang s dng nhiu cng logic ang chuyn trng thi nh vy th r rng ngun cp phi ln hn na, n ko theo p ngun c th b gim xung trong chc lt, hn na in cm phn tn trn ng tip in c th cn lm gim ngun hn na (in cm k sinh). Do ngun thay i dn n pht sinh dng cm ng L(di/dt).

Hnh 1.75 Minh ha cch chng xung nhn ca 1 cng logic loi ct chm Nh vy ngun b bin ng nhiu va b st gim tht thng va c xung nhn cm ng dn n trng thi logic ca mch b sai. Hot ng chuyn mch nhiu th tn s pht sinh xung nhn cng ln. khc phc hin tng ny c th mc t ceramic 0,01 uF ti 0,1 uF c in cm thp ngay ti ng vo cp in cho IC xung mass n lc bt xung nhn sinh ra. Ngoi ra c th dng thm t tt nh tantan, mylar ... vi uF ti vi chc uF u mi ngun cp cho khi mch n nh p ngun.

69
1.2 Gii quyt ng vo khng dng

Ta c bit n cu trc ca nhiu cng logic loi TTL c nhiu ng vo khi khng dng th tng ng vi ni ln ngun v c 2 trng hp ni nn pht ca transistor, ng vo u khng dn. Tuy nhin mt ng vo ni nh vy d tip nhn cc nhiu in t bn ngoi hoc nh vi cng TTL d ng khng dng trng th transistor trong mch vn c phn cc do s tiu tn nng lng v ch m li c th lm nng cng logic v vy ta nn ni ln cao hay xung mass tu loi cng. Gii quyt cc ng vo khng dng cng and, nand Ni ln Vcc hay qua 1 in tr 1-10K nhm gii hn dng in ngc vo transistor nht l khi c xung nhn trn ng cp nh ni phn trn khi biu thc logic ng ra cng and (minh ho nh hnh 1.76) s l AB = AB khng c g thay i. Ni ng vo khng dng ti mt ng vo no c dng (chp chung 2 ng vo li vi nhau). Cch ni ny s lm tng in dung ng vo do vi tn s cao s sinh ra tr khng ln rt bt dng t cng. Cch ny khng nn dng vi h 74, 74LS,ALS, 74F.

Hnh 1.76 Cch ni ng vo khng dng Gii quyt cc ng vo khng dng cng or, nor Thay v ni ng khng dng ln Vcc ta ni n xung mass qua R khong di 1K, ng ny lun mc thp. Khi vi cng OR : 0 + A + B = A + B, ng khng dng khng nh hng ti hot ng logic ca cng. Cng c th ni ng khng dng chung vi ng c dng (chp chung 2 ng vo li vi nhau) ging nh vi cng and.

70
1.3 Trnh tnh in cho cng CMOS

Cc mch cng CMOS c cu to bi cc transistor MOSFET, chng c lp cch in SiO2 rt mng (khong 10 um) gia cc cng G v knh dn ni thot D v ngun. Ng vo ca mch CMOS gm in dung vi pF mc song song vi in tr rt ln nn khi c tnh in tc ng vo chng hn do tay ngi chm vo chn IC th dng tnh in s x theo ng ny vo to nn p cao hng ngn volt nh thng lp cch in mng manh. Mt mch bo v thng c thm vo n c diode ghim mc in p dng v m t vo lp cch in ny khi xy ra x tnh in. Thc t do iu kin nhit i nng m nc ta, IC cng t khi b h hng nhng nu c cng nn n mt s bin php m bo sau khi dng cng CMOS : - Khng IC ni m t, ct gi bng cch ct vo xp cch in hay t trong bao giy nhm - Nn cm lun IC vo mch khi dng khng nn chm tay vo chn IC, nu ng nn eo vng dn in x tnh in t ngi xung mass. trnh trng hp git in th vng nn c in tr hng Mega ohm cch li khi mass. - Nu dng m hn th tt hn ni t u m hn - Khi IC ang dng trong mch khng nn ng chm hay ly n ra khi mch. - m bo ngun nui IC nm trong khong cho php. - Cc ng vo khng dng phi ni mass hay Vdd qua in tr.

Bi 6:GIAO TIP TTL V CMOS 2.1 Giao tip gia cc cng logic vi nhau
2.1.1 Gia TTL vi TTL Do cng loi nn chng ng nhin c th mc ni trc tip vi nhau. Dng trung bnh m bo mc in p vo, ra mc cao hay thp cho php th: IOH = 400uA cn IIH = 40uA khi ra mc cao

71
IOL = 16mA cn IIL = 16mA khi ra mc thp Nh vy 1 cng TTL c th thc c khong di 10 cng logic cng loi. y ch xt tnh tng i do TTL c nhiu loi nn kh nng thc ti (tnh s to ra) cng khc nhau nh loi ALS c th thc c ti 20 cng 74ALS khc. bit chnh xc hn c th da vo thng s ca dng vo v ra ca IC trong s tay tra cu IC tnh ton 2.1.2 Gia TTL vi CMOS h 74HC, 74HCT mc thp TTL c th thc c CMOS do VOLmax(TTL)< VILmax(CMOS) v IOLmax(TTL) > IILmax(CMOS) mc cao TTL khng th thc c CMOS do p mc cao ca TTL c khi ch cn 2,5 V trong khi CMOS ch chp nhn p mc cao khng di 3,5V. nu ni mch th hot ng c th sai logic. C 1 cch khc phc l dng in tr ko ln ng ra ca cng TTL. Khi , qua in tr R ny, dng t ngun s nng dng vo CMOS nh p ra mc cao TTL s khng qu thp, CMOS s hiu c. Chng hn mt cng 74LS01 c IOLmax = 8mA, VOLmax = 0,3V thc mt cng 74HC00 c VIHmin = 3,5V, IIHmin = 1uA. Khi 74LS01 mc thp 0,3V th n s nhn dng ht mc l 8mA c cp thng qua in tr ko ln (trong khi dng IIHmin ch c di 1uA rt nh), th th s phi cn in tr ko ln c gi tr nh nht Rmin.

Cn khi mc cao 3,5V 74LS01 nhn dng 100uA v 74HC00 nhn dng 1uA. Vy khi ny in tr ko ln s phi c gi tr max hn li dng cho 2 cng

Khi Rmax th cng sut tiu tn max s nh nht T C = 15pF c thm vo khi ang mc thp 0,3V m chuyn ln mc cao th t s np cho p ln 3,5V CMOS hiu

72
Hnh 1.77 Giao tip gia TTL vi CMOS 2.1.3 TTL thc CMOS c p ngun cao hn 5V Cng ging nh trng hp trn, nu ra mc thp th TTL c th thc trc tip CMOS nhng nu ra mc cao VOH(TTL) ch c 2,7V n 5V th chc chn khng th thc c CMOS v khong p ny ri vo vng bt nh ca ng vo CMOS. Ta cng phi dng in tr ko ln, c th dng TTL ng ra cc thu h cho trng hp ny. 2.1.4 Giao tip CMOS-CMOS Vi cng in th cp, mt cng CMOS c th thc cho rt nhiu cng cng loi CMOS v dng cp khong 0,5 n 5mA trong khi dng nhn rt nh (di 1uA) Tuy nhin nu tn s hot ng cng cao th kh nng thc ti s cng gim i (c khi ch cn di 10 cng). L do l tn s cao, cc in dung ng vo ca cc cng ti s lm tng cng sut tiu tn v tr hon truyn ca mch. 2.1.5 CMOS thc TTL Khi thc ti mc cao thng VOH(CMOS) > VIH(TTL) cn dng nhn IIH(TTL) ch vi chc uA nn CMOS c th thc nhiu ti TTL. Khi thc TTL mc thp th rt phc tp tu loi. CMOS c (4000) khng thc c TTL. CMOS mi (74HC) th c th, s cng thc c tu thuc VOL(CMOS) > VIL(TTL) v dng tng ng ra (CMOS) phi ln hn tng cc dng ng vo IIL ca cc ti TTL. Nh vy, vic giao tip cc cng vi nhau cng rt a dng tu thuc yu cu ngi s dng. Mt vn khc cng cn phi quan tm l cc IC giao tip nhau chung ngun cp hay giao tip cng khong mc p s m bo hot ng hn. V vy c mt s IC c sn xut phc v cho vic chuyn mc in p giao tip gia CMOS vi TTL hay CMOS 4000 vi CMOS 74HC. 2.2 Giao tip gia cng logic vi cc thit b in 2.2.1 Giao tip vi cng tc c kh Cc cng tc thng s dng ng m ngun cp to trng thi logic cho cng nhng do lm dng tip xc c kh nn khi ng m s sinh ra hin tng di.

73

Hnh 1.78 Giao tip vi cng tc c kh Vi in gia dng nh n qut th hin tng di ny khng nh hng g c v di xy ra rt ngn ch khong vi ms, n qut khng kp sng tt hay quay dng hoc nu c i th mt cng khng th thy c. Nhng vi cc vi mch in t, rt nhy vi nhng thay i rt nh v rt nhanh nh vy. Hin tng di ny sinh l do khi ta ng cng tc th tht ra l ng m nhiu ln ri mi ng hn hay khi m cng tc th thc ra cng l cng tc cng b h v ng nhiu ln trc khi h hn. Bn c th kim tra hin tng di ny ca cng tc vi mch m b tr nh hnh 1.78. y dng cng schmitt trigger CMOS chuyn mch tn hiu to bi cng tc. Do khi nhn cng tc, gy ra di, cng tc chuyn qua li gia mass v Vcc a vo cng logic, Schmitt trigger rt nhy khi p vo ln hn hay nh hn p ngng ca n th lp tc p ra s l mc cao hay mc thp, mc ny cung cp cho mch m v mch hin th nu c ni t mch m s cho s m l s ln di cng tc. Hin tng ny ch xy ra vi chc ms nhng vi mch logic i khi cng l nguy him ri. chng di ta c th s dng phn cng hay phn mm. Chng hn bn phm my tnh u l cc cng tc c kh, 1 phn mm trong my s d c cng tc chuyn tip trong mt khong thi gian ngn khong 20ms, nu thc s cng tc c nhn th mc logic mi n n nh sau khong thi gian di y v phn mm mi chp nhn c trng thi ca cng tc. Cn y trnh by cch chng di bng t v mch cht. Chng di dng t lc u vo T C gi tr khong 0,01us c ni ng vo ca cng logic nh hnh v. Khi nhn cng tc, t C np qua cng tc vo t. Ti khi cng tc nh ra, c hin tng di t s x qua R xung mass. Thi hng x l 100k x 0,01uF = 1ms ln hn chu k di ti a ca cng tc ch vi trm ns. Do khi ny cng logic cha chuyn

74
mch, ti khi p x trn t gim xung ti di mc ngng ca cng logic th trng thi logic ng ra mi lt li (hnh 1.79).

Hnh 1.79 Cch chng di dng t lc Cng logic NOT c dng c th l loi TTL thng hay Schitt trigger Chng di dng mch cht Mch cht c bn dng 2 cng nand mi cng 2 ng vo c hi tip cho c kt hp vi 2 in tr ko ln mc ng vo to thnh mch chng di t cng tc Khi cng tc bt ln v tr 1 (nh hnh 1.80) ng vo NAND1 mc 0 do ng ra Q' = 1

Hnh 1.81 Cch chng di dng mch cht Q' = 1 a v ng vo NAND2, ng thi ng vo cn li mc 1 ni qua R2 ln Vcc nn ra Q= 0, Q= 0 a v ng vo nand1 khi ny nu di c xy ra i chng na lm cho ng vo t cng tc t 1 xung 0 th do = 0 nn ng ra nand1 lun l 1.

75
Nh vy chng t rng Q v khng h b nh hng bi cng tc b di. Trng thi ca n ch chuyn mch dt khot mt ln khi cng tc c nhn qua a v ch lt li trng thi khi cng tc c nhn qua 2. mt dng khc cng c th chng di c th hin nh hnh 1.82:

Hnh 1.82 Chng di dng cng NOT Bt cng tc sang mass, ng ra I2 mc 0 a v qua R ng vo I1 nn vn lm I2 ra 0 cho d cng tc c b di ln xung nhiu ln. Do ng ra I3 lun mc 1 Ngc li nhn cng tc qua Vcc, ng ra I2 mc 1 a v ng vo I1 mc 1 li vn lm I2 ra mc 1 bt chp cng tc b di, kt qu ra I3 lun mc 0 Cng logic c s dng trong mch cht trn c th l loi TTL hay CMOS thng hay schmitt trigger u c c nh cng NOT 4069, 4040; cng NAND 7400, 4011, 74132, 2.2.2 Giao tip vi ti nh Ti hin nay c s dng rt phong ph, n c th l R hay c tnh cm khng, ti tuyn tnh hay phi tuyn, ti p thp, dng thp hay l cao, xoay chiu hay mt chiu. Cc cng logic c ch to ra c th giao tip vi hu ht cc loi ti nhng cc cng u c dng thp, p thp th chng thc ti nh th no? Ti c nh hng g tr li cng logic khng? Phn ny s trnh by mt s kh nng ca cng logic khi giao tip vi cc loi ti khc nhau : Led n rt hay c s dng hin th cc vi mch in t, p ri trn n di 2V, dng qua khong vi mA do nhiu cng logic loi TTL v CMOS 74HC/HCT c th thc trc tip led n Tuy nhin loi CMOS 4000, 14000 th khng th do dng vo ra mc cao v thp u rt nh (di 1uA, v di 0,5mA) mc d chng c th hot ng v cho p ln hn loi 2 loi kia Mch giao tip vi led nh hnh 1.83 :

76

Hnh 1.83 Giao tip vi LED R l in tr gii hn dng cho led, cng tu loi cng logic c s dng m R cng khc nhau thng chn di 330 ohm (in p Vcc =5VDC) tu theo vic la chn sng ca led. Ngoi led ra cc cng logic cng c th thc trc tip cc loi ti nh khc nh loa gm p in (loa thch anh) c dng v p hot ng u nh, y l loi loa c kh nng pht ra tn s cao. Mch thc cho loa gm nh hnh 1.84 di y

Hnh 1.84 Cng logic thc loa Lu l loa gm l ti c tnh cm khng, khi cng chuyn mch c th sinh dng cm ng in th cao gy nguy him cho transistor bn trong cng v vy cn 1 diode mc ngc vi loa gm bo v cng. 2.2.3 Giao tip vi ti ln Do khng dng p cng logic thc cho ti, mt khc nhng thay i ti nh khi ngt dn ngt, khi khi ng u c th gy ra p ln, dng ln v vt qu sc chu ng ca ti nn cn c cc phn trung gian giao tip, n c th l transistor, thyristor, triac hay opto coupler tuy theo mch. Hy xt mt s trng hp c th : a. Ti cn dng ln:

77
Do dng ln vt qu kh nng ca cng nn c th dng thm transistor khuch i ln, khi tc ng mc thp dng transistor pnp cn khi tc ng mc cao nn dng transistor loi npn

Hnh 1.85 Giao tip vi ti cn dng ln Khi ny cn tnh ton cc in tr phn cc cho mch Gi s ti cn dng 100mA. Khi transistor dn bo ho s= 25 Vy tnh dng IB = IC/25 = 4mA R1 = (Vcc - VBE - VCE)/IB 1K R2 c thm vo gim dng r khi transistor ngng dn, R2 khong 10K Trng hp ti cn dng ln hn na ta c th dng transistor ghp Darlington tng dng ra b. Ti cn p ln Khc vi trng hp ti cn dng ln, khng th dng transistor lm tng m v ct cng logic cu to bi cc transistor bn trong rt nhy, p ngc chu ng ca chng khng ln lm nn vi p ti ln c th lm cht chng thm ch lm cht lun c transistor m bn ngoi. Gii php trong trng hp ny l phi dng thm 1 transistor khc lm nhim v cch li p cao t ti vi cng logic, cng c th dng cng m thc chu p cao nh 7407

78

Hnh 1.86 Giao tip vi ti cn p ln hnh trn transistor cch li in th Q1 hot ng cng in th nh mch TTL cn transistor thc Q2 hot ng in p theo yu cu ca ti. mc thp Q1 dn dng vo Q2 lm n dn v ng c s chy. Trong mch R1, R3 phn cc cho Q1, Q3 v quyt nh dng ra ti, cn R2, R4 dng gim dng r, diode D bo v transistor Q2 khng b qu dV/dt... Cn vi cng CMOS tc ng mc thp v c mc cao khi thc ti th cng tng t. Transistor darlington c thay th (nh hnh 1.86) nu thy cn phi dng ln cho ti. Ring vi cng TTL tc ng mc cao th c th khng cn transistor cch li cng c nu dng cho ti (do phn cc nghch tip gip BC). Tuy nhin phi lu rng in p phn cc nghch khng c vt qu gii hn in p chu ng ca mi ni BE (thng thng khong 60VDC). c. Ti hot ng p xoay chiu p xoay chiu y l p li 220V/50Hz hay dng, vi gi tr ln nh vy nn cn cch li cng logic vi ti, mt s linh kin hay dng cch li l thyristor, triac, r le, ghp ni quang (opto coupler). y trnh by cch dng thyristor v opto coupler. Cch dng r le cng ging nh phn trc, vi hai u cun dy r le bn transistor thc cn chuyn mch nm bn ti. Dng triac: Transistor dng m dng cho triac, cc in tr phn cc v mc thm gim dng r tnh ton ging nh trc. Triac c dng cn quan tm n dng thun ti a v in p nghch nh lun nm di gi tr nh mc

79

Hnh 1.87 Giao tip vi ti hot ng in p xoay chiu Dng kt ni quang: Cch ny cch li hon ton gia mch p thp v p cao nh 1 opto couple nh hnh v. Cng logic tc ng mc thp lm opto dn ko theo SCR c kch m ti. p 20VDC nui opto c chnh lu t ngun xoay chiu, v n p bi diode zener. Mch tc ng mc cao cng tng t.

Hnh 1.88 Giao tip dng kt ni quang

CHNG 2

BI 1:MCH CHUYN I M
Trang 1

M ha v gii m l nh th no?
M ha v gii m khng c g xa l v l tt yu trong i sng chng ta. N c dng d nh, d t, d lm,l quy c chung cng c th ph bin cng c th b mt. Chng hn dng ch t tn cho 1 con ng, cho 1con ngi; dng s trong m s sinh vin, trong thi u th thao; quy c n xanh, , vng tng ng l cho php i,ng, dng trong giao thng; ri vit bc th s dng ch vit

80
tt, k hiu ring gi b mt hay phc tp hn l phi m ho cc thng tin dng trong tnh bo, vv Thng tin c m ho ri th khi dng cng phi gii m n v ta ch gii c khi chp nhn, thc hin theo ng nhng quy c, iu kin c lin quan cht ch ti m ho. Trong mch s, tt nhin thng tin cng phi c m ho hay gii m dng s.Trong nhng mc ny, ta s xem xt c th cch thc, cu trc, ng dng ca m ho gii m s nh th no. Trong cc h thng s k c vin thng, my tnh; cc ng iu khin tu chn hay d liu c truyn i hay x l u phi dng s h 2 ch gm 1 v 0; c nhiu ng tn hiu ch c 1 bit nh ng iu khin m ngun cho mch mc 1; ri c nhiu ng a ch nhiu bit chng hn 110100 CPU xc nh a ch trong b nh; ri d liu dng hex gi xung my in cho in ra k t. Tt c cc t hp bit c gi l cc m s (code) hay m. V mch to ra cc m s gi l mch m ho (lp m: encoder).

1.1 M HO 8 NG SANG 3 NG Mch m ho 8 ng sang 3 ng cn gi l m ho bt phn sang nh phn (c 8 ng vo chuyn thnh 3 ng ra dng s nh phn 3 bit. Trong bt c lc no cng ch c 1 ng vo mc tch cc tng ng vi ch mt t hp m s 3 ng ra; tc l mi 1 ng vo s cho ra 1 m s 3 bit khc nhau. Vi 8 ng vo (I0 n I7) th s c 8 t hp ng ra nn ch cn 3 ng ra (Y2, Y1, Y0). Bng trng thi mch m ho 8 sang 3 Hnh 2.1.1 Khi m ho 8 sang 3

81

T bng trn, ta c : Y0 = I1 + I3 + I5 + I7 Y1 = I2 + I3 + I6 + I7 Y2 = I4 + I5 + I6 +I7 Da vo 3 biu thc trn ta c th v c mch logic nh hnh di y :

Hnh 2.1.2 Cu trc mch m ho 8 sang 3

1.2 MCH M HO 10 NG SANG 4 NG Xt mch hnh 2.1.3 Mch gm bn phm 10 phm nhn t SW0 n SW9. Cc phm thng h cc ng I0 n I9 thp do c in tr khong ni xung mass. Trong 1 thi im ch c 1 phm c nhn ng ln cao, cc ng khc u thp. Khi 1 phm no c nhn th s to ra 1 m nh phn tng ng v s lm sng led

82
no ni vi bit 1 ca m s ra . M ny c th c b gii m sang led 7 on hin th. V d khi nhn phm SW2 m s to ra l 0010 v led hin th s 2. Nh vy mch s dng 1 b m ho 10 ng sang 4 ng hay cn gi l mch chuyn i m thp phn sang BCD.

Hnh 2.1.3 Mch m ho 10 sang 4 v n led hin th R rng vi 10 ng vo, 4 ng ra; y l 1 bi ton thit k mch logic t hp n gin s dng cc cng nand nh hnh di y :

Hnh 2.1.4 Cu trc mch m ho 10 sang 4 V y l bng s tht ca mch m ho 10 ng sang 4 ng

83

Trong thc t h thng s cn s dng rt nhiu loi m khc nhau nh m hex,np cho vi iu khin, m ASCII m ho t bn phm my tnh dng in k t ri n cc m phc tp khc dng cho truyn s liu trn mng my tnh, dng trong vin thng, qun s. Tt c chng u tun theo quy trnh chuyn i bi 1 b m ho tng ng. 1.3 MCH M HO U TIN Vi mch m ho c cu to bi cc cng logic nh hnh trn ta c nhn xt rng trong trng hp nhiu phm c nhn cng 1 lc th s khng th bit c m s s ra l bao nhiu. Do m bo rng khi 2 hay nhiu phm hn c nhn, m s ra ch tng ng vi ng vo c s cao nht c nhn, ngi ta s dng mch m ho u tin. R rng trong cu to logic s phi thm 1 s cng logic phc tp hn, IC 74LS147 l mch m ho u tin 10 ng sang 4 ng, n c tch hp sn tt c cc cng logic trong n. K hiu khi ca 74LS147 nh hnh 2.1.5 bn di:

Hnh 2.1.5 IC74LS147 Bng s tht ca 74LS147

84

Nhn vo bng s tht ta thy th t u tin gim t ng vo 9 xung ng vo 0. Chng hn khi ng vo 9 ang l 0 th bt chp cc ng khc (X) s BCD ra vn l 1001 (qua cng o na). Ch khi ng vo 9 mc 1 (mc khng tch cc) th cc ng vo khc mi c th c chp nhn, c th l ng vo 8 s u tin trc nu n mc thp. Vi mch m ho u tin 8 ng sang 3 ng, cng c IC tng ng l 74LS148.

BI 1:MCH CHUYN I M
Trang 2

MCH GII M
Mch gii m l mch c chc nng ngc li vi mch m ho tc l nu c 1 m s p vo ng vo th tng ng s c 1 ng ra c tc ng, m ng vo thng t hn m ng ra. Tt nhin ng vo cho php phi c bt ln cho chc nng gii m. Mch gii m c ng dng chnh trong ghp knh d liu, hin th led 7 on, gii m a ch b nh. Hnh di l s khi ca mch gii m 2.1 Gii m 3 sang 8 Mch gii m 3 ng sang 8 ng bao gm 3 ng vo to nn 8 t hp trng thi, ng vi mi t hp trng thi c p vo s c 1 ng ra c tc ng.

85

Bng s tht mch gii m 3 sang 8

Hnh 2.1.6 Khi gii m 3 sang 8 T bng s tht ta c th v c s mch logic ca mch gii m trn

Hnh 2.1.7 Cu trc mch gii m 3 sang 8 Rt gn hm logic s dng mch gii m : Nhiu hm logic c ng ra l t hp ca nhiu ng vo c th c xy dng t mch gii m kt hp vi mt s cng logic ng ra(mch gii m chnh l 1 mch t hp nhiu cng logic c MSI). Mch gii m c bit hiu qu hn so vi vic s dng cc cng logic ri trong trng hp c nhiu t hp ng ra. V d sau thc hin mch cng 3 s X, Y, Z cho tng l S v s nh l C thc hin bng mch gii m : Gi s mch cng thc hin chc nng logic nh bng sau : X 0 Y 0 Z 0 S 0 C 0

86
T bng cho php ta xc nh c cc t hp logic ng vo S ri C mc cao 0 0 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 0 1 0 1 1 1

S(x, y, z) = C(x, y, z) =

(1,2,4,7) (3,5,6,7)

Nh vy s cn 1 cng OR ni chung cc t hp logic th 1, 2, 4, 7 a ra ng S Tng t ng ra C cng cn 1 cng OR vi ng vo l t hp logic th 2, 5, 6, 7

Vy mch gii m thc hin bng logic trn s c mc nh sau :

Hnh 2.1.11 ng dng mch gii m lm mch cng

2.2 Mch gii m BCD sang thp phn Hnh 2.1.3 din t cho hot ng ca mch m ho nu phm 2 c nhn, ng A2 s c mc cao, m s ra l 0010. By gi ta c m s p ng vo gii m l 0010 th ng ra th 2 tng ng s c tc ng (gi s ni ti 1 n led th s lm n sng). 74LS42 l IC lm nhim v gii m 4 ng sang 10 ng. Cu to logic v bng hot ng ca n s minh ho r hn cho mch gii m ny : Hnh 2.1.8 K hiu khi ca 74LS42

87

Hnh 2.1.9 Cu trc mch ca 74LS42, gii m 4 sang 10 Bng s tht ca 74LS42 l v c 4 ng vo nn s c 16 trng thi logic ng ra. y ch s dng 10 trng thi logic u, 6 trng thi sau khng dng. Vi mch gii m 4 sang 16 th s tn dng ht s trng thi ra. Mt im na l cc ng ra ca 7442 tc ng mc thp V nguyn tc ta c th m ho t n ng sang m ng v ngc li gii m t m ng sang n ng, chc nng gia m ho v gii m khng r rt lm, chng u lm nhim v chuyn i t m ny sang m khc (nhng mch trn u ni n m h 2, thc ra cn nhiu loi m khc). Cng ch c mt s chng c tch hp sn trong IC nh 7441, 7442 l gii m BCD sang thp phn, 7443 l gii m tha 3 sang thp phn, Nhiu mch gii m cn c thm mch chu dng hay th cao hn mch logic TTL thng thng nn cn gi l mch gii m thc Mch sau minh ho cch kt hp mch m s hc chng sau vi mch gii m cung cp cc hot ng nh thi v nh th t, IC gii m thc 7445 c

88
dng v ti l ng c c p ln dng ln ngoi sc cung cp ca cc IC gii m thng

Hnh 2.1.10 ng dng 74LS45 Hnh trn cho thy, mch m to ra 16 t hp trng thi cho mch m ho. Phi 4 chu k xung ck th Q3 mi xung thp, cho php ng c c cp ngun; cn n c m ch sau 8 chu k xung ck. Thi gian m ca ti l 1 chu k xung ck. Ta c th iu chnh thi gian ny t mch dao ng to xung ck. V nguyn tc hot ng ca mch m 74LS90 ta s tm hiu chng sau.

2.3 Gii m BCD sang led 7 on Mt dng mch gii m khc rt hay s dng trong hin th led 7 on l mch gii m BCD sang led 7 on. Mch ny phc tp hn nhiu so vi mch gii m BCD sang thp phn ni phn trc bi v mch khi ny phi cho ra t hp c nhiu ng ra ln cao xung thp hn (tu loi n led anode chung hay cathode chung) lm cc on led cn thit sng to nn cc s hay k t. Led 7 on Trc ht hy xem qua cu trc v loi n led 7 on ca mt s n c cu to bi 7 on led c chung anode (AC) hay cathode (KC); c sp xp hnh s 8 vung (nh hnh trn) ngoi ra cn c 1 led con c t lm du phy thp phn

89
cho s hin th; n c iu khin ring bit khng qua mch gii m. Cc chn ra ca led c sp xp thnh 2 hng chn gia mi hng chn l A chung hay K chung. Th t sp xp cho 2 loi nh trnh by di y.

Hnh 2.1.12 Cu trc v chn ra ca 1 dng led 7 on

Hnh 2.1.13 Led 7 on loi anode chung v cathod chung cng vi mch thc gii m n led hin th 1 s no th cc thanh led tng ng phi sng ln, do , cc thanh led u phi c phn cc bi cc in tr khong 180 n 390 ohm vi ngun cp chun thng l 5V. IC gii m s c nhim v ni cc chn a, b,.. g ca led xung mass hay ln ngun (tu A chung hay K chung) Kho st 74LS47

90
Vi mch gii m trn ta c th dng 74LS47. y l IC gii m ng thi thc trc tip led 7 on loi Anode chung lun v n c cc ng ra cc thu h v kh nng nhn dng ln. S chn ca IC nh sau :

Hnh 2.1.15 K hiu khi v chn ra 74LS47 Trong A, B, C, D l cc ng vo m BCD RBI l ng vo xo dn sng LT l ng th n BI/RBO l ng vo xo hay ng ra xo rn a ti g l cc ng ra (cc thu h)

91
Hnh 2.1.16 Cu trc bn trong ca 74LS47 v dng s hin th Hot ng ca IC c tm tt theo bng di y

Nhn thy cc ng ra mch gii m tc ng mc thp (0) th led tng ng sng

Ngoi 10 s t 0 n 9 c gii m, mch cng cn gii m c 6 trng thi khc, y khng dng n (ghi ch 2)

hot ng gii m xy ra bnh thng th chn LT v BI/RBO phi mc cao

Mun th n led cc led u sng ht th ko chn LT xung thp (ghi ch 5)

Mun xo cc s (tt ht led) th ko chn BI xung thp (ghi ch 3)

Khi cn gii m nhiu led 7 on ta cng c th ghp nhiu tng IC, mun xo s 0 v ngha trc th ni chn RBI ca tng u xung thp, khi ny chn ra RBO cng xung thp v c ni ti tng sau nu mun xo tip s 0 v ngha ca

92
tng (ghi ch 4). Ring tng cui cng th RBI trng hay mc cao vn hin th s 0 cui cng V d : Hy xem mt ng dng ca mch gii m led 7 on :

Hnh 2.1.14 ng dng mch gii m 74LS47 Mch dao ng to ra xung kch cho mch m, ta c th iu chnh chu k xung mch m nhanh hay chm Mch m to ra m s m BCD mt cch t ng a ti mch gii m c th l cho m ln hay m xung Mch gii m s gii m BCD sang led 7 on hin th s m thp phn

By gi ta c th thay mch dao ng bng 1 b cm bin chng hn dng b thu pht led t ca vo nu mi ln c 1 ngi vo th b cm bin s to 1 xung kch kch cho mch m. Lu rng IC 7490 l IC m chia 10 khng ng b m ta s hc chng sau Nh vy vi ng dng ny ta c h thng m s ngi vo cng cng c th m sn phm qua bng truyn, tt nhin ch hn ch s ngi vo nhiu nht l 9. Khi ny hnh trn c trnh by dng mch c th nh sau :

Hnh 2.1.17 Minh ho ng dng 74LS47 trong mch hin th led 7 on Ta cng c th dng nhiu IC gii m thc 74LS47 gii m thc nhiu led 7 on.V cu trc logic v cc thng s ca IC, c th xem thm trong phn datasheet.

93
Nhng IC gii m thc led 7 on khc Ngoi 74LS47 ra cn c mt s IC cng lm chc nng gii m thc led 7 on c k ra y :

Mt s IC cn c kh nng tng hp mch m, cht v gi m thc trong cng 1 v nh 74142, 74143, 74144 thm ch bao gm c led trong nh HP5082, TIL308. IC gii m thc loi CMOS H CMOS cng c cc IC gii m thc led 7 on tng ng, y gii thiu qua v 4511 4511 c kh nng thc, gii m v cht d liu cng 1 lc. Cc ng ra nh thy trn u tc ng mc cao nn 4511 dng cho gii m led 7 on loi K chung. Cc chn BI, LT cng c chc nng tng t nh bn 74LS47. c bit chn LE cho php cht d liu li khi n cao. V cu trc c sn mch thc 8421 trong n nn 4511 cn c th thc trc tip thc hay thc c ti ln hn nh n kh nng sng, tinh th lng, hunh quang chn khng Nhng ng dng chnh ca n l mch thc hin th trong cc b m, ng h DVM, thc hin th tnh ton my tnh, thc gii m trong cc b nh thi, ng h khc nhau Hnh 2.1.18 K hiu khi v chn ra ca 4511

94
Bng hot ng ca 4511 nh di y, chi tit v n bn c th xem trong phn datasheet.

BI 2: MCH A HP & GII A HP


Trang 1
Lm sao 8 ngi 1 u ni v nghe c 8 ngi u bn kia cng mt lc?. Ta khng th dng 8 ng dy kt ni cho 8 ng tn hiu c v tn km, b nhiu gia cc ng dy hay suy gim tn hiu trn ng dy c bit khi khong cch truyn xa ln hay c nhiu hn s ng cn truyn (16, 32, 100,). C 1 cch l ghp cc ng tn hiu li vi nhau gim bt s ng truyn v r rng bn nhn c cng phi tch ng nhn c tr li 8 ng tn hiu ban u nhng khng ln ln gia cc ng tn hiu ghp li th cn phi t cho mi ng mt m ring. Mch in t thc hin chc nng ghp nhiu ng li vi nhau c gi l mch dn knh cn mch in t s tch ng nhn c ra nhiu ng tn hiu ban u c gi l mch tch knh. Mch dn knh v tch knh ngy nay c s dng rt rng ri trong nhiu lnh vc hin i lin quan trc tip ti in t nh ghp tch knh in thoi, knh truyn hnh, truyn

95
d liu ni tip, mng truyn internet, Vi tn s hot ng c ca cc IC mch s hng Mhz tr ln nn cho php ghp truyn c rt nhiu ng tn hiu v d liu i coi nh l ng thi. Phn ny ta s tm hiu v cc mch dn knh, tch knh dng IC s v nhng ng dng lin quan. Mch dn knh l g? Mch dn knh hay cn gi l mch ghp knh, a hp (Multiplexer-MUX) l 1 dng mch t hp cho php chn 1 trong nhiu ng ng vo song song (cc knh vo) a ti 1 ng ra (gi l knh truyn ni tip). Vic chn ng no trong cc ng ng vo do cc ng chn quyt nh. Ta thy MUX hot ng nh 1 cng tc nhiu v tr c iu khin bi m s. M s ny l dng s nh phn, tu t hp s nh phn ny m bt k thi im no ch c 1 ng vo c chn v cho php a ti ng ra. Cc mch dn knh thng gp l 2 sang 1, 4 sang 1, 8 sang 1, Ni chung l t 2n sang 1. Mc di s ni n mch dn knh 4 sang 1 1.1 Mch dn knh 4 sang 1

Hnh 2.2.1 Mch dn knh 4 sang 1 v bng hot ng Mch trn c 2 ng iu khin chn l S0 v S1 nn chng to ra 4 trng thi logic. Mi mt trng thi ti mt thi im s cho php 1 ng vo I no qua truyn ti ng ra Y. Nh vy tng qut nu c 2n ng vo song song th phi cn n ng iu khin chn. Cng ni thm rng, ngoi nhng ng nh trn, mch thng cn c thm ng G : c gi l ng vo cho php (enable) hay xung nh du (strobe). Mch t hp c th c 1 hay nhiu ng vo cho php v n c th tc ng mc cao hay mc thp. Nh mch dn knh trn, nu c thm 1 ng cho php G tc ng mc thp, tc l ch khi G = 0 th hot ng dn knh mi din ra cn khi G = 1 th bt chp cc ng vo song song v cc ng chn, ng ra vn gi c nh mc thp (c th mc cao tu dng mch)

96
Nh vy khi G = 0 S1S0 = 00, d liu I0 s a ra Y S1S0 = 01, d liu I1 s a ra Y S1S0 = 10, d liu I2 s a ra Y S1S0 = 11, d liu I3 s a ra Y do biu thc logic ca mch khi c thm ng G l Y =G.S1S0I0 + G.S1SI1 + G.S1S0I2 + G.S1S0I3 Ta c th kim chng li biu thc trn bng cch : t bng trng thi trn, vit biu thc logic ri rt gn (c th dng phng php rt gn dng ba Kc n. V sau bn c th xy dng mch dn knh trn bng cc cng logic. Cu to logc ca mch nh sau : (lu l trn hnh khng xt n chn cho php G) Nhn thy rng t hp 4 cng NOT a 2 ng iu khin chn S0, S1 vo cc cng AND chnh l 1 mch m ho 2 sang 4, cc ng ra mch m ho nh l xung m cng AND cho 1 trong cc ng I ra ngoi. Vy mch trn cng c th v li nh sau :

Hnh 2.2.2 Cu trc mch dn knh 4 sang 1 Hnh 2.2.3 Dn knh 4 sang 1 t gii m 2 sang 4

1.2 Mt s IC dn knh hay dng

97

Hnh 2.2.4 K hiu khi ca mt s IC dn knh hay dng 74LS151 c 8 ng vo d liu, 1 ng vo cho php G tc ng mc thp, 3 ng vo chn C B A, ng ra Y cn c ng o ca n : Y. Khi G mc thp n cho php hot ng ghp knh m chn CBA s quyt nh 1 trong 8 ng d liu c a ra ng Y. Ngc li khi G mc cao, mch khng c php nn Y = 0 bt chp cc ng chn v ng vo d liu. 74LS153 gm 2 b ghp knh 4:1 c 2 ng vo chn chung BA mi b c ng cho php ring, ng vo v ng ra ring. Tng t ch khi G mc 0 ng Y mi ging 1 trong cc ng vo tu m chn. 74LS157 gm 4 b ghp knh 2:1 c chung ng vo cho php G tc ng mc thp, chung ng chn A. Ng vo d liu 1I0, 1I1 c ng ra tng ng l 1Y, ng vo d liu 2I0, 2I1 c ng ra tng ng l 2Y, Khi G thp v A thp s cho d liu vo ng nI0 ra nY (n = 1,2,3,4) cn khi A cao s cho d liu vo nI1 ra nY. Khi

G = 1 th Y = 0

Chng hn vi 74LS153, k hiu khi, chn ra, bng trng thi v cu to logic c minh ho nhng hnh di, vi nhng IC khc cng tng t, bn c th tm thy trong t d liu phn ph lc

Hnh 2.2.5 K hiu khi v chn ra ca 74LS153 Bng s tht ca 74LS53

98

Hnh 2.2.6 Cu to bn trong ca 74LS153 1.3 ng dng a) M rng knh ghp Cc mch ghp knh t ng vo c th c kt hp vi nhau to mch ghp knh nhiu ng vo. V d to mch ghp knh 16:1 ta c th dng IC 74LS150 hoc cc IC tng t, nhng c 1 cch khc l ghp 2 IC 74LS151 S ghp nh sau :

99

Hnh 2.2.7 Hai cch m rng knh ghp 16 sang 1 t IC74LS151 (74LS151 l IC dn knh 8 sang 1) b) Chuyn i song song sang ni tip : Cc d liu nh phn nhiu bit, chng hn m ASCII, word,... thng c x l song song, t l tt c chng c lm 1 lc. Trong my tnh, d liu c di chuyn t ni ny n ni khc cng 1 lc trn cc ng dn in song song gi l cc bus. Khi d liu c truyn i qua khong cch di chng hn hng chc mt th cch truyn song song khng cn thch hp v tn nhiu ng dy, ri nhiu, .... Lc ny mch dn knh c th dng nh mch chuyn i song song sang ni tip tng t nh mch ghi dch m ta xt phn trc. Cch ni

100

Hnh 2.2.8 Chuyn i d liu truyn t song song sang ni tip Mch hnh trn cho php truyn d liu 16 bit trn ng truyn ni tip thng qua IC dn knh 74LS150. Tt nhin cn 1 mch m to m s nh phn 4 bit cho 4 ng chn ca mch dn knh (chng hn 74LS93). Mch m hot ng khin m chn thay i t 0000 ri 0001, ri n 1111 v li vng tr li 0000 m ln tip khin d liu vo song song c chuyn i lin tip sang ni tip. Cng cn phi c mt mch dao ng to xung kch cho mch m, nu tn s dao ng to xung kch cho mch m rt ln th d liu c lun chuyn nhanh, v vi tc ln nh vy vi cm nhn ca con ngi th d liu dng nh c truyn ng thi. Nguyn l ny c p dng cho ghp knh in thoi v nhiu ng dng khtransistor c) Dng dn knh thit k t hp : Cc mch dn knh vi hot ng logic nh xt trc ngoi cch dng ghp nhiu ng ng vo cn c th dng thit k mch t hp i khi rt d dng v : Khng cn phi n gin biu thc nhiu Thng dng t IC D thit k Bi ton thit k mch t hp nh bng di y cho thy r hn iu ny V d : Thit k mch t hp tho bng s tht sau

101
T bng s tht ta c biu thc logic l : Y=ABC+ABC+ABC+ABC y l biu thc thuc dng tng ca cc tch. Nh cch thit k trc ta s s dng cc cng logic gm 3 cng NOT, 4 cng NAND, 1 cng OR, cn nu chuyn sang dng ton cng NAND khng th phi cn ti 3 cng NAND 2 ng vo, 4 cng NAND 3 ng vo v 1 cng NAND 4 ng vo cha k l phi n gin biu thc nu c th trc khi thc hin. By gi ta s s dng IC dn knh 8 sang 1. 3 ng vo A, B, C s c ni ti 3 ng chn ca IC, cn c vo th t t hp trong bng nu Y l 0 th s phi ni ng vo ghp knh tng ng xung mass, cn nu Y l 1 th ni ng vo ghp knh tng ng ln ngun (c th qua R gi tr 1K). Hnh 2.2.9 s minh ho cho cch ni trn v nu bn kim tra li s thy mch hon ton tho iu kin ra ca bi ton.

102

Hnh 2.2.9 Thit k t hp dng mch dn knh

BI 2: MCH A HP & GII A HP


Trang 2

MCH TCH KNH


Mch tch knh l g? B chuyn mch phn knh hay cn gi l tch knh, gii a hp (demultiplexer) c chc nng ngc li vi mch dn knh tc l : tch knh truyn thnh 1 trong cc knh d liu song song tu vo m chn ng vo. C th xem mch tch knh ging nh 1 cng tc c kh c iu khin chuyn mch bi m s. Tu theo m s c p vo ng chn m d liu t 1 ng s c a ra ng no trong s cc ng song song. Cc mch tch knh thng gp l 1 sang 2, 1 sang 4, 1 sang 8, ...Ni chung t 1 ng c th a ra 2n ng, v s ng chn s phi l n. Mc di s ni n mch tch knh 1 sang 4 2.1 Mch tch knh 1 sang 4

103

Hnh 2.2.9 Mch tch knh 1 sang 4 Mch tch knh t 1 ng sang 4 ng nn s ng chn phi l 2 Khi ng cho php G mc 1 th n cm khng cho php d liu vo c truyn ra bt k ng no nn tt c cc ng ra u mc 0 Nh vy khi G = 0 BA = 00 d liu S c a ra ng Y0, nu S = 0 th Y0 cng bng 0 v nu S = 1 th Y0 cng bng 1,tc l S c a ti Y0; cc ng khc khng i Tng t vi cc t hp BA khc th ln lt ra S s l Y1, Y2, Y3 Biu thc logic ca cc ng ra s l : Y0 = G.B.A.S Y1 = G.B.A.S Y2 = G.B.A.S Y3 = G.B.A.S T y c th dng cng logic thit k mch tch knh Hnh 2.2.10 Cu trc ca mch tch knh 1 sang 4

104
V d : Kho st IC 74LS155

Hnh 2.2.12 K hiu khi v chn ra ca 74LS155 Trong cu trc ca n gm 2 b tch knh 1 sang 4, chng c 2 ng chn A0A1 chung, ng cho php cng c th chung khi ni chn 2 ni vi chn 15). Mt lu khc l b tch knh u c ng ra o so vi ng vo (d liu vo chn 1 khng o) cn b tch knh th 2 th ng vo v ng ra nh nhau khi c tc ng ( d liu vo chn 14 o). Cu trc logic ca mch khng khc g so vi mch xt trn ngoi tr mch c thm ng cho php

Bng s tht ca 74LS155

Mch tch knh hot ng nh mch gii m Nhiu mch tch knh cn c chc nng nh 1 mch gii m. Tht vy,vo d liu S khng c dng nh 1 ng vo d liu ni tip m li dng nh ng vo cho php cn cc ng vo chn CBA khi ny li c dng nh cc ng vo d liu v

105
cc ng ra vn gi nguyn chc nng th mch a hp li hot ng nh 1 mch gii m. Tu thuc m d liu p vo ng C B A m mt trong cc ng ra s ln cao hay xung thp tu cu trc mch. Nh vy mch tch knh 1:4 nh trn tr thnh mch gii m 2 sang 4 . Thc t ngoi ng S khi ny tr thnh ng cho php gii m, mch trn s phi cn mt s ng iu khin khc cho php mch hot ng gii m hay tch knh; cn cu to logic ca chng hon ton tng thch nhau. Hnh sau cho php dng mch tch knh 1 sang 4 gii m 2 sang 4

Hnh 2.2.13 Mch tch knh hot ng nh mch gii m Tng t ta cng c cc loi mch khc nh va tch knh 1:8 va gii m 3:8, tch knh 1:16/gii m 4:16 2.2 Mt s IC gii m tch knh hay dng Kho st IC tch knh/gii m tiu biu 74LS138 74LS138 l IC MSI gii m 3 ng sang 8 ng hay tch knh 1 ng sang 8 ng thng dng v c hot ng logic tiu biu, n cn thng c dng nh mch gii m a ch trong cc mch iu khin v trong my tnh. S chn v k hiu logic nh hnh di y :

Hnh 2.2.14 K hiu khi v chn ra ca 74LS138

106
Trong A0, A1, A2 l 3 ng a ch ng vo E1, E2 l cc ng vo cho php (tc ng mc thp) E3 l ng vo cho php tc ng mc cao O0 n O7 l 8 ng ra (tc ng mc thp )

Hnh 2.2.15 Cu trc bn trong 74LS138 Hot ng gii m nh sau : a d liu nh phn 3bit vo C, B, A(LSB), ly d liu ra cc ng O0 n O7; ng cho php E2 v E3 t mc thp, ng cho php E1 t mc cao. Chng hn khi CBA l 001 th ng O1 xung thp cn cc ng ra khc u cao. Hot ng tch knh : D liu vo ni tip vo ng E2, hay E3 (vi ng cn li t thp). t G = 1 cho php tch knh. Nh vy d liu ra song song vn ly ra cc ng O0 n O7. Chng hn nu m chn l 001th d liu ni tip S s ra ng O1 v khng b o. M rng ng gii m : 74LS138 dng thm 1 cng o cn cho php gii m a ch t 5 sang 32 ng ( dng trong gii m a ch ca my vi tnh). Hnh ghp ni nh sau :

107

Hnh 2.2.16 Ghp 4 IC 74LS138 c mch gii m 5 ng sang 32 ng Cc IC gii m tch knh khc : o Ngoi 74LS155 v 74LS138 c ni n trn ra cn mt s IC cng c chc nng gii m/tch knh c k ra y l o 74139/LS139 gm 2 b gii m 2 sang 4 hay 2 b tch knh 1 sang 4, chng c ng cho php (tc ng mc thp) v ng chn ring o o o 74154/LS154 b gii m 4 sang 16 ng hay tch knh 1 sang 16 ng 74159/LS159 ging nh 74154 nhng c ng ra cc thu h 74155/LS155 nh kho st trn : gm 2 b gii m 2 sang 4 hay 2 b tch knh 1 sang 4. c bit 74155 cn c th hot ng nh 1 b gii m 3 sang 8 hay tch knh 1 sang 8 khi ni chung ng cho php vi ng vo d liu ni tip v ni chung 2 ng chn li vi nhau. o o 74156/LS156 ging nh 74155 nhng c ng ra cc thu h. Cng ngh CMOS cng c cc IC gii m/tch knh tng ng nh bn TTL chng hn c 74HC/HCT138,...Hn th na nhiu IC h CMOS cn cho php truyn c d liu s ln d liu tng t. Mt s IC c k ra y l o o o 74HC/HCT4051 dn/tch knh tng t s 1 sang 8 v ngc li 74HC/HCT4052 dn/tch knh tng t s 1 sang 4 v ngc li 74HC/HCT4053 dn/tch knh tng t s 1 sang 2 v ngc li

Kho st IC 4051 o Khi dn knh d liu vo chn COM OUT/IN, ra 3 knh CHANNEL I/O t 0 n 7.

108
o Ngc li, khi tch knh th d liu song song vo cc chn CHANNEL I/O 0 n 7 v ra chn COM OUT/IN; o o 3 ng chn l A, B, C. Chn INH (inhibit) cho php d liu c php truyn ra. o Hot ng ca IC c tm tt nh bng sau :

Hnh 2.2.17 Chn ra 4051 o Cu trc logic mch kh phc tp nh hnh di y

Hnh 2.2.18 Cu trc mch ca 4051

109

BI 3: MCH SO SNH
Ngy nay chng ta rt quen thuc vi my vi tnh, l 1 h thng vi x l hon ho. Trong cu trc ca VXL c 1 thnh phn rt quan trng l ALU (Arithmetic logic unit : b logic v s hc). N c th tnh ton hng ngn, triu php tnh trong 1s. Cu to nn VXL li gm cc mch m, thanh ghi, cng logic v c cc mch so snh cng tr nhn chia s hc gi l cc mch lm ton. Khng nhng th cc mch lm ton cn c s dng trong in t ni chung k c iu khin t ng, truyn d liu chng hn nh khi thu nhn d liu t bn ngoi th cn phi c mch tnh ton, so snh cho tn hiu phn hi. Phn ny s tm hiu v cc mch lm ton c bn v gii thiu qua v ALU. y khng ch l kin thc cn bit khi hc mch s m cn l nn tng c th tip cn lnh vc my tnh v VXL m ta s gp khi hc hay tm hiu cc mn VXL, vi iu khin, cu trc my tnh, truyn s liu...

1. Mch so snh
Trc ht hy xem 1 v d ca vic cn thit phi dng mch so snh : l vic iu khin nhit ca 1 l nhit nh hnh di y : 1 b cm bin s chuyn i tnh trng nhit ca l thnh tn hiu in tng ng vi 1 nhit xc nh. B so snh lm nhim v so snh tn hiu va a v vi tn hiu ci t.Tu theo tn hiu ng ra, s ra quyt nh c cu chp hnh gia tng, gim, hay gi nguyn nhit thm ch c th kt hp bo ng hin th v tnh trng ca l.

110
Hnh 2.3.1 H thng iu khin nhit l n gin, gi s tn hiu a v l A, ch c 2 mc logic l cao v thp (tn hiu s 1 bit). Tn hiu em so snh l B (tn hiu ci t) S c 3 trng hp xy ra cho ng ra : A > B khi A = 1 v B = 0 A < B khi A = 0 v B = 1 A = B khi A = 1 = B hay A = 0 = B T y xy dng bng s tht cho 3 trng hp ng ra t t hp trng thi 2 ng vo ra nh sau : Bng 2.3.1 So snh 2 s 1 bit

Nhn thy Trng hp A = B l ng ra ca 1 cng EXNOR 2 ng vo A v B Trng hp A < B l ng ra ca 1 cng AND 2 ng vo A v Trng hp A > B l ng ra ca 1 cng AND 2 ng vo v B y c gi l mch so snh ln 1 bit. Cu trc mch s nh sau :

111

Hnh 2.2.2 Khi so snh 1 bit Hnh 2.2.3 Mch so snh 1 bit By gi dng tn hiu vo mch so snh khng phi ch c mc cao hay mc thp (1 bit) m l mt chui cc xung vung th mch khi ny phi l mch so snh ln nhiu bt. Hnh thc so snh ca mch 4 bit cng ging nh mch 1 bit v r rng l phi so snh bit MSB trc ri mi li dn. 7485/LS85 l 1 IC tiu biu c cha mch so snh 4 bit K hiu khi ca IC nh hnh, cn s chn c th xem trong phn datasheet

Hnh 2.3.4 Mch so snh ln 4 bit 74LS85 Bng 2.3.2 Bng s tht ca 74LS85

112

Nhn vo bng s tht ca IC ta c th thy c hot ng ca mch 8 trng hp u mch so snh bnh thng, ln lt so snh t bt cao trc. Khi tt c cc bit ca 2 ng vo u bng nhau th phi xt n logic ca cc ng vo ni chng (c dng khi ghp chng nhiu IC c s bit so snh ln hn). Logic cc ng vo ny thc ra l ca cc ng ra tng so snh cc bit thp (nu c). Trng hp ng vo ni chng no ln cao th ng ra tng ng cng ln cao.Trng hp cc bt trc khng so snh c th cc ng ra sau cng u thp. Trng hp khng c tn hiu ng vo ni chng th tc l d liu ng vo A v B khc nhau nn ng ra A < B v A> B u mc cao. Vy mch so snh ng 4 bit th nn ni ng ni chng A = B mc cao Hnh sau y cho cch hiu d hn vi cc ng vo ni chng khi ghp 2 IC 74LS85.

113

Hnh 2.3.5 Ni chng 2 IC 74LS85 c mch so snh ln 8 bit V d sau ng dng mch so snh vo tr chi n gin : Ngi chi s nhn nt SW trong chc lt to mt s xung kch t mch dao ng; khi mch m s cho m s B3B2B1B0 ngu nhin. Mt m s c ci sn (chng hn dng cng tc to mc logic cho A3A2A1A0 l 0110) s so snh vi s m ngu nhin va vo. Nu chng bng nhau n vng s sng, nu A > B n sng, cn khi A < B th n xanh sng. Nh vy c th t ra quy nh l n vng sng th ngi chi thng chng hn. Mch dao ng c th dng IC 555 hay dng cng logic nh chng trc cng c.

Hnh 2.3.6 ng dng tr chi n gin dng mch so snh 74LS85

114

BI 4: PHP TNH S HC MCH CNG


2.1 Mch cng na Gi A l s c cng B l s cng S l tng ca A v B C l s nh ra t php cng Trc ht n gin, xt mch cng nh phn 1 bit Vi t hp 4 trng thi logic ca A v B th trng thi logic ng ra S v C nh sau:

Hnh 2.3.7 Cng na Rt gn biu thc logic ta c S = AB + AB C = AB Nhn thy S l ng ra ca cng EXOR 2 ng vo A v B; cn C l ng ra ca cng AND T y v c cu trc logic ca mch

Hnh 2.3.8 Mch cng na

115
y l mch cng na hay cng cha (haft adder : HA) v cha c s nh ban u ca php cng trc .

2.2 Mch cng By gi gi s mch thc hin php cng ln u ri nn c tng l S0 v s nh C0, nu tip tc cng ln 2 khi trng thi logic ca A v B thay i th S khng ch l tng ca A v B m gm c C0 trc . Khi ny ta c mch cng : full adder (FA)

Hnh 2.3.9 Cng

Rt gn biu thc ta c S = C0 (A B) C = AB + (A B) Cu trc ca mch logic s l :

Hnh 2.3.10 Mch cng Nhn thy rng : FA thc ra bao gm trong n 2 HA v cng OR ng ra cho s nh C

116
C 2 mch HA v FA trn mi ch lm php cng 1 bit

2.3 cng nhiu bit Cng song song By gi nu 2 s cng c nhiu bit hn th cch cng cng s tng t : trc ht cng 2 bit LSB cho bit tng (LSB). S nh c a ti cng chung vi 2 bit k tip bit LSB cho bit tng hng k tip cho n php cng cui cng gia 2 bit MSB c bit tng hng , s nh khi ny tr thnh bit LSB ca tng Hnh sau s minh ho r rng hn mch cng nhiu bit (4 bit)

Hnh 2.3.11 Cng 4 bit y l mt mch cng song song v cc hng c cng cng mt lc tuy nhin nh cu trc mch trn th cc bit ra ca tng khng phi l ng thi bi v cc php cng cc bit cao th chm hn do phi ch bit nh php cng trc a ti. Tc l c tr hon lm gim tnh ng b ca mch. Nu thm vo mch cho php cung cp sn cc bit nh phc v cho cc php cng cc hng c cng lc th s khc phc c im ny. Vi cng ngh tch hp cao, vic thm mch cung cp sn cc bit nh tr nn d dng hn khi mch tr thnh mch cng c s nh nhn trc. Mt s IC lm php cng ton phn c k ra y l 7480 (1bit), 7482 (2bit), 7483/LS83/283 (4bit) V d : xt qua IC 74LS83

117

Hnh 2.3.12 K hiu khi v chn ra 74LS83 Trong 2 s 4 bit vo l A4A3A2A1 v B4B3B2B1 S nh ban u l C0 Vy tng ra s l C4S4S3S2S1, vi C4 l s nh ca php cng Ta cng c th ni chng IC cng li vi nhau cho s bit gp i. Khi bit MSB (C4) ca tng u c ni ti ng vo nh ban u (C0) ca tng sau.

Hnh 2.3.13 Mch logic ca 74LS83 Bng s tht ca mch cng 4 bit 74LS83

118

Cng ni tip Ngoi cch cng song song nh thy trn, cn mt dng mch cng s nhiu bit na gi l mch cng ni tip. Khi ny 2 bit LSB ca cc s c cng trc, bit LSB ca tng c a ra 1 ghi dch cn s nh s quay tr v cng chung vi 2 bit k tip bit LSB v c vy cho n 2 bit cui cng c cng. Mch ghi dch ng ra dch chuyn sang phi qua mi ln cng s cho ra kt qu cng s nh cui cng tr thnh bit MSB ca tng ra. R rng mch thc hin php tnh chm hn so vi cng song song, n cng cn 1 xung nhp gi cho cc mch lm vic ng b

Hnh 2.3.14 Mch cng 4 bit ni tip

MCH TR
3.1 Mch tr na v tr

119
Cng gm 2 loi mch tr na hay cha : haft subtractor (HS) v tr hay cn gi l tr bn phn : full subtractor (FS) (khi ny cn bit mn Bi trc tham gia vo php tnh) Php tr thc ra l php cng vi s m. c s m ca 1 s ta ly b 1 ca s , cn khi thc hin mch th l cng o Hnh 2.3.15 l mch tr HS v bn cnh l bng trng thi

Hnh 2.3.15 Mch tr na, bng trng thi v mch logic Cn hnh 2.3.17 l mch tr FS cng bng trng thi hot ng bn cnh

hnh 2.3.17 Mch tr

V cu trc mch tr cng tng t mch cng ch khc l s b tr B cn phi qua cng o khi thc hin AND vi s tr A cho s mn R. Mch tr FS cng gm 2 mch tr HS v cng OR ng ra cho s mn B0

120

Hnh 2.3.18 Mch tr ht 3.2 Mch tr nhiu bit Vi mch tr nh phn nhiu bit, cng c th thc hin song song cc mch cng FS tng bit nhng cc bit ca s b tr cn c o, s nh ca tng cui cn em v bit nh ban u ca tng u. Hnh minh ho cho mch tr nh phn 4 bit

Hnh 2.3.19a Mch tr 4 bit song song Hnh 2.3.19b Tr 4 bit ni tip

3.3 Mch cng tr kt hp

121
By gi nu thm vo mt s cng logic cn thit ta c 1 mch c th cng hay tr tu theo ng vo iu khin CT Khi CT = 0, cc cng EXOR c 1 ng thp nn cho s B qua khng b o, tc l mch thc hin php cng Khi CT = 1, cc cng EXOR c 1 ng cao nn hot ng nh 1 cng NOT, s B b o, khi ny mch thc hin php cng A + (-B) tc l php tr. Co3 l bit LSB ca tng c vng tr li (qua cng AND) v Ci0; s cho php cng nhiu bit. Ngoi cch dng b 1, ta cng c th dng b 2 (ly b 1 ri cng thm 1) thc hin php ton tr nh phn k c s c du. Cch ny c s dng ph bin VXL v my tnh. Hnh 2.3.22 l mch cng tr 2 s 4 bit dng b 2. l mch kh ging nh n cch dng b 1 nhng bit nh ra cui cng khng cn em v tng u. Tng hay hiu ra dng b 2, mun ly ng kt qu th phi chuyn tr li. Khi mch cng tr nh phn 4 bit dng b 2 s nh sau : Hnh 2.3.21 Mch cng tr dng b 1

122
Hnh 2.3.22 Mch cng tr dng b 2

CNG TR BCD
4.1 Cng 2 s BCD S BCD thc ra cng l s nh phn n bit nhng ch c 10 t hp trng thi t 0000 n 1001 (biu th s thp phn tng ng l t 0 n 9) nn cch cng cng tng t nh cng s nh phn nhiu bit. Tuy nhin khi tng vt qu 1001 th tc l tng khng cn l s BCD na, do ta phi cng tng vi 0110 (s 610) cho tng mi l s BCD ng thi s nh chnh l hng cao hn ca tng. V d nh cng 2 s BCD sau:

Hnh 2.3.23 Mch cng 2 s BCD 1 bit 2 s cn cng l A3A2A1A0 v B3B2B1B0 cho tng l C3S4S3S2S1 (C3 l hng chc nu c). Nu tng u vt qu 9 ( t 10 n 18) th cc cng logic s cho php xc nh hng chc ng thi tng ny phi c cng thm 6 tng 74LS83 th 2 cho tng cui cng dng BCD.

123
Nu tng khng vt qu 9 (vn l s BCD) th tng hng chc khng c nn 74LS83 th 2 s cng tng ny vi 0, tng ra khng c g thay i. Ta c th ghp nhiu mch cng trn c mch cng 2 s BCD nhiu bit, khi ch vic ni ng ra hng chc ca tng u ti ng vo s nh Ci ca tng sau l c. 4.2 Tr 2 s BCD Vi php tr BCD, ta phi ly b 9 ca s tr ri mi lm php cng li vi s b tr. Ly b 9 ca 1 s tc l ly 9 tr i s . chng 1 c ni r hn v php tr BCD V d v php tr BCD : 9 5 v 2 6

Hnh 2.3.24 Mch tr 2 s BCD 1 bit

MCH NHN CHIA


5.1 Mch nhn 2 s nh phn

124
V nguyn l, l php cng nhiu ln. Cch nhn 2 s nh phn xin xem li chng 1. Mch hnh 2.3.25 minh ho cho mch nhn 2 s nh phn 4 bit A v B. Mch gm ghi dch 4 bit cha s c nhn A, ghi dch 5 bit cha s nhn B, ghi dch 6 bit cha kt qu nhn (cn gi l b tch lu : accumulator). 5 cng And s to tch tng phn ca cc cp bit v 6 b cng ton phn to tch cui v s nh tng ng.

Hnh 2.3.25 Cu trc 1 mch nhn 2 s nh phn V d v php nhn 2 s A = 1101v B = 1011: S nhn (A): 1101 (1310) S b nhn B : 1011 (1110) Tch 1101 tng 1101 phn 0000 1101 Tch cui : 10001111 (14310) 5.2 Mch chia 2 s nh phn

125
Cn vi mch chia 2 s nh phn, nguyn tc l tr lin tip cho kt qu, bn c th xem thm phn mch chia nh phn chng 1, hnh mch kh phc tp nn khng c trnh by y.

B LOGIC V S HC
ALU l thnh phn quan trng ca CPU trong my tnh, n c th thc hin nhiu php tnh s hc v logic da trn d liu thng bao gm php cng, tr, and,or, exor, dch chuyn, tng gim dn v c php nhn, chia. Ngoi ra cng c mt s ALU sn xut dng IC ri, tt nhin chng khng th lm y cc chc nng nh ALU trong VXL. Sau y, ta hy xem qua 2 ALU ri hay dng. 6.1 ALU 74LS181 A0 A3 : d liu nh phn 4 bit vo (A = A3A2A1A0) B0 B3 : d liu nh phn 4 bit vo (B= B3B2B1B0) CYN : s nh ban u vo (tc ng mc thp) S0 S3 : M s chn (S = S3S2S1S0) chn chc nng ca ALU. Hnh 2.3.26 Khi ALU 74LS181

M iu khin kiu (ch ) hot ng logic (M =1) hay s hc (M = 0). Q0 Q3 : d liu nh phn 4 bit ra tc ng thp (Q = Q 3Q2Q1Q0). CYN + 4 s nh ra (tc ng thp). php tr n ch du ca kt qu : o Logic 0 ch kt qu dng. o Logic 1 ch kt qu m dng s b 2. Ng s nh vo Cn v ng s nh ra CYN+4 cho php ni chng nhiu IC 74LS181. A = B : logic 1 ng vo ny ch A = B, logic 0 ch A B. G (carry generate output) v P (carry propagate input) : hai ng ny c dng khi ni chng cc IC 74LS181.

126
Hot ng logic ca 74181 c trnh by bng chc nng di y

6.2 ALU 74LS382 ALU 74LS/HC382 cng l loi 4 bit nhng c 3 ng chn chc nng nn c t chc nng logic s hc hn 74LS181. N cng c ng vo s nh CN, ng ra s nh CYN+1 nh 74LS181 nhng c thm ng ra ch bo trn overflow trong lc khng c mt s ng ra khc nh 74LS181. Khi dng s c du ng overflow s ln 1 khi php cng hay tr to s vt qu s c du 4 bit. Ng s nh vo v s nh ra cng cn dng ni chng nhiu IC 74382.

127

Hnh 2.3.27 K hiu khi ALU 74LS382 v bng hot ng

BI 5: MCH PHT V KIM TRA TNH CHN L


D liu dng s khi c lu tr, x l hay truyn t my ny qua my khc c th b li. Nh khi truyn d liu i xa qua mi trng in thoi, dy cp, khng gian c th b nh hng bi nhit , nhiu ng dy, in t hay do lu ngy cc b x l, b chuyn i c mt sai st nh s lm thay i d liu. V d : trong 1 khi d liu c ch A m ASCII l 1000001 s b sai thnh 100000 ,bit sai c th l bt c 1 bt no khc. Mc d xc sut lm sai ch 1 bt trong c khi d liu l rt nh ( trung bnh khong 100000 bit mi c 1 bit sai) nhng trong nhiu trng hp i hi phi tht chnh xc hay gim ht mc nhng sai st nh ny. C nhiu mch c th pht hin sai v sa li, bn s gp li ni dung ny k hn trong mn Truyn s liu, y xin ni ti mch to kim parity. C 2 dng mch chnh l parity chn v parity l. C 2 u c s dng. Vi parity chn : d liu trc khi truyn i s c m tng s bit Nu tng chn, bit parity 0 c thm vo trc mi khi d liu truyn. Nu tng l th bit parity 1 c thm vo ( n chn) u nhn d liu, mch s kim tra tng khi d liu nhn c xem c tng s bit l chn hay khng. Nu khng th tc l c 1 bit no trong khi d liu b sai. Ngc li l mch truyn ng Vi parity l th ngc li khi d liu phi c lm l trc khi truyn.

V d : Truyn 1 khi d liu 4 bit 1101 c s dng mch to kim parity r sai c minh ho nh hnh di y :

128

Hnh 2.3.28 Mch to kim Parity Gi s mch parity chn c dng. Nhn thy rng tng s bit truyn l 3 (l) nn bit parity 1 c thm vo cho chn. Nh vy, d liu truyn i s c 5 bit l 11101 Mch to parity trn s dng 3 cng XNOR kim tra s bit chn hay l, cn bn nhn mch kim parity dng 4 cng XNOR r sai, nu d liu truyn ng th ra Q = 0, nu truyn sai th ra Q = 1. Khi ny, mch nhn c th truyn v tn hiu bo truyn sai cho my gi n truyn li khi d liu b li ny. Nhn thy rng nu khi d liu truyn b sai ti 2 bit (xc sut ny l rt rt nh) hay bit parity truyn sai th mch parity mt tc dng. Cc mch x l iu khin hay truyn d liu thng c sn khi to kim v thm ch c th sa li lun. Cn khi dng mch ri th IC 74180 v h ca n l thng dng nht

Hnh 2.3.29 K hiu khi 74180 v bng hot ng y l IC to kim 8 bit t D0 n D7, bit parity c th dng l chn hay l. 2 ng ra l EVEN (l ra) v ODD (chn ra). 2 ng PE (l vo) v PO (chn vo) dng trong trng hp cn ni chng nhiu IC c mch to kim nhiu bit hn. Cch

129
ni s l a t ng ra chn v ng ra l ti ng vo chn v vo l. 2 ng vo l v vo chn cng nh 2 ng ra l v ra chn phi khng c bng nhau khi kim parity. Khi ng vo parity no khng dng th phi ni mc thp. Hnh di y l cch s dng 74180 lm mch kim parity l cho 9 bit d liu vo (gm c bit parity).

Hnh 2.3.30 Mch kim Parity 9 bit dng 74180 1 IC pht kim 8 bit chn l khc cng hay c dng l 74LS280

CHNG3

Bi 1: Cc khi nim c bn
Chng trc cp n cc mch t hp t cc cng logic n gin n cc mch tch hp MSI phc tp hn nh mch chuyn i m, dn knh, tch knh. Chng c mt c im l ng ra s thay i trng thi theo trng thi ng vo m khng k ti cc trng thi trc ca n, ngha l chng khng c tnh nh. n gin nh mch trn hnh 3.1.1, nu A = 1 th Y = 0

Hnh 3.1.1 Cng NOT chng ny, ta s ni n mt loi ln khc ca mch s, l mch tun t. Khc vi mch t hp, trng thi ng ra ca mch tun t tu thuc khng nhng vo cc trng thi ng vo m cn vo c 2 trng thi trc ca ng ra. Khng nhng th, trng thi ng ra s khng thay i ngay khi ng vo thay i m li cn phi i n khi c xung lnh gi l xung ng h (clock). Nh vy mch tun t va c tnh nh va c tnh ng b.

130
C mch t hp v tun t u c s dng nhiu trong cc h thng s. Mt h tun t c th biu din mt cch tng qut nh sau:

Hnh 3.1.2 H tun t Phn t hp s nhn tn hiu logic t u vo bn ngoi v t u ra ca cc phn t nh, n tnh ton da vo cc u vo ny cho ra cc u ra khc nhau, trong mt phn c em sang khi cc phn t nh ct gi i; u ra ca phn t nh c th a ra ngoi hay a iu khin phn t hp. Phn iu khin s cho php phn nh v t hp hot ng theo mt s yu cu ra. Nh vy, cc u ra ca h thng s va ph thuc vo cc u vo va lin quan n thng tin lu tr bn trong ca phn t nh. Phn t nh c th l mt mch logic nhng c khi ch l mt ng ni phn hi t ng ra v ng vo. 1.1 Mch cht cng Nand Hy xem cu to ca mch di y : Mch gm 2 cng logic Nand mc cho nhau, c 2 ng vo l S (set : c ngha l t) v R (reset : c ngha l t li). 2 ng ra k hiu l Q (u ra bnh thng) v Q (u ra o, tc l c trng thi logic ngc Hnh 3.1.3 Mch cht cng Nand o Hot ng ca mch nh th no? li vi Q)

131
Khi thit lp mch cht t S = 0, R = 1 Do S = 0 nn Q = 1 bt chp ng cn li Vy ng ra n nh s l Q = 1 v Q = 0 Khi xo mch cht S = 1 v R = 0 Do R = 0 nn Q = 1 bt chp ng cn li Vy ng ra n nh s l Q = 0 v Q = 1 V l do i xng nn hot ng thit lp v xo mch cht ngc nhau. Khi ng vo thng ngh S= 1 R=1 R rng cha th bit ng ra Q v Q nh th no Hy xt n trng thi trc : V vy khi S=1 R=1 trng thi ra khng thay i tc l trc nh th no th sau vn vy (Qo v Qo) Khi thit lp v xo cng lc S=0, R=0 R rng khi ny c 2 cng NAND u c mc vo l 0 nn mc ra l 1, y l iu kin khng mong mun v quy c Q v c trng thi logic ngc nhau. Hn na khi S, R tr li mc cao(1) th s khng th d on Q v Q thay i; v vy trng thi ny khng c s dng cn gi l trng thi cm. Nh vy, mch c 2 trng thi ra n nh l 0 v 1; mch c th nhn tn hiu s vo (trong trng hp n gin ny ch l 0 v 1) v a c n ra, v t y kh nng nh (lu tr d liu), ng b, v mt s im khc cng c th c thc hin c. Ta s tm hiu k hn nhng mch sau . Mch hot ng nh trn c coi l 1 mch cht, 1dng mch tun t c bn nht. 1.2 Mch cht l g? Nh tn gi ca n, mch c th ci li, gi li trng thi logic ng vo

132
Hnh 3.1.4 K hiu khi cht SR v bng hot ng 1.3 Cht cng NOR

Mch cht nh trn c th thay th 2 cng nand bng 2 cng NOR nguyn l hot ng cng tng t nhng ng vo S, R tc ng mc cao Hnh 3.1.6 Cht cng NOR

Hnh 3.1.7 Dng sng minh ho v bng hot ng ca mch cht cng NOR Thy rng cc mch tun t d l mch cht kho st trn hay cc mch cao hn th u c cu to bi cng logic c bn. Mc d t thn cng logic khng th lu tr c d liu nhng khi bit kt hp vi nhau theo mt cch thc cho php tu theo mc phc tp, quy m kt hp m s c mch cht, mch lt, ghi dch hay hn na l cc b nh, x l. 1.4 ng dng ca mch cht : Mch cht nh tn gi ca n c s dng nhiu trong cc h thng s cn cht hay m d liu trc khi c x l iu khin hay truyn nhn. Ngoi ra n cn c s dng lm mch chng di v mch to dng sng vung.

a. Mch chng di :
o Hin tng di do cc thit b c kh gy nn khi ng ngt chuyn mch in t. Mch cht c th c dng chng di nh thy chng 1 o Mch minh ho

133

Hnh 3.1.8 Cht NAND chng di

b. Mch to dao ng sng vung


Mt mch cht c bn kt hp vi mt s linh kin R , C to nn mch dao ng sng vung do ng ra lt trng thi qua li gia mc 1 v 0. Mch thit lp v xo t ng theo thi hng np x ca t C v tr R. o Tn s dao ng tnh theo gi tr R, C l f = (R+R3)C o Mch minh ho

Hnh 3.1.9 ng dng cht to dao ng sng vung 1.5 Cht NAND khi c xung ng h Nh ni n phn trc, cc mch tun t cn c mt c tnh na l tnh ng b m mch cht cha th hin. Trong h thng mch logic, cc mch phi thay i trng thi c trt t hay ng b nhau th mi c th khng ch cc trng thi ra theo cc thi im chn trc. Lc ny ngi ta s dng chn Ck

134
(clock_ng h: v thng thng tn hiu trn chn ny c sng dng in p nh tn hiu ca ng h) minh ho qua hnh sau o Mch cht c thm vo 2 cng nand trc cng vi 1 ng iu khin ck

Bng s tht ca cht Nand khi c thm ck

Hnh 3.1.10 Cht NAND c thm xung ng h Hot ng ca mch c th gii thch theo bng s tht: Mch va nu cn c mt tn rt thng dng: l flip flop (vit tt l FF). C th y l mch FF RS. Cc FF c 4 dng kch hot t chn Ck: kch hot theo mc cao, mc thp; cnh ln, cnh xung (ti thi im xung Ck c mc hoc cnh tng thch th FF mi c php chuyn trng thi).

Do trong cc s tay tra cu IC s, cc trng thi kch hot ny c k hiu nh sau

135

Bi 2.1: Flip-flop v cc vi mch in hnh


Trang 1
2.1 Tng quan v flip flop (FF) FF l mch c kh nng lt li trng thi ng ra tu theo s tc ng thch hp ca ng vo, iu ny c ngha quan trng trong vic lu tr d liu trong mch v xut d liu ra khi cn. C nhiu loi flip flop khc nhau, chng c s dng rng ri trong nhiu ng dng. Cc mch FF thng c k hiu nh sau

Hnh 3.1.11 K hiu FF Nu cc ng vo s quyt nh ng ra l ci g th ng ng h ck li ch ra rng khi no mi c s thay i . Chn Ck c th tc ng mc thp hay mc cao tu vo cu trc bn trong ca tng IC FF, do vi mt IC FF c nh th ch c mt kiu tc ng v ch mt m thi, v d vi IC 74112 ch c mt cch tc ng l xung Ck tc ng theo cnh xung. 2.2 Cc loi FF

136

Hnh 2.1.13 K hiu khi ca 4 loi FF ny bi cnh ln Ck a) FF SR (mch lt li t)

Hnh 3.1.14 Dng sng minh ho cho FF RS FF RS ny cnh ln khi s k hiu hnh tam gic s khi v du mi tn ln trong bng trng thi. FF RS ny bng cnh xung tng t v c kh hiu thm hnh trn nh hay gch u Ck ch cnh xung k hiu khi v v du mi tn xung bng trng thi. b) FF JK FF JK b sung thm trng thi cho FF RS ( trnh trng thi cm)

137
Hnh 3.1.15 Dng sng minh ho cho FF JK Nhn thy u vo J, K iu khin trng thi ng ra theo ng nh cch m S R lm tr 1 im l khi J = K = 1 th trng thi cm c chuyn thnh trng thi ngc li ( vi J = K = 0 ). N cn gi l ch lt ca hot ng. T dng sng c th thy rng ng ra FF khng b nh hng bi sn xung ca xung ck cc u vo J K cng khng c tc ng tr khi xy ra tc ng ln ca Ck FF JK c th to thnh t FF SR c thm 2 u and c ng ra a v nh hnh :

Hnh 3.1.16 FF JK t FF SR Cn cu to bn trong ca FF JK kch bng cnh sn s nh sau :

Hnh 3.1.17 Cu trc mch ca FF JK c) FF T Khi ni chung 2 ng vo JK nh hnh di th s c FF T : ch c mt ng vo T, ng ra s b lt li trng thi ban u khi ng T tc ng v mi khi c cnh sn ln hay xung ca xung ck. K hiu khi v bng trng thi ca FF T nh sau :

138

=>

Hnh 3.1.18 K hiu khi ca FF T

Hnh 3.1.19 Dng sng minh ho cho hot ng ca FF T FF T c s dng chnh to mch m chia 2. Khi T ni ln mc 1 (Vcc) hay trng, xung kch ln lt a vo ng Ck. Nhn thy ng ra Q s lt trng thi mi ln ck xung hay ln. Tn s xung ng ra Q ch cn bng mt na tn s ng vo ck nu a Q ny ti cc tng FF sau na th ln lt tn s f s li c chia i. y l nguyn l chnh ca mch m s c xt n phn sau.

Hnh 3.1.19a FF T dng lm mch chia tn d) FF D Khi ni ng vo ca FF RS hay JK nh hnh th s c FF D : ch c 1 ng vo gi l ng vo data(d liu) hay delay(tr hon). Hot ng ca FF D rt n gin : ng ra s theo ng vo mi khi xung Ck tc ng cnh ln hay xung.

=>

139
Hnh 3.1.20 K hiu khi

Hnh 3.1.21 Dng sng minh ho cho hot ng ca FF D FF D thng l ni chuyn d liu t ng vo D n ng ra Q cung cp cho mch sau nh mch cng, ghi dch nn hn na ng vo D phi ch mt khong thi gian khi xung ck kch th mi a ra ng ra Q, do FF D cn c xem nh mch tr hon, ng D cn gi l delay. e) Mch cht D Cc FF ny bng mc u c th tr thnh mch cht khi chn ck cho mc tc ng lun. Thng dng nht l cht D. Mch c to bi FF D khi thay ng vo ng b bi ng vo cho php (enable : E) tc ng mc cao. Cu to k hiu v bng trng thi nh nhng hnh sau :

Hnh 3.1.22 K hiu khi v bng s tht ca cht D

140

Hnh 3.1.23 Cu to cht D 2.3 Flip flop khi c thm ng vo trc tip Nh thy cc FF xem xt trn khi cp in s c th xy dng ngay trng thi ca ng ra v n cn tu thuc vo cu trc ca mch v cc yu t ngu nhin khc. V l do ny 2 ng vo mi c thm vo xc nh chnh xc trng thi logic ra lc cp in (m ngun) hay bt c lc no mun, Hnh 3.124 K hiu FF SR c thm ng Pr v Cl n hon ton c lp vi trng thi logic cc ng vo ng b J, K, R, S, D, T v k c xung ng h ck, tcl chng ginh quyn u tin trc ht quyt nh ng ra. Chng c gi l ng vo trc tip (ng vo khng ng b) v t tn l Preset (Pr) c ngha l t trc v Clear (Cl) c ngha l xo Cn phi rng khng c php t chn Pr = Cl = 0 v khi Q = Q' =1 trng thi cm. Chn Pr, Cl khi ny khng c tc dng g, khng xc nh c trng thi ra. Do , nhiu mch FF ch c 1 ng Clear xo mch khi cn m khng c ng Pr; c FF th li khng c c 2 ng ny. V cu trc bn trong ca FF khi ny, 2 ng Pr v Cl s c a vo tng trung gian ca cc FF, nh trong cu to ca IC 74LS76.

Bi 2.2: ng dng ca cht v FF


Trang 2

141
3.1 Mch pht hin tun t cc d liu. Vi 2 tn hiu vo cng mt lc A v B, xc nh tn hiu no vo trc, tn hiu no vo sau (chng hn ai bm chung trc), ta c th dng FF JK (cng NAND khng th xc nh c). Mch trn minh ho cho hot ng ca mch

Hnh 3.1.27 Mch pht hin tun t d liu A v B FF JK c ng K thp, xo mch ng ra Q thp. By gi nu A a ti ng J m vo trc, th khi B vo sau ng ck s lm Q ln cao. Ngc li, nu A vo sau, th khi B vo trc (ng J khi ny vn thp) s vn ng ra Q thp 3.2 Mch bo ng khi tia sng b ct Hnh minh ho

Hnh 3.1.28 Mch bo ng khi tia sang b ct

142
Hot ng : Bnh thng cng tc SW h ng R ca cht SR cao. Chm tia sng n transistor quang lm in tr gia cc B v E ca n gim (tu thuc cng nh sng ri vo). Do S, R ang cao nn ng ra ca cht vn gi nguyn trng thi trc (c xc nh lc m in hay cc yu t khc). xc nh trng thi ban u ta ng SW trong chc lt cho ng R thp. FF ang ch reset, do ng ra Q thp. Khi thit lp li ng ra th cn phi ngt mch bo ng ra(trnh bo ng gi). Khi thit lp xong mi ni li mch, R lc ny cao, ng ra Q thp Khi tia sng b ct, transistor quang c th dn yu hn hay ngt lun do ng S thp (do ni qua tr 47K), cht ch t, do ng ra Q ln cao kch thch mch bo ng hot ng (chng hn loa n, khi ny cng cn thm phn giao tip ti nh ni n bi s dng cng logic ca chng 1) Nu tia sng ch b ct trong chc lt thi (chng hn do c ngi i ngang qua) tc l ng S xung thp trong chc lt ri ln tr li th ng ra Q vn cao tc mch vn bo ng ko di. Mun tt mch bo ng i ta ng SW li R xung thp. Cht ch t li nn ra Q 0 mch bo ng ngt. Phn mch pht quang c th b kch hot bi tip im s chm ca (bo ng t nhp), cm bin d mc nc, nhit (bo ng qu nhit, qu mc nc cho php) 3.3 Chia tn 1 FF JK ch ch lt (J = K = 1). Nu xung vung tn s f c a ti chn Ck ca FF ny th mi cnh ln ca xung Ck, ng ra Q s lt trng thi v phi ch n cnh xung ck tip theo th Q mi lt tr li. Nh vy dng sng ng ra cng l 1 xung vung vi tn s ch cn mt na ca sng vo ng ck. Ta ni rng tn hiu c chia i tn s. Nu mc thm 1 FF th 2 ly xung ck t ng ra Q ca FF th 1 th tng t sng ra s c tn s cn 1 na ca sng ra tng FF u hay bng tn s ca sng a vo FF th nht

143

Hnh 3.1.29 Chia tn Vi cch mc FF nh trn, nu c n FF th tn s ca sng ra cui cng s ch cn l 1/2n. Thc ra, cch ni FF JK nh trn chnh l FF T. 3.4 Lu tr d liu song song Trong cc h thng s, d liu (s, m hay cc dng thng tin khc) thng c lu tr thnh mt nhm cc bit (m ASCII l nhm 7 bit, s BCD l nhm 4 bit). Do cc FF c mc thch hp s cho php d liu c lu tr v x l ng thi trn cc ng song song. Cch mc cc FF c minh ho nh hnh di:

144

Mi nhm d liu 3 bit c a ti ng vo ca 2 FF D. Xung ng h s lm cho c 3 FF hot ng ng b v ch khi ck ln cao, d liu mi c a ra ngoi. Nh vy khi ck cha tc ng cnh ln th d liu 3 bit c lu tr trong 3 FF D. Mt nhm cc FF D mc theo cch ny s to thnh thanh ghi dch cho php lu tr d liu song song, m ta s tm hiu k hn phn Hnh 3.1.30 Lu tr d liu song song ( 3bit) 3.5 m Mt ng dng rt quan trng khc ca FF l m. m l kh nng nh c s xung u vo, n l mt thao tc c bn quan trng v c s dng rng ri, t cc thit b o ch th s n cc my tnh in t s loi ln, gn nh tt c cc h thng s hin i u cng thy c mt n. Cch mc 2 FF JK nh hnh bn cho php m t 1 n 3 (dng m nh phn). Thc ra hot ng ca mch m cng tng t nh chia tn ni trn. Dng sng ng ra s t tr li sau mi 4 chu k xung kch ck u vo. Hnh 3.1.31 ng dng FF lm mch m sau.

BI 3: THANH GHI
1. Gii thiu

145
phn trc ta c bit n cc loi FF. Chng u c th lu tr (nh 1 bit) v ch khi c xung ng b th bit mi truyn ti ng ra (o hay khng o). By gi nu ta mc nhiu FF ni tip li vi nhau th s nh c nhiu bit. Cc ng ra s phn hot ng theo xung nhp ck. C th ly ng ra tng tng FF (gi l cc ng ra song song) hay tng cui (ng ra ni tip). Nh vy mch c th ghi li d liu (nh) v dch chuyn n (truyn) nn mch c gi l ghi dch. Ghi dch cng c rt nhiu ng dng c bit trong my tnh, nh chnh ci tn ca n: lu tr d liu v dch chuyn d liu ch l ng dng ni bt nht 2. Cu to Ghi dch c th c xy dng t cc FF khc nhau v cch mc cng khc nhau nhng thng dng FF D, chng c tch hp sn trong 1 IC gm nhiu FF (to nn ghi dch n bit). Hy xem cu to ca 1 ghi dch c bn 4 bit dng FF D

Hnh 3.2.1 Ghi dch 4 bit c bn

3. Hot ng Thanh ghi, trc ht c xo (p xung CLEAR) t cc ng ra v 0. D liu cn dch chuyn c a vo ng D ca tng FF u tin (FF0). mi xung kch ln ca ng h ck, s c 1 bit c dch chuyn t tri sang phi, ni tip t tng ny qua tng khc v a ra ng Q ca tng sau cng (FF3). Gi s d liu a vo l 1001, sau 4 xung ck th ta ly ra bit LSB, sau 7 xung ck ta ly ra bit MSB.

146
Nu tip tc c xung ck v khng a thm d liu vo th ng ra ch cn l 0 (cc FF reset : t li v 0 ht. Do ta phi hng hay ghim d liu li. Mt cch lm l s dng 2 cng AND, 1 cng OR v 1 cng NOT nh hnh di y.

Hnh 3.2.2 Cho php cht d liu trc khi dch ra ngoi D liu c a vo thanh ghi khi ng iu khin R/W control mc cao (Write). D liu ch c a ra ngoi khi ng iu khin mc thp (Read).

CC LOI THANH GHI DCH


C nhiu cch chia loi thanh ghi dch (SR) - Theo s tng FF (s bit) : SR c cu to bi bao nhiu FF mc ni tip th c by nhiu bit (ra song song). Ta c SR 4 bit, 5 bit, 8 bit, 16 bit C th c SR nhiu bit hn bng cch mc nhiu SR vi nhau hay dng cng ngh CMOS (cc my tnh s dng SR nhiu bit) - Theo cch ghi dch c SISO vo ni tip ra ni tip SIPO vo ni tip ra song song PISO vo song song ra ni tip PIPO vo song song ra song song - Theo chiu dch c SR tri, phi, hay c 2 chiu - Theo mch ra c loi thng v 3 trng thi Loi vo ni tip ra song song v ra ni tip

147
Loi va kho st mc 1 thuc loi ghi dch vo ni tip ra ni tip. y cng l cu trc ca mch ghi dch vo ni tip ra song song. D liu s c ly ra 4 ng Q ca 4 tng FF, v chung nhp ng h nn d liu cng c ly ra cng lc.

Hnh 3.2.3 Mch ghi dch vo ni tip ra song song Bng di y cho thy lm nh th no d liu c a ti ng ra 4 tng FF

Loi c np song song (vo song song) ra ni tip v song song By gi mun a d liu vo song song (cn gi l np song song) ta c th tn dng ng vo khng ng b Pr v Cl ca cc FF np d liu cng mt lc vo cc FF. Nh vy c th dng thm 2 cng nand v mt cng not cho mi tng. Mch mc nh sau

148
H3.2.4a Mch ghi dch np song song Mch hot ng bnh thng khi np song song thp nh ni. Khi np song song WRITE = 1 cho php np

ABCD c a vo Pr v Cl t v xo Q0 = A, Q1 = B, Xung ck v ng vo ni tip khng c tc dng (v s dng ng khng ng b Pr v Cl) Mt cch khc khng s dng chn Pr v Cl c minh ho nh hnh di y.Cc cng nand c thm vo np cc bit thp D1, D2, D3. Ng WRITE/SHIFT dng cho php np ( mc thp) v cho php dch ( mc cao). D liu np v dch vn c thc hin ng b nh cc mch trc.

H3.2.4b Mch ghi dch np song song ra ni tip Vi mch hnh 3.2.4b ng ra d liu l ni tip, ta cng c th ly ra d liu song song nh hnh 3.2.5, Cu trc mch khng khc so vi trn. D liu c a vo cng lc v cng ly ra cng lc (mch nh l tng m v hot ng khi c xung ck tc ng ln.

149
Hnh 3.2.5 Mch ghi dch vo song song ra song song Ghi dch 2 chiu Nh thy, cc mch ghi dch ni nhng phn trn u a d liu ra bn phi nn chng thuc loi ghi dch phi. c th dch chuyn d liu ngc tr li (dch tri) ta ch vic cho d liu vo ng D ca tng cui cng, ng ra Q c a ti tng k tip, . D liu ly ra tng u. dch chuyn c 2 chiu, c th ni mch nh hnh di y :

Hnh 3.2.6 Mch ghi dch cho php dch chuyn c 2 chiu Vi mch trn, cc cng NAND v ng cho php dch chuyn d liu tri hay phi. Bng di y minh ho cho mch trn : d liu s dch phi 4 ln ri dch tri 4 ln. l th t 4 bit ra b o ngc li so vi chng trn.

MT S IC GHI DCH
Nhn thy rng cc ghi dch m t trn u dng cc FF ri, ri phi thm nhiu cng logic ph to cc loi SR khc nhau. Trong thc t ghi dch c tch hp sn cc FF v ni sn nhiu ng mch bn trong; ngi s dng ch cn phi lm mt s ng ni bn ngoi iu khin cc ng cho php thi. Cc SR cng c tch hp sn cc chc nng nh va c th dch tri dch phi va vo ni tip va np song song. y l mt s ghi dch hay c dng : Lit k

150
7494 : 4bit vo song song, ni tip; ra ni tip 7495/LS95 : 4 bit, vo song song/ni tip; ra song song; dch chuyn tri phi 7495/LS96 : 5 bit, vo ni tip/song song; ra song song ni tip 74164/LS164 : 8 bit vo song song ra ni tip 74165/LS765 : 8 bit, vo song song/ni tip; ra ni tip b tc 74166/LS166 : 8 bit; vo song song/ni tip; ra ni tip; c th np ng b 74194/LS194 : 4 bit vo song song/ni tip; ra song song; np ng b dch chuyn tri phi 74195/LS195 : 4 bit, vo song/ni tip; ra song song; tng u vo JK 74295/LS295 : nh 74194/LS194 nhng ra 3 trng thi 74395/LS295 : 4 bit vo song song; ra song song 3 trng thi 74LS671/672 : 4 bit c thm cht 74LS673/674 : 16 bit Kho st ghi dch tiu biu 74/74LS95

Hnh 3.2.7 S chn ra 74LS95

151
Hnh 3.2.8 Cu trc bn trong ghi dch 74LS95 S cu to v bng hot ng ca IC nh hnh trn. Cc ch hot ng ca n nh sau : Np ni tip a d liu vo tng u Q0 t iu khin chn mc thp Khi c ck1 hay ck2 th d liu s ln lt np vo ghi dch v s c a ti cc tng sau Np song song D liu vo 4 ng ABCD a iu khin kiu ln cao Khi c ck1 hay ck2 th d liu s c np vo ng thi cc tng ca ghi dch cnh ln u ca xung ck.

NG DNG
Thanh ghi dch ng vai tr cc k quan trng trong vic lu tr, tnh ton s hc v logic. Chng hn trong cc b vi x l, my tnh u c cu to cc thanh ghi dch; trong vi iu khin (8051) cng c cc ghi dch lm nhiu chc nng hay nh trong nhn chia, ALU xt chng 2 ghi dch cng c cp n. y khng i vo chi tit m ch ni khi qut ngn gn v ng dng ca chng. 1. Lu tr v dch chuyn d liu y l ng dng c bn v ph bin nht ca chng. Ghi dch n bit s cho php lu tr c n bit d liu mt thi gian m chng no mch cn c cp in. Hay ni cch khc d liu khi dch chuyn c tr hon mt khong thi gian, n tu thuc vo : - S bit c th ghi dch (s tng FF cu to nn ghi dch) - Tn s xung ng h 2. To k t hay to dng song iu khin Ta c th np vo ghi dch, theo cch np ni tip hay song song, mt m nh phn ca mt ch no (A, B, ...) hay mt dng sng no . Sau nu ta ni ng ra ni tip ca ghi dch vng tr li ng vo ni tip th khi c xung ck cc bit s dch chuyn vng quanh theo tc ca ng h. Cch ny c th iu khin sng tt

152
ca cc n (sp xp trn vng trn hay cch no khc) Nh m phng sau l dng sng tt ca n led. Vi ti cng sut th cn mch giao tip cng sut nh thm trans, r le, SCR,... ni chng 1 cng s c dng. Cng c th to ra dng sng tn hiu tun hon cho mc ch th mch bng cch ny. Ta c th thay i dng sng bng cch thay i m s nh phn np cho ghi dch, v thay i tn s xung kch ck c cp t mch dao ng ngoi t 0 n 200MHz tu loi mch ghi dch.

Hnh 3.2.10 To dng sng iu khin bi ghi dch 3. Chuyn i d liu ni tip sang song song v ngc li Cc my tnh hay cc b vi x l khi giao tip vi nhau hay vi cc thit b ngoi thng trao i d liu dng ni tip khi gia chng c mt khong cch kh xa. Ngoi cch dng cc b dn knh tch knh 2 u truyn m ta ni chng 2 th ghi dch cng c th c dng. Cc ghi dch chuyn song song sang ni tip s thay th cho mch dn knh v cc ghi dch chuyn ni tip sang song song s thay th cho mch tch knh. Bn cnh ghi dch, cng cn phi c cc mch khc ng b, chng nhiu, r sai nhm thc hin qu trnh truyn ni tip hiu qu.

153
hnh 3.2.11 Truyn d liu ni tip 4. Bus truyn d liu By gi liu vi 8 ng d liu song song va nhn c t tch knh (cn gi l 1 byte), ta c th dng chung cho nhiu mch c khng? S d c yu cu l v trong my vi tnh c rt nhiu mch lin kt vi nhau bi cc ng d liu a ch gm nhiu bit d liu 8, 16, 32 m ta bit n n vi ci tn l bus. Vy bus chnh l cc ng d liu dng chung cho nhiu mch (chng hn bus gia cc vi x l, cc chp nh bn dn, cc b chuyn i tng t v s, Ch c mt ng bus m li dng chung cho nhiu mch, do trnh tranh chp gia cc mch th cn phi c mt b phn iu khin quyt nh cho php mch no c thng vi bus, cc mch khc b ct khi bus. Vy y thanh ghi hay cc b m 3 trng thi c dng Hnh di minh ho cho ng bus 8 bit ni gia vi x l vi b m 8 bit, bn phm, v b 8 nt nhn

Gi s rng c thit b u cn giao tip vi vi x l, nhng ch c mt ng truyn nu tt c ng lot a ln th c th b nh hng ln nhau gia cc d liu, v thng tin nhn c l khng chnh xc. Do y vi x l s quyt nh:

154
chng hn n t ng OE1 cho php b m cho mch m a d liu ln bus cn chn OE2 v OE3 ngng lm d liu t bn phm v nt nhn b ngt (ch) tc ng ra cc b m hay thanh ghi 3 trng thi trng thi tng tr cao. Tng t khi vi x l cn giao tip vi cc mch khc. Vi tc x l hng trm hng ngn MHz th vic d liu phi ch l khng ng k do gia cc thit b giao tip vi nhau rt nhanh v dng nh ng thi.

BI 4: MCH M KHNG NG B
Trong nhng phn trc ta c bit n 2 loi mch tun t c bn l mch lt v mch ghi dch; v cng bit rng nhiu FF ni li vi nhau c th hot ng nh mt mch m hay thanh ghi (nh nhiu bit). Nhng mi ch l nhng mch nh c bn, phn ny s cp n chi tit hn cu to, hot ng v nhiu ng dng ca nhiu mch m khc nhau. Phn ln chng dng mch tch hp. H thng s ngy nay s dng kh nhiu loi mch m, c th dng m xung, m sn phm, m lm ng h, nh thi gian v r rng chng l cc mch logic nn chnh xc v d dng thit k hn nhiu so vi cc loi mch tng t. 1.1 m khng ng b theo h nh phn (chia 2) Mch m ln Hnh di y trnh by mt mch m gm 4 FF T mc ni tip. Cc ng vo T (hay J=K) ca c 4 tng FF u trng hay ni ln +Vcc. Xung cn m c a vo ng ck tc ng cnh xung ca tng FF u tin (n c th l mt chui xung vung c chu k khng c nh) Cc ng ra Q ln lt c ni ti ng vo m ck ca tng sau n (nu c). Chng c t tn l Q0 (LSB), Q1, Q2, Q3 (MSB)

155

Hnh 3.3.1 B m nh phn 4 bit khng ng b c bn

Hnh 3.3.2 Gin thi gian xung ca ng vo v cc ng ra b m : Mch s m nh th no? Mch m thng hot ng trng thi ban u l 0000 do mt xung tc ng mc thp s c p vo ng Cl ca cc tng FF t trng thi ng ra l 0000. Khi xung m ck tc ng cnh xung u tin th Q0 lt trng thi tc l Q0 = 1. cnh xung th 2 ca xung ck, Q0 li lt trng thi mt ln na, tc l Q0 = 0. Nh vy c sau mi ln tc ng ca ck Q0 li lt trng thi mt ln, sau 2 ln ck tc ng, Q0 lp li trng thi ban u, do nu xung ck c chu k l T v tn s l f th xung ng ra Q0 s c chu k l 2T v tn s cn 1/2f. Nh vy xung m ck c chia i tn s sau 1 tng FF.

156
Do Q0 li tr thnh ng vo xung m ca FF th 2 (FF B) nn tng t tn nh vy fQ1 bng mt na fQ0. Vi 4 tng FF th fQ3 = 1/2fQ2 = 1/4fQ1 = 1/8fQ0 = 1/16f Nh vy vi 4 FF ta c 16 trng thi logic ng ra t 0000(010) xung m u tin n 1111 (1510) xung m th 16, tc l tr thp phn ra bng s xung m vo v v vy y l mch m nh phn 4 bit (c 4 tng FF, tn s c chia i sau mi tng) hay mch m chia 16 Mch c xp vo loi mch m ln v khi s xung m vo tng th s thp phn ra tng ng cng tng. Nhng rng ch c 16 trng thi ra nn xung m ck th 16 mch c t ng xo v 0 m li. Mun c nhiu trng thi ra hn th phi ni thm tng FF. Tng qut vi hot ng nh trn nu c n FF th s to ra 2n trng thi ng ra. S trng thi ng ra hay s lng s m khc nhau cn c gi l Modulus (vit tt : Mod) do , mch m trnh by trn cn gi l mch m mod 16 Bng s tht ca mch m nh phn 4 bit nh sau : S xung vo Q3 M s ra sau khi c xung vo Q2 Q1 Q0 Tr thp phn ra

157
Xo 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0 1

Nhn vo gin xung v bng trng thi hot ng ca mch m ny ta thy rng khng phi lc no cc trng thi logic cc ng ra u thay i theo nhp xung m ck u vo nn y ch l mch m khng ng b.

158
Gii m mch m Vi b m nh trn th c th lm c g ? Chc chn l n c nhiu ng dng ri, hy xt qua mt s v d sau : phn mch gii m hin th led 7 on, mch m c ng dng to s m cho mch gii m t 0000(0) n 1010(910) Cn y l 1 ng dng n gin khc : yu cu c t ra l phi bit c mch m n mt s no (chng hn 5) ri hin th ra led. Bn c c th d dng ngh ngay n vic s dng cng logic to trng thi ng ra lm sng led t t hp trng thi logic ng vo khi mch m n 5. Cch mc s nh sau :

Hnh 3.3.3 Gii m mch m hin th ra led Vy l ta c mt tr chi in t n gin theo kiu may mn. Cho b m hot ng, ngi chi s nhn mt nt vo mt thi im bt k ngng cp xung m ck, mch m s dng li con s ang m n. Nu s ny lm n led sng th ngi chi s thng. Tt nhin hon chnh ta cn phi c mt mch dao ng cp xung ck cho mch m chy (bn c th to mch dao ng t cng logic hay mch cht kt hp vi linh kin th ng R, C nh ni phn trc).

159
Mt ng dng n gin khc l dng mch m ny to khong xung vung iu khin ti (chng hn ng c chy hay m van x) trong khong thi gian 3s m t s 7 n s 10 Gii php gii bi ton trn l s dng cng logic to mch gii m s 0111(710) kch ng ra ln cao ri gii m s 1010(1010) kch ng ra xung thp tr li. Hai ng gii m ny c a vo ng Pr v Cl ca mch cht t ng ra ln mc cao khi Pr v xo n khi Cl. Mch thc hin kt ni nh sau :

Hnh 3.3.4 Gii m mch m iu khin ti Trong NAND1 s gii m s 7 cn Nand2 s gii m cho s 10. s m th 7 ca mch m ng ra Nand1 xung thp preset mch cht t Q ln cao. n khi m ti 10 th ng ra nand2 khi ny xung thp (tt nhin Nand1 tr li cao ri) thc hin xo ng ra Q lm Q xung thp. Khi mch m n 7 tr li th khong xung vung li xut hin. N c tnh chu k. Thi gian tn ti xung vung c quyt nh bi tn s (chu k) mch dao ng cp cho xung ck ca mch m, nu Tck = 1s th T = 3s. Do ta c th thay i f mch dao ng thay i khong thi gian iu khin ti. By gi bn hy thit k b tr chi ch cn dng 3 FF T (to 8 trng thi ra). Khi ngi chi nhn dng mch m s 5 hay s 10 th n led s sng. Mch m xung trc l mch m ln ln lt chia 2 tn s, s h 10 ra tng ng l t 0 n 15. Cng c khi cn mch m xung t 15 xung 0 chng hn, cch ni mch s nh th no?

160
Hnh di trnh by cu trc mch m xung nh phn 4 bit. Ng ra Q ln lt ca tng trc s c ni n ng vo ck ca tng sau . Xung m ck vn tc ng mc thp

Hnh 3.3.5 Mch m xung 4 bit khng ng b Cc ng ra v cch thc xo mch, a xung vo ging nh trc. Ng ra Q ca tng FF u di trng thi i cnh xung ca xung vo cc ng ra khc i trng thi cnh xung ca ng ra Q', tc l cnh ln ca ng ra Q0 ca FF k trc. Dng sng ng vo v cc ng ra cng vi mc logic sau mi xung vo v kt qu s m c trnh by nh hnh di y. rng sau xung ck u tin th mch se m ngay ln s m cao nht l 15 ri dn dn xung 14, cho ti 0 tng cng sau 15 xung ck v ti xung ck th 16 mch s t ng xo v 15 m xung tr li. Hnh di y trnh by c 2 dng sng ca mch m ln v xung bn c th so snh chng thy r hn nguyn l ca s m ln v m xung.

161

hnh 3.3.6 So snh dng sng m ln v m xung Hy ni dy 4 FF T to ra mch m ln, mch m xung chia 16, c ng ck tc ng mc cao. Hy thay FF T bng FF JK v thit k tng t Thm mt bc na l cng vi tng y FF ta s thit k mch c th m ln m xung u c. Nhn thy mch m ln hay xung l do ni t ng ra ca tng trc ti ng vo ck ca tng sau do y s phi dng mt cng OR cho 2 ng vo. Vic m ln xung c quyt nh bi mt ng iu khin chn ch ln hay xung. Cu trc ca mch s c thit k nh sau :

162

Hnh 3.3.7 Mch m ln hay xung Mun c c hai dng sng m ln v m xung nh hnh ta c th ly ra cng lc t cc ng o v khng o ca cc tng FF ging nh hnh sau :

Hnh 3.3.8 Mch m ly ra dng sng m ln v m xung Mch m t dng Cc mch m trc t ng quay vng (m ln ht 15 ri reset tr li m t u hay m xung n 0 th reset tr li m t 15 xung) nu tip tc cp xung Ck cho mch m. By gi c mt yu cu l mch s phi dng m mt con s no nh trc (chng hn 10). thc hin n ta phi tm cch dng FF u tin. Mt cch m chng ta dng phn tr chi may mn l ngng cp xung ck vo; nu mun mch t ng lm, c th dng cng logic t hp khng ch ng vo T (chung) ca tng u, cc ng vo cng logic s l cc m s m ca s ang m ti m mun dng. Hnh di y trnh by cch thc hin:

163

Hnh 3.3.9 Mch m t dng s m 10 1.2 Mch m khng ng b khng theo h nh phn (chia 2) Vi mch m dng n FF mc ni tip th s mod (s trng thi logic ra) l 2n, v mch s m t 0 n 2n 1 (4 FF m ti 16 trng thi). Trong nhiu trng hp ta cn mch m c s mod khng theo 2n, chng hn m mod 10 (cn gi l mch m thp giai hay mch m chia 10) rt hay dng hin th kt qu m dng h 10, hay v d khc l trong ng h s cn mch m chia 6 v chia 12 hin th gi v pht hay bt k mch m chia mod n no.Thng th trong mch m ln s m tng theo th t lin tc t 0 n 2n 1 ri quay v 0 m tr li. Nhng cng c th khng tng theo th t hay th t nhng khng lin tc min l s trng thi n. Tr li mch m t dng hnh trn : khi m ti mt s nh sn (s 10) mch s t dng, vy ta c th cho mch tip tc chy m tr li bng cch a ng ti chn clear thay v a ti chn J, K. Hnh mch m mod 10 c ni nh sau :

Hnh 3.3.10 Mch m mod 10

164
Cn l xung m ck th 10 khi s m va ln 10 th cc trng thi logic ng ra c a v khng ch ng Cl ngay do c th thy l s 10 khng kp hin ra phi chuyn v 0. Thc t th do thi gian tr hon gia cc cng logic khong vi ns nn vn c s m 10 trong khong thi gian ny, ta ch quan tm ti nh hng ny khi cn i hi mch hot ng vi chnh xc cao nh trong my vi tnh chng hn. nh hng ca tr hon c th hin r hn qua gin xung sau

Hnh 3.3.11 Tr hon truyn ca mch m khng ng b mod 10 Thc t th cch thit k mch m khng theo h nh phn li dng ng clear nh trn khng c dng do: + Cc ng ra do c ni vi ti khc nhau nh hng n ng a v, ri tr hon truyn qua cc cng logic na s pht sinh xung nhn, cc tng FF s khng c xo ng thi + Hn na ng clear khng cn c t do xo mch lc mong mun. Do vy c mt cch to mch m trn l nghin cu s lin h gia cc trng thi cc ng ra ri th ni chng vi cc ng vo J, K ca tng no cho ti khi tho bng trng thi. Hy xem cch ni nh th no: Trc ht hy nhn vo gin xung ca mch m mod 16. Ti s m th 10 th mch phi reset tr li.

165
- Ng ra Q0 khng thay i g d c c xo hay khng v n theo xung ck - Ng ra Q1 ti phi gi nguyn trng thi trong 2 chu k ca xung ck na do ng J, K phi mc 0 trong khong thi gian ny, ta c th ni t chn Q3 v J1, K1 v lc ny Q3 ang mc 0 (n cng ln 1 sau khi b xo) - Ng ra Q2 ti lc xo vn 0 nn khng cn thay i g tng FF 2 - Ng ra Q3 khi xo phi tr li mc 0 ban u, lc ny Q1 cao, Q2 thp ng thi Q0 ang i xung, do c th ni Q0 ti ng ck ca FF 3 v ni cng and t Q1 v Q2 Kt qu ni mch nh sau:

hnh 3.3.12 Mch m mod 10 Cui cng kim tra li thy tho hot ng. Nhng cch ny xem ra kh rc ri v nh l on m. Thc ra n li rt hay, n c mt phng php thit k rt ng v bi bn ta s gp li phn thit k mch m ng b phn sau. C rt nhiu IC m khng ng b c h TTL v CMOS. y ch gii thiu mt s IC hay dng : 74LS293 Cu to gm 4 FF JK vi cc u ra Q0 (LSB), Q1, Q2, Q3(MSB), Q0 ring bit cho php mch hot ng linh hot. Cc u vo J, K u c ni mc cao bn trong.

166
Mch c ti 2 u vo xung nhp CP (clock pulse) cng chnh l xung ck m ta bit) cho tng 0 v tng 1 d thit k nhiu ng dng. Hai ng vo khng ng b MR1 v MR2 (master reset) nu cng tc ng mc cao th s hot ng nh chn clear xo mch. S logic v s khi ca IC nh sau :

Hnh 3.3.13a K hiu khi v chn ra ca 74LS293

Hnh 3.3.13b Cu trc mch ca 74LS293 74LS293 l IC m khng ng b nhiu kiu bit ra tu cch mc dy. m mod 16 : Xung nhp vo s vo chn CP0; chn CP1 ni ti ng ra Q0; MR1, MR2 ni chung xung mass mch xo t ng

167

Hnh 3.3.13c 74LS293 m mod 16 m mod 10 Xung nhp vn vo chn CP0; chn CP1 ni ti Q0 cho s trng thi ln n 10, khi m n 10 Q1, Q3 ln mc cao nn c ni v MR1 v MR2 xo mch

Hnh 3.3.13d 74LS293 m mod 10 m mod 14 CP0, CP1 vn ni dy nh c khi m ti 14 th Q3Q2Q1Q0 l 1110 do phi ni Q3 ti MR1, Q2, Q1 ti MR2 qua cng nand.

Hnh 3.3.13e 74LS293 m mod 14 74LS90, 74LS92, 74LS93

168
3 IC trn cng cc lot ca n (LS, HC, ) cng rt hay dng. S mch v s chn nh hnh. Cng ging nh 74LS293 tng FF u kh c lp dng linh hot hn, mun m y s trng thi ca IC th cn phi ni ng ra Q0 ti ng vo B; hai ng reset thng ni AND xo mch m khi a ln cao. Khi m ln th cn phi cho 1 trong 2 ng ny ln cao trong chc lt (khong vi mi ns) ri a xung thp tr li. Ring 74LS90 c thm 2 ng reset 9 (R9(0) v R9(1)). Bnh thng mt trong hai hoc c 2 ng ny c gi thp, mun ng ra c s m l 9 th phi a c 2 ng ln cao.Nh vy ta c th dng 74LS93 lm mch m mod 10, mod 12 hay mod 16 ging nh 74LS293 trn. Cch mc dy bn c th d dng lm c.

Hnh 3.3.14a Chn ra IC m 74LS90 74LS92 74LS93

Hnh 3.3.14b k hiu khi ca 74LS90 74LS92 74LS93 Cn khi cn s mod ln ta c th dng 4020 (mod 16384 tc 14 tng FF) hay 4040 (mod 4096 tc 12 tng FF). Do dng nhiu tng FF v li thuc loi CMOS c nn tn s hot ng kh gii hn ch khong 2MHz.

BI 5: MCH M NG B

169
phn trc ta bit rng nhng mch m khng ng b khi c nhiu tng FF s tch lu nhiu tr hon truyn ca mi tng lm cho n ln hn c chu k m xung khin ton mch c th hot ng sai logic nht l khi hot ng tn s cao. Nh mch m bn bit chia 2 ni trc : khi s m tng t 1110 ln 1111 ch cn ch ng ra ca FF 0 thay i nn ch mt 1tD. Khi s m tng t 1011 ln 1100 i hi ba FF chuyn mch lin tip nn s phi mt 3tD. Trng hp na khi s m t ng reset v 0000 th c 4 FF u chuyn trng thi do tr hon truyn s l 4tD. C th khc phc nhng gii hn ny bng vic s dng b m ng b hay cn gi l b m song song bi v tt c cc tng u c kch bi cng mt xung nhp Ck u vo. Khi cc FF chuyn mch cng mt lc khin thi gian tr hon ca mch m bng tr hon truyn ca mt FF bt k s tng. m bo hot ng ng, mt s cng logic c thm vo khng ch ng vo J, K (T). Trc ht l mch m chia 16. 2.1 m ln chia 16 Ni dy nh th no ...?

Hnh 3.3.16 Mch m ln ng b mod 16 Bng trng thi v dng sng m ln ca mch m ng b hon ton ging nh mch m khng ng b do ta s da vo chng xc nh xem mch hot ng nh th no. Cng cn lu l y ta xy dng mch m ln mod 16 vi 4 FF JK c xung Ck tc ng cnh xung. Ta cng c th lm mch tng t, vi xung ck tc ng cnh ln hay s dng FF T thay cho FF JK.

170

mch m ng, mi xung kch ck tc ng cnh xung, ch c FF no d kin s lt trng thi mi phi T = 1(J, K c ni chung vi nhau v c coi nh l ng chung T). Nhn vo bng trng thi hot ng ca b m ln ta s thy c cn phi kt ni nh th no - Ng ra Q0 s thay i trng thi theo cnh xung ca xung kch ck do ng T0 c trng (mc cao). - Ng ra Q1 i trng thi khi c xung kch xung Q0 do Q0 c a thng vo ng T1 - Ng ra Q2 i trng thi khi m n s 4, 8, 12, 0, lc ny th Q0 v Q1 u xung thp; vy ng vo T2 s l And ca hai ng vo ny - Ng ra Q3 o trng thi khi s m l 8 v 0 khi ny Q0, Q1, Q2 u tc dng cnh xung, vy ng vo T3 s l And ca 2 ng vo ny Vy mi FF u phi c u vo T c ni sao cho chng mc cao ch khi no u ra ca cc FF trc n mc cao. T0 = 1 T1 = Q0 T2 = Q1.Q2 T3 = Q0.Q1.Q2 v t y mch c kt ni vi hai cng And c thm vo

171

Hnh 3.3.17 Mch m ln ng b mod 16 Tr hon truyn ca mch m s bng tr hon truyn qua mt FF cng vi tr hon truyn qua cc cng and. Vi mch m kho st trn s tng l n = 4, s cng and phi dng thm l n 2 = 2 nhng thi gian cng ch tr hon trn mt cng and thi nn tr hon truyn tng cng l : tD = tD(FF) + tD(and) Do tr hon truyn ca cng and th nh hn nhiu so vi tr hon truyn ca FF nn thi gian ny nh hn so vi thi gian tng ng ca mch m khng ng b. iu ny cn c ch hn khi trong mch c rt nhiu tng FF v mch phi hot ng tn s cao. y l im ni bt ca n so vi mch m khng ng b nhng r rng n s phi c cu to phc tp hn V d : Hy xem tn s hot ng ln nht ca mch trn (fmax) khi tD(FF) = 50ns, tD(and) = 20ns v so snh n vi fmax ca mch m khng ng b cng s bit Ta c tr hon truyn tng cng ca mch l tD = 50 + 20 = 70(ns). Chu k xung nhp ck u vo Tck phi ln hn 70 ns ny do fmax = 1/70ns = 14,3MHz By gi vi b m mod 16 khng ng b fmax = .50ns = 5MHz Nh vy r rng b m song song hot ng c tn s cao hn hn By gi gi s cn lm mch mod 32 t mod 16, th ta s phi mc thm 1 tng FF th 5. Tr hon truyn ca m song song s vn l 70ns suy ra fmax = 14,3MHz.

172
Cn vi b m khng ng b th do c thm 1 tng nn fmax = 1/5.50ns = 4MHz, tn s ny b gim hn i. 2.2 m ng b ln xung hnh 3.3.17 trn l mch m ng b ln, ta c th xy dng mch m ng b xung ging nh cch lm vi mch m khng ng b tc l dng cc u ra o ca FF iu khin cc u vo T ca tng k tip. Nh vy vi mch m xung mod 16 th u ra Q s c ni ti T1, T2, T3 v b m s m xung t 15, 14, 13, ri v 0 reset tr li 15. By gi thm 1 ng iu khin ch m ging nh bn mch m ln xung khng ng b ta c mch m ln xung ng b. K = 1(up) m ln, K = 0(down) m xung. Mch c xy dng nh hnh sau (lu xung ck tc ng cnh ln)

Hnh 3.3.18 Mch m ng b ln hay xung 2.3 m ng b khng theo h nh phn thit k mch m mod m bt k t mch m mod 2n (m <= 2n) ta c th dng ng clear xo mch khi m n s m, cch khc l nhn vo gin xung th nghim vic ni cc u vo J, K. y ta s xt n mch m mod 10 hay dng Ngoi xung ck c a vo tt c 4 tng FF th cn phi gii quyt cc ng J, K l khi mch m n s 10 th Q0 = 0 v Q2 = 0 khng i trng thi khi reset v 0 nn FF 0 v FF 2 c kch bnh thng nh ni.

173
Cn vi FF 1, Q1 i trng thi khi Q0 cao ng thi Q1 phi c gi lun mc thp s m th 10, khi ny c th tn dng ang cao cho ti khi reset, vy J1 = K1 = Q0. Sau cng vi FF 3 Q3 s c reset v 0 khi c 3 Q0Q1Q2 u v 0. Vy J3 = K3 = Q0Q1Q2 Kim tra li thy rng mch ng l hot ng m chia 10. Bn c th xem phn thit k mch m ng b sau hiu r cch ni mch, cn y l cu trc mch m t:

Hnh 3.3.19 Mch m mod 10 ng b 2.4 m t trc s m Nhiu b m song song dng IC tch hp c thit k c kh nng np trc s cn m thay v 0 nh ta thng thy. S t trc l bt k trong nhng s c th ra ca mch v mch c th m ln hay m xung 1 cch ng b hay khng ng b t s ny.Vic ny ging nh l np song song ghi dch vy, bng cch tn dng ng Cl v Pr (ng khng ng b c lp vi ck). Cu trc mch vi 3 tng FF c minh ho nh hnh v hot ng np c thc hin nh sau:

174

hnh 3.3.20 Mch m t trc 3 bit Gi s mch ang m hay dng 1 s m no a sn s m c trng thi cn np vo ng A B C t mt xung mc thp vo u LD (parallel load), xung ny s cho php trng thi logic ABC qua cng Nand a vo 3 tng FF qua 3 ng Pr hay Cl (tu thuc bit mc thp hay cao). Kt qu l Q0 = A, Q1 = B, Q2 = C Khi LD ln cao tr li, lc ny nu c xung nhp Ck th mch s tip tc m t s va np (trc ck v cc ng T khng c tc dng). 2.5 Mt s IC m ng b Nhm 74LS160/161/162/163 C 4 IC u c cng kiu chn v cc ng vo ra tng t nhau; c xung ck ny cnh xung do trong cu to c thm mch m sau ng ng b; c kh nng np song song; preset ng b; c th ni chng nhiu IC c s mod ln hn nhiu do c - LS160, LS161 l IC m chia 10 cn LS161 v LS163 l m chia 16 - LS160 v LS161 c chn xo Cl khng ng b cn LS161, LS163 c chn xo Cl ng b Nhm 74190, 74191 74LS190 l mch m chia 10 cn 74LS191 l mch m chia 16. Chng c kiu chn ra nh nhau v chc nng cng nh nhau

175
- Chn EnG (enable gate) l ng vo cho php tc ng thp; chn U/D l ng cho php m ln hay xung (thp) - Chn RC (ripple clock) xung rn s xung thp khi m ht s; c dng cho vic ni tng v xc nh tn s ca xung max/min khi ni ti chn LD (load) ca tng sau. Cch ni tng nh sau : chn RC ca tng trc ni ti chn ck ca tng sau, khi ny tuy mi mch l m ng b nhng ton mch l m bt ng b. Cch khc l chn RC ca tng trc ni ti chn EnG ca tng sau, xung ck dng ng b ti cc tng. Nhm 74LS192, LS193 LS192 l mch m chia 10 cn LS193 l mch m chia 16 C 2 loi u cu trc chn nh nhau v u c kh nng m ln hay xung Khi m ln xung ck c a vo chn CKU cn khi m xung xung ck c a vo chn CKD Khi m ln ht s chn Carry xung thp, khi m xung ht s chn Borrow xung thp. 2 chn ny dng khi cn ni tng nhiu IC c bit mch c th t trc s m ban u cc chn ABCD v chn LD xung thp cho php np s ban u. Nhm 74HC/HCT4518 v 74HC/HCT4520 y l 2 IC m ng b h CMOS dng FF D v hot ng cng tng t nh nhng IC k trn nhng v cu to c bn t cc cng logic CMOS nn tn s hot ng thp hn so vi nhng IC cng loi b li tiu tn cng sut thp. 4518 l IC m chia 10 cn 4520 l IC m chia 16 Cu trc chn v c tnh ca chng nh nhau Chn nhn xung ck v chn cho php E c th chuyn i chc nng cho nhau do mch c th tc ng cnh xung hay cnh ln Mch cng cho php ni tng nhiu IC khi ni Q3 ca tng trc ti ng E ca tng sau.

BI 6: MCH M VNG
3.1 m vng

176
Mch m vng c cu trc c bn l thanh ghi dch vi ng ra tng sau cng c a v ng vo tng u. Hnh di l mch m vng 4 bit dng FF D.

Hnh 3.3.22 Mch m vng 4 bit Nhng rng, khi mi bt ngun cho mch m chy, ta khng bit bit 1 nm ng ra ca tng no. Do , cn phi xc lp d liu dch chuyn ban u cho b m. Ta c th dng ng Pr v Cl lm, nh l tng dng t s m cho cc mch m khc ni trc, gi s trng thi ban u l 1000 vy ta c th reset tng FF 3 t Q3 mc 1, cc tng khc th xo bng clear. C th dng mch to xung np d liu ban u nh sau :

Hnh 3.3.23 Mch np s ban u cho mch m vng Gi s ban u ch cho D0 = 1, cc ng vo tng FF khc l 0. By gi cp xung ck ng b khi ck ln cao, d liu 1000 c dch sang phi 1 tng do Q 0 = 1, cc ng ra khc l 0. Tip tc cho ck xung thp ln na, Q 1 s ln 1, cc ng ra khc l 0. Nh vy sau 4 nhp xung ck th Q3 ln 1 v a v lm D0 = 1. mch thc hin xong 1 chu trnh. Trng thi cc ng ra ca mch nh hnh sau:

177

Hnh 3.3.24 Dng sng minh ho mch m vng Hnh trn cho thy rng, dng sng cc ng ra l sng vung, dch vng quanh, chu k nh nhau nhng lch nhau ng 1 chu k xung vo Ck. S m ra l 1, 2, 4, 8 khng phi l s xung vo (nh bng trng thi m pha di) Vi 4 s m ra t 4 tng FF ta c mch m mod 4. Ch 4 trng thi ra trong tng s 16 trng thi c th, iu ny lm gim hiu qu s dng ca mch m vng. Nhng n cng c u im ni bt so vi mch m chia h 2 l khng cn mch gii m trong cu trc mch (v thng trong trng thi ca s m ra ch c 1 bit 1) . 3.2 m Johnson (m vng xon)

Hnh 3.3.25 Mch m vng xon

178

Mch m Johnson c mt cht thay i so vi m vng ch ng ra o tng cui c a v ng vo tng u. Hot ng ca mch cng gii thch tng t. Vi n tng FF th m vng xon cho ra 2n s m do n cn c coi l mch m mod 2n (m nh phn cho php m vi chu k m n 2n). Nh vy trn l mch m vng xon 4 bit. Bng bn cho thy 8 trng thi ng ra v hnh di s minh ho cho s m. Ta c th np trng thi ban u cho mch l 1000 bng cch s dng ng Pr v Cl ging nh trn. Dng sng cc ng ra cng ging nh trn, hn th na, n cn i xng gia mc thp vi mc cao trong tng chu k

Hnh 3.3.26 Dng sng mch m vng xon

BI 7: THIT K MCH M
Tuy thit k khng phi l ni dung chnh m ti liu phi cp nh y s nu mt vi bi ton thit k in hnh gip sinh vin c th hiu su hn v mch logic tun t. Tr li hnh 3.3.19 y l mch m ng b chia 10 (MOD 10). Ngi ta dng mch m mod 16 kt hp vi mt s cng logic to vic reset khi ng ra hin

179
th s 10. Qu trnh m ch din ra theo th t trong cc trng thi t 0 n 9, nh vy mch n vi chu k m l 10. C th thit k mch m theo cch khc vi cch trn theo dng lp bng trng thi kt hp vi ba Karnaugh. Cch ny rt r rng trnh t, n c th thit k vi s mod bt k, dng FF tu , m ln hay m xung cng c, thm ch s m khng theo trnh t g c. Minh ho vic thit k qua v d sau. BI TON 1: V d thit k mch m ln ng b mod 8 dng FF JK minh ho nh hnh sau:

hnh 3.3.27 gin mch m ln mod 8 Trc ht hy cng tm hiu v s chuyn tip trng thi ng ra Q: Gi s ng ra Q ang 0, by gi ta mun khi c xung ck th Q ln 1. Da vo bng trng thi ca FF JK th J = 1, K = 0 hay J = 1, K = 1 (trng hp Q n+1 = 1 vi Qn chnh l Q ang 0 trc ). Tm li khi Q t 0 chuyn ln 1 th cn J = 1, K = X (X bng 0 hay 1). L lun tng t th : Q t 1 chuyn v 0 cn J = X, K = 1 Q t 0 gi nguyn l 0 cn J = 0, K = X Q t 1 gi nguyn l 1 cn J = X, K = 0 C bn trng hp chuyn trng thi ca Q c tm tt nh bng di y (c gi l bng trng thi kch ng vo ca FF JK ) :

180

Ging nh vy, bn c th lp c bng trng thi kch ng vo ca cc FF SR, FF D, FF T Sau khi nm vng quy tc chuyn trng thi ca FF trn ta mi bt u i vo bi ton v d trn : Do mch m c tt c 8 trng thi ng ra nn ta cn 3 FF, chn FF JK. C th tm lt ni dung cn thit k qua mch logic sau:

Nhim v ca bi ton l tm ra mch logic X mch trn tho mn cc yu t: - Mch c s m t 000 n 111 nn Qn+1 s l 001 n 000 (111 reset v 000) - T trng thi ra da vo bng trng thi kch ng vo phn trn ta c th xc nh c logic cn thit ng vo J, K ca 3 tng FF khi c xung kch ck th chuyn ln trng thi tip theo. Vi cc ng vo ca X l cc ng ra ca cc FF v cc ng ra ca X li l cc ng vo kch ca cc FF, ta c bng chuyn trng thi ca X khi m:

181

By gi, lp ba K vi Q0, Q1, Q2 l cc bin ng vo trong khi cc ng J, K ca 3 tng FF li tr thnh ng ra. Ba K cho 6 ng ra nh sau :

T y, rt gn biu thc ta c cc hm logic din t mch logic X: J0 = K0 = 1 J1 = K1 = Q0 J2 = K2 = Q0Q1

182
Ni mch X va tm c vo mch trn c th: hai ng vo J, K ca mi FF c ni chung vi nhau (thnh ng vo T), FF 0 c ng T ni ln cao, FF1 c ng vo T ni n ng ra Q0 cn FF 2 c ng vo T l ng ra cng And m 2 ng vo l Q0 v Q1. Kt qu cui cng l mch m nh hnh sau

Hnh 3.3.28 mch m mod 8 BI TON 2: Thit k mch m ln/xung mod 4 dng FF JK iu khin ng c bc. Trn thc t, ngi ta ch to c cc vi mch m rt a dng v c th p ng c mt cch kh y cc nhu cu thc tin v lm vic rt n nh. Do , vic thit k mch m s ch mang yu t cng c kin thc v FF nu nh khng c cc ng dng nh v d sau: Thit k mch iu khin tc v o chiu quay ng c bc. * Tm hiu ng c bc (step motor) ng c bc l ng c quay tng bc thay v chuyn ng lin tc. Cc cun dy cm trong ng c s cn c cp dng v ngt dng theo mt trnh t c th hnh thnh nn bc quay; v tn hiu iu khin dng s iu khin ng ct dng in trong cc cun dy ca ng c. ng c bc rt thng dng v c s dng trong nhiu lnh vc c bit i hi iu khin chnh xc nh u c ghi a t, iu khin u in my in, trong tay my, ngi my (c cng sut b)

Hnh 3.3.29 ng c bc

183
Hnh trn l s mt ng c bc c trng vi 4 cun dy t tnh. cho chnh xc, cun 1 v 2 phi lun trng thi ngc nhau (tc l cun 1 c cp in th cun 2 ngt v ngc li nh vy ta c th ni ti 2 u ra Q vo ca mt FF JK. Tng t vi cun 3 v 4 cng phi ngc trng thi nh gia cun 1 v 2. o chiu quay ngi ta dng mt ng iu khin chn chiu quay cho ng c v k hiu l C. Ng C c lp vi vic chuyn trng thi hin ti v k tip ca cc ng ra. * Thit k mch iu khin Nh vy c th tm lt bi ton nh sau:

Tn hiu iu khin tc l fx v o chiu quay l C, khi thay i hai tn hiu ny mch s thay i tc v chiu quay tng ng. Dng 2 FF JK thit k mch m ln/xung tng ng vi o chiu quay nh vo mch gii m 4555/4556 (la chn mt trong hai IC ny tu thuc vo mch m li cc cun dy ng c bc). Nh vy mch m cn thit k c th tm lc nh sau:

184

Lp bng trng thi logic vi QA = A v QB = B v C l ng vo chn chiu quay, tnh ton tng t nh bi ton trc ta c:

T bng trng thi logic, ba K c v v biu thc logic c rt gn l: JA = C.B +C KA = C + C.B

185
JB = C + C.A KB = CA + C * Kt qu Cui cng ta c cu trc mch vi y cc ng vo ra

Hnh 3.3.30 Gin m cho ng c bc

Hnh 3.3.31 Mch m dng trong h iu khin ng c bc

BI 8: NG DNG MCH M
Mch m chia 2 hay khng chia 2 ( m chia 10, m chia 6, m chia cho 12), khng ng b hay ng b, c ng dng rng ri nhiu lnh vc. cc ng dng nh vy mch m c dng kt hp vi nhiu loi mch khc nh dao ng, so snh , gii m,.. Phn ny ch nu mt s loi mch ng dng chnh ca mch m v c n gin, chng s c trnh by dng s khi. Hn

186
na, ngy nay c nhiu IC tch hp quy m ln hay rt ln (LSI, VLSI) kt hp nhiu chc nng khin mch tr nn n gin hn, nhng y ch dng cc IC ri v d trnh by nguyn l. 5.1 m nhiu hng hay chia tn s lin tip Khi m s lng hin th ra s thp phn thng phi dng nhiu mch m chia 10, chng hn 7490. Mch m u tin ni c xung m vo l hng n v, mch m tip theo l hng chc, tip theo na l hng trm. Ta cng c th ni mch m c nhiu s, s c gi tr thp nht l LSD v s c gi tr cao nht l MSD. V d m t 0 ln n 999 th cn 3 mch m mc ni tip. Vi s m ti a l 999 th tu theo du thp phn nm u m c cc tr s 999, 99.9, 9.99, .. S m cc mch m c a vo khi hin th gm mch gii m v cc n hin th (xem chng 9). mch hnh khi mch m 7490 th 1 m y tc t n s m 1001 = 910, th nu c thm mt xung vo na mch m s t ng reset v 0 tc ng ra QD ca n s t 1 xung 0 to cnh xung n ng vo CLKB ca mch m 7490 th lm ng ra ca mch m ny l 0001 = 1. S m lc by gi ca 2 mch m l 1010. Tip tc nh th mch m ln 11 19 ri 20 , 21 .29, 30, 31

Hnh 3.3.32 Mch m 2 hng

187
Cc chn IC m, s ni mch v cc xung vo phi c thc hin ng b mch mi hot ng. Ngoi ra, cn phi sp xp ng xo xo mch khi cn. hnh v l mt cch nh vy : khi mi m in t cha np in nn ng xo cao xo cc mch 5m, sau thi gian ngn (vi us), t np gn in khin ng xo xung thp cho php cc mch m m ln, mi khi cn xo mch th n nt a ng xo ln cao trong chc lt. Mt khc mch m c bn l mch chia tn nn trong nhiu ng dng mch 5m c dng nh mch 5chia tn. V d vi hai mch m thp gii mc ni tip nh hnh trn th tn s ng ra QD ca 7490 th 2 l 1/100 tn s ca xung vo. Dng cc ng ra khc thay v QD hay dng cc IC m khng phi thp giai (nh 7493, 7492) ta s c s chia tn mong mun. <v u trang> 5.2 Mch m s kin Cc IC m thng c coi l trung tm ca cc mch m bin c hay s kin chng hn m s xe vo bi, s ngi i qua ca, s sn phm i trn bng truyn c ng gi. Hnh di minh ho cho mt mch m nh vy Ta s phi cn mch pht hin hay cm bin chuyn i nhng thay i ca cc hin tng trn thnh xung in kch cho mch m. Nu cn, c th thm mch lc nhiu, khuch i v chuyn i ph hp vi ng vo IC m Khi nhn c xung kch vo chn ck, IC m s m ln ,tu theo gii hn s xung vo m ta c th ni chng thm nhiu IC m cho s m ln hn. Mch gii m v hin th nh bit s cho php bit c s ngi i vo cng Gi s yu cu ra l ch cho php 99 ngi vo, nh vy cng cn thm 1 mch bo trn khi s ngi vt qu s m ca mch (mch s reset) th led s sng v nh hnh v ta c th ly mc tn hiu trn ny iu khin m ngun cho 1ng c ng ca li. y thit k ti s m l 99 bn cng c th thit k s m tu , khi ny phi dng cc mch m ph hp, cc cng logic thm vo cho php bo trn mt s tu (thit k t hp ng ra)

188

Hnh 3.3.33 Hnh minh ho mch m s kin <v u trang> 5.3 Mch m tn My m s kin (m tch lu) trn c th c thm mt s mch in tr thnh my m tn s (frequency counter). My m tn s y kh phc tp. y ch trnh by nguyn l ca my m tn s n gin. Hnh di l s khi m phn trung tm gn ging nh my m s kin

189

Hnh 3.3.34 Cc khi mch m tn Trc tin l mch dao ng, v d dao ng cng logic m ta c bit, v chia tn s xung c tn hiu TTL i xng tn s 0,5Hz. y l tn hiu iu khin c chu k l 2s vi thi gian cao l 1w v thp l 1s. u chu k tn hiu xung m cng(t mch dao ng chia tn) ln cao m cng And cho xung vo khi m (sau khi c x l nh khuch i, lc, nn dng mch giao tip) v mch m m ln sau ng 1s xung m cng xung thp ngn khng cho xung vo khi m. ng thi khi xung m cng va xung thp mch to xung cht s to xung hng dng hp cht s m ca khi m vo khi cht (khi cht c bn l cc FF D), y s m c lu gi cho n khi s m mi c cht vo. S m cht c gii m v hin th. V cng And ch m ng 1s nn nu c n xung vo th s m l n v tn s l n Hz. Do mch hnh trn cho php o tn s t 0 Hz ln n 9999 Hz. Trn tn s 9999 Hz (t s xung vo khi m trong 1s ln hn 999 xung) n bo trn s sng (hoc mt cch bo trn no khc v d nh nhy ton mt s hay hin ln s 1 hng cao nht tc MSD).

190
Khi xung m cng t cao xung thp v s m c cht vo nh ni trn th cnh xung ca xung m cng qua mch dao ng a hi n n cho xung ra c cnh xung tr hon mt thi gian ngn so vi cnh xung ca xung vo, cnh cung ca xung ra n mch to xung reset pht ra xung reset thch hp cho cc mch m v mch bo trn. Sau xung m cng li ln cao v xung vo c m trong ng 1s . , sau ng 1 s xung m cng xung thp v s m ln 2 c cht vo. Trong sut thi gian xung thp v cao tr li, tng cng 2s, my vn hin th s m ln 1. Khi s m ln 2 c cht vo my s hin th s m ln 2 m c th ging hay khc trc. Mch tip tc hot ng theo chu k trn. 5.4 ng h s : Phn ny trnh by v ng h s dng linh kin ri. Thc ra gi y mch dng ny khng cn c s dng na v cng ngh tch hp cho php to ra cc ng h s nh gn tn in, nhiu chc nng hay c th dng vi iu khin vi x l lp trnh cho ng h s. Tuy nhin ng h s dng ny cho php ngi hc hiu c nguyn l v bit c ng dng thc t ca mch m nn vn c nu ra y. S khi ca mch nh hnh di y :

Hnh 3.3.35 Khi ng h s (kiu c)

191
Ngun dao ng tn s 1 Hz cung cp cho ng kch ck c ly t mch dao ng thch anh kt hp cng logic (nu mun chnh xc), ly t dao ng 555 (nu mun tng i chnh xc) hay ly t li in xoay chiu 220V/50Hz chia p, lc, nn dng v chia tn cng c. Tn s 1Hz kch cho mch m 7490 cho php hin th hng giy led 7 on cng lc chia 10 ng ra QD cung cp xung cho mch m sau, tc l tn s chia cn 0,1Hz Tng t tn s 0,1Hz kch cho 7492 m hin th hng chc giy led 7 on, ng thi chia 6 ng ra to xung kch cho hng pht C vy cch chia v hin th trn cho php chia tn s ti 1/gi v hin th ti hng gi. hin th hng chc gi (ch l 0 hay 1) th cn dng 1 FF JK l (m mod 2 dng 1 na IC 74LS73) : khi QD ca 7490 k trc t cao xung thp (sau khi m 9) th s to xung kch cho FF JK ny lm n lt trng thi ng ra, tc l Q ln cao lm sng s 1. Khi ng ra Q0, Q1 ca 7490 v ng ra Q ca na 74LS73 u (FF JK u) u ln 1 th khi ny ng h ch bo 12 gi 59 pht 69 giy cng 1 giy v ng ra ca cng Nand xung thp xo FF v xo mch m 7490 k . Hai hin th gn vi 2 mch ny quay v 0. hin th ch AM, FM ta dng FF JK th 2 ca 74LS73 : khi Q ca FF JK u xung thp th Q ca FF JK th 2 ln cao, mc ny cho php hin th ch AM, cn khi Q ca FF JK u xung thp mt ln na th khi ny ca FF JK th 2 s ln cao tc l ch PM c thy cn ch AM mt. Hin th AM/PM n gin ch l cp mc p cao phn cc cho led hnh AM/PM khng phi dng mch gii m nh cc hng trc.

Chng 4 B NH BN DN
Vi mch nh ng mt vai tr ht sc quan trng trong in t s, c bit l trong cu trc ca my vi tnh. y l ni lu tr thng tin gip my tnh x l tnh hung thc t theo chng trnh nh trc. Chng ny trnh by cc vn sau: Bi Bi Bi Bi Bi Bi Bi 1: 2: 3: 4: 5: 6: 7: Cc khi nim c bn Cu trc b nh bn dn Nguyn l lm vic Phn loi b nh bn dn Gii thiu vi mch in hnh M rng dung lng b nh Cc mch ng dng

192

BI 1: CC KHI NIM C BN V B NH BN DN
Trn thc t c rt nhiu dng b nh, c th nh: - B nh c kh: h thng cng tc hnh trng/cam - B nh t: a cng, a mm, bng t - B nh quang: a CD ROM, bng giy c l So vi cc b nh trn, b nh bn dn c mt s u im nh tc x l, kch thc nh gn, d dng trong iu khin vic truy xut d liu... Trong thc t khi s dng b nh bn dn, ngi ta thng lu cc thng s sau:

Hnh 4.1: B nh bn dn Cc BUS l mt tp hp cc dy dn c s dng mang tn hiu i trao i thng tin gia cc thit b trong h vi x l. in hnh mt my tnh 8 bit c cc thanh ghi vi rng 8 bit v 8 ng trong 1 BUS d liu. Mt my tnh 16 bit c cc thanh ghi 16 bit, BUS d liu c 16 ng C th dng hnh nh ng giao thng minh ho cc BUS (Hnh 4.2): trn ng giao thng c nhiu a im nh A, B, C, D Nu ch dng dy in ni (ni cng) ta phi tn rt nhiu ng dy lin kt gia cc a im li vi nhau nhng khi i trn ng, li xe d khng thng tho vng ny c i dc xa l l c th tm n a im cn n. R rng vi mt BUS ta c th lin kt nhiu thit b trong h vi x l li vi nhau (mi thit b c th xem nh mt a im trn ng giao thng cn xe mang thng tin trao i gia cc thit b trong h thng).

193

Hnh 4.2: Minh ho BUS thng qua hnh nh ng giao thng. Da vo tnh cht thng tin ti trn Bus, ngi ta phn lm ba loi chnh: o Tuyn a ch: y l bus 1 chiu, c s dng xc nh a ch ca vng nh trong b nh bn dn, ni m b nh chn truy xut d liu. o Tuyn iu khin: y l bus 1 chiu nhng hnh v tng quan th xem nh hai chiu. Tuyn ny xc nh vic c hay vit d liu trn b nh bn dn. C th, d liu c vit vo vng nh c chn hay t xut i. Ngoi ra, cho php b nh ngng lm vic (treo: khng dng n) cng do tn hiu trn tuyn iu khin ny quyt nh. o Tuyn d liu: y l bus 1 chiu vi ROM v l 2 chiu vi cc b nh khc, c s dng mang d liu t vng nh c chn bi tuyn a ch trong b nh n cc thit b khc nh CPU, ROM, RAM v cc cng nhp/xut (I/O) trong h thng. Thi gian truy xut (Access Time) l thi gian cn thit thc hin hot ng c, ngha l thi gian t lc b nh nhn c a ch mi u vo cho n khi d liu sn sng cho u ra. K hiu at hay tACC. Dung lng (Capacity): Ni ln s bit ti a c kh nng lu tr trong b nh. V d c mt b nh lu tr c 2048 t 8 bit. Nh vy b nh c dung lng ca b nh l 2048 x 8, trong i lng th nht (2048) l tng s t, v i lng th hai (8) l s bit trong mi t (kch c t). S t trong b nh thng l bi s ca 1024. n v chuyn i nh sau: 1 byte = 8 bit

194
1Kbyte = 210 = 1024 bit 1Mbyte = 2020 = 1,048,576 bit 1Gbyte = 230 = 1,073,741,824 bit nh (Memory Cell): l phn t, linh kin in t c kh nng lu tr mt bit n (1 hay 0). V d nh flip flop (FF), t tch in, mt vt trn bng t. T nh (Memory Word): l mt nhm bit trong b nh biu din cc ch th hay d liu thuc loi no . V d nh thanh ghi gm 8 Flip-Flop c th xem nh l b nh c kh nng nh 1 t m 8 bit. Kch c t trong mt h thng in t s thng bin thin trong khong 4 n 64 bit. 1.2 T CHC B NH BN DN 1.2.1 Hot ng ca b nh minh ho vic truy xut d liu trong b nh bn dn, c th mn hnh nh t ng h s trong cc cng s (hnh 4.3 a). Mi mt hc t trong t h s c nh s theo nguyn tc nh sau: ch s u tin (nh theo h 16) ca hc l con s ch th t hng ca hc ny; ch s u th hai (cng nh theo h 16) ca hc l con s ch th t ct ca hc ny. Do mi mt hc t u c mt m a ch c ghi di dng m 16 ring, ch ra v tr ca hc trn t h s. Gi s khi mun a mt h s mi (d liu) vo hc t c m s l 03, ta ch vic trng phng t hng 0 vi ct 3 l gp hc t ny. Vic ghi hay np d liu l tu vo tuyn iu khin. Khi s hc t khng gi s h s cn lu tr, ngi ta mua thm mt t cng loi vi t c v vic nh s a ch tng t nh c. Lc ny vic nh s phn bit gia 2 t ging nh lp m vng trong thu bao in thoi: c th xem t th nht l vng 1 v t mi mua l vng 2 (hnh 4.3 b). Khi cn lin h d liu trong cng mt vng th khng cn s dng m vng (ging nh gi in thoi ni ht), ch khi lin h gia hai vng khc nhau lc ny mi s dng n m vng (ging nh gi in thoi lin tnh). Ngha l h s khi trao i trong cng mt t, ta khng cn s dng thm mt s no trong m a ch nhng mun chuyn h s t t ny sang t kia bt buc phi s dng thm mt con s na trong m a ch (tng t nh m vng khi gi in thoi). C th, t c thm s 0 vo bn tri ca m a ch cn t mi thm s 1 vo bn tri ca m a ch. Nh vy 001; 011;

195
034; 075 l cc a ch ca cc hc trong t c v 101; 111; 134; 175 l cc a ch ca cc hc trong t mi (cng v tr vt l nhng khc t).

(a)

(b) Hnh 4.3: Hnh nh minh ho vic truy xut d liu trong b nh bn dn Minh ho vic nh s trn qua hnh 4.4. Bn tri l mt s in thoi tht, tng ng vi bn phi l cch nh s a ch trong b nh bn dn theo m hexa.

196

Hnh 4.4: Minh ho vic nh s trn vng a ch ca b nh bn dn. Hnh 4.5 minh ho mt b nh RAM trong chng trnh m phng SMS 32v23 (trnh by chng 4) trnh by ni dung v cch nh a ch cho tng nh cha ni dung nh cch thc t h s va nu trn.

Hnh 4.5: B nh RAM trong chng trnh m phng SMS 32v23 Cho v d n gin minh ho v nguyn tc hot ng ca b nh bn dn: khi bn mun gi mt l th cho bn mnh ang sng Php, bn phi ghi a ch ca bn mnh vo b th: chnh l thng tin trn tuyn a ch, xc nh ni m l th ca bn s n; vit vo th nhng thng tin m mnh mun gi ri cho vo b th dn li: l thng tin trn tuyn d liu; n bu in xc nhn vic mnh s gi l th sang Php theo a ch ghi trn b th: l thng tin yu cu t trn tuyn iu khin. Nh vy vic trao i thng tin trn b nh bn dn cng tng t nh vic trao i th t theo dng truyn thng m thi! S phi hp nhp nhng gia 3 tuyn s gip b nh hon thnh tt cng vic ca mnh: lu tr v trao i thng tin.

197
Hnh 4.6 minh ho s khi tiu biu cho mt ROM, gm c u vo a ch, u vo iu khin v u ra d liu. Gi s ROM c lp trnh vi d liu minh ho nh hnh 4.7. C th c 16 t d liu (nhm 8 bit) ring bit c ghi vo 16 a ch khc nhau di dng nh phn. HOT NG C c mt t d liu t ROM, ta phi lm nh sau: p u vo a ch thch hp, sau kch hot u vo iu khin.

Hnh 4.6: S minh ho 3 tuyn: d liu, a ch, iu khin

198

Hnh 4.7: Bng d liu tng ng vi cc a ch trong ROM V d mun c d liu ti a ch 0111 ca ROM (hnh 4.5) ta phi a A3A2A1A0 = 0111 vo cc chn a ch, sau p dng trng thi thp cho

CS .

u vo a ch c gii m bn trong ROM chn c d liu ng l 11101101. Gi tr ny s xut hin ti u ra D7 n D0.

BI 2: CU TRC B NH BN DN
B NH ROM
B nh ch c c (ROM) l mt dng ca b nh bn dn m n c thit k gi cho d liu khng thay i. Khi hot ng d liu mi khng th vit vo ROM c m ch c th c c. ROM c s dng lu tr d liu v tin tc. N khng lm thay i d liu trong sut qu trnh hot ng ca h thng. ROM ch yu thc hin chc nng c l chnh. 2.1 S KHI CA ROM Hnh 4.5 minh ha s khi tiu biu cho mt ROM, gm c u vo a ch, u vo iu khin v u ra d liu.

199

Gi s ROM c lp trnh vi d liu minh ha nh hnh 4.6. 16 t d liu khc nhau c ghi vo 16 a ch khc nhau di dng nh phn. Ngi ta cn s dng s thp lc phn biu din d liu lp trnh (hnh 4.7).

200

HOT NG C c mt t d liu t ROM, ta phi lm nh sau: p u vo a ch thch hp, sau kch hot u vo iu khin. V d mun c d liu ti a ch 0111 ca ROM (hnh 4.5) ta phi p A 3A2A1A0 = 0111 cho u vo a ch, sau p dng trng thi thp cho .

u vo a ch c gii m bn trong ROM chn c d liu ng l 11101101. gi tr ny s xut hin ti u ra D7 n D0. <V trang u> 2.2 CU TRC CA ROM Cu trc bn trong ca ROM rt phc tp. Hnh 4.8 l s n gin m t cu trc bn trong ca mt ROM c dung lng 16x8. Gm c 4 phn c bn: mng thanh ghi, b gii m hng, b gii m ct, b m u ra. Mng thanh ghi (Resister array) lu tr d liu c lp trnh vo ROM. Mi thanh ghi gm mt nh bng s kch thc t. Trong trng hp ny mi thanh ghi cha mt t 8 bit. Cc thanh ghi c sp xp theo ma trn vung, cc thanh ghi y l thanh ghi cht , khng ghi thm c.

201

V tr ca tng thanh ghi c nh r qua s hng v s ct c th. 8 u ra d liu ca mi thanh ghi c ni vo mt ng d liu bn trong chy qua ton

202
mch. Mi thang ghi c hai u vo cho php. C hai phi mc cao th d liu thanh ghi mi c php a vo dng truyn. B gii m a ch M a ch A3A2A1A0 quyt nh thanh ghi no trong dy c php t t d liu 8 bit ca n vo ng truyn. y dng 2 b gii m: b gii m chn hng (chn 1 trong 4) v chn ct. Thanh ghi giao gia hng v ct c chn bi u vo a ch s l thanh ghi c kch hot (cho php). V d: a ch vo l 1101 th thanh ghi no xut d liu. Vi A3A2 = 11, b gii m ct s kch hot ng chn ct s 3 Vi A1A0 = 01, b gii m hng s kch hot ng chn hng s 1 Nh vy kt qu l c hai u vo cho php thanh ghi s 13 s mc cao v d liu ca thanh ghi ny s c a vo ng truyn d liu. B m u ra Thng s dng mch m 3 trng thi, iu khin bng chn thp, b m u ra chuyn d liu ny ra ngoi. Khi s trng thi tr khng cao. D7 n D0 th ni. 2.3 THNG S THI GIAN CA ROM S c mt khong thi gian tr do truyn t khi yu cu c a vo qua u vo ca ROM n khi d liu xut hin u ra trong hot ng c. Thi gian ny gi l thi gian truy xut (tACC). Thi gian truy xut c biu din dng sng trong hnh 4.9. . Khi mc

mc cao, b m u ra

203

Dng sng pha trn biu din u vo a ch; dng sng gia l mt mc thp; dng sng di cng biu din u ra ca d liu.

tch cc

Mt thng s thi gian khc cng quan trng l thi gian cho php ra t OE. l thi gian tr gia u vo tACC ( TTL) : 30 90ns. tACC ( NMOS) : 200 900ns. tACC ( CMOS) : 20 60ns tOE (TTL) : ROM 10 - 20ns tOE ( NMOS) : ROM 25 - 100ns tOE ( CMOS) : ROM 10 20ns v u ra d liu hp l.

B NH RAM
RAM: Random Access Memory b nh truy xut bt k cn gi l b nh c vit (RWM: read write memory). Ngha l mi a ch nh u cho php d dng truy cp nh nhau. Trong my tnh RAM c dng nh b nh tm hay b nh nhp. u im chnh ca RAM c hay vit d liu lu tr RAM bt c lc no.

204
Nhc im ca RAM: do RAM l mt dng b nh bc hi nn khi mt in d liu s b xa do cn ngun nui pin accu d phng (back up batterry). Tng t nh ROM, RAM bao gm mt s thanh ghi, mi thanh ghi lu tr mt t d liu v c a ch khng trng lp. RAM thng c dung lng 1K, 4K, 8K, 64K, 128K, 256K v 1024K vi kch thc t 1, 4 hay 8 bit (c th m rng thm).

Hnh 4.16 minh ha cu trc ca n gin ca mt RAM lu tr 64 t 4 bit (b nh 64x4). S t ny c a ch trong khong t 0 n 63 10. chn 1 trong 64 a ch c hay ghi, mt m a ch nh phn s c a vo mch gii m. V 64=2 6 nn b gii m cn m vo 6 bit.

205
Hot ng c (Read Operation) M a ch nhn c t chn thanh ghi c hoc vit. c thanh ghi c chn th u vo c ghi ( ) phi l logic 1. Ngoi ra u vo chip select = 1 v = 0 s cho php b m u ra,

phi mc logic 0. S kt hp gia

sao cho ni dung ca thanh ghi c chn xut hin bn u ra d liu.

= 1 cng cm b m u vo nn u vo d liu khng tc ng n b nh sut hot ng c. Hot ng ghi (Write Operation)

vit mt t 4 bit mi vo thanh ghi c chn, khi cn phi c

= 0 v

= 0. T hp ny cho php b m u vo, v vy t 4 bit t vo d liu s c np vo thanh ghi chn. = 0 cng cm b m u ra. B m u ra

l b m 3 trng thi nn u ra d liu s trng thi Hi-Z trong hot ng ghi. Hot ng ghi s xa b t no c lu tr ti a ch . Chn chip (Chip Select) Hu ht cc chip nh u c mt hay nhiu u vo CS dng cho php ton chip hoc cm n hon ton. Trong ch cm, tt c u vo v ra d liu u b v hiu ha (Hi-Z), chnh v vy khng hot ng ghi c no c th xy ra. Ngoi tn gi CHN CHIP cc nh sn xut cn gi l CHIP ENABLE (CE). Khi u vo CS hay CE trng thi tch cc th chip nh c chn cn ngc li th khng c chn. Tc dng ca chn CS hay CE l dng m rng b nh khi kt hp nhiu chip nh vi nhau. Cc chn vo ra chung (Common Input Output) hn ch s chn trong mt IC, cc nh sn xut thng kt hp cc chc nng nhp/xut d liu, da vo chn vo/ra (I/O). u vo vo/ra ny. iu khin cc chn

206
Trong hot ng c, chn I/O ng vai tr nh u ra d liu, ti to ni dung ca nh c chn. Trong hot ng ghi, chn I/O l u vo d liu, d liu cn ghi c a vo y.

BI 3: NGUYN L LM VIC
3.1 HOT NG CA B NH. Mc d mi loi b nh u c hot ng ni ti khc nhau, nhng tt c b nh u c chung mt s nguyn tc hot ng c bn. Mi b nh cn thc hin cc chc nng sau: Chn ng a ch vng nh cn c hay vit. Chn ng hot ng c hay vit. Cung cp d liu nhp vo lu tr trong b nh sut hot ng ghi. Cho php (hoc khng cho php) b nh p ng (hay khng p ng) cc u vo a ch hay lnh c ghi. Lu tr d liu xut ra t b nh sut hot ng c. Hnh 4.1 m t mt b nh c bn 32x4 lu tr 32 t 4 bit.

V mi t y l 4 bit nn c 4 ng d liu vo t I 0 n I3 v 4 ng d liu ra t O0 n O3. Cc ng vo a ch A0 n A4 v cc ng iu khin c/ghi. Ng vo cc a ch:

207
V b nh cha 32 t nn c 32 v tr lu tr khc nhau v c 32 a ch khc nhau bin thin 00000 n 11111 ( t 010 n 3110). Hnh 4.2 cho thy cch b tr cc v tr nh v a ch.

V y c 5 u vo a ch A0 n A4 nn truy cp mt trong nhng v tr trong b nh cho cc hot ng c hay ghi th m a ch 5 bit ca v tr c th c cp cho u vo a ch. Nh vy, vi b nh c dung lng 2 N t i hi N u vo a ch. Ng vo u vo chi phi hot ng no s xy ra trong b nh: c (R) hay ghi (W). = 1 ( R mc cao) = 0 ( W mc thp)

Hot ng c xy ra khi Hot ng vit xy ra khi

Hnh 4.3 minh ha n gin hot ng c v ghi

208

Cho php b nh (Memory Enable) Cho php hay khng cho php cc ng vo, ra ca b nh hot ng. Ngoi tn ME cn c mt s tn khc nh cho php chip (CE) hay chn la chip (CS). u vo ny tch cc mc cao, ngha l cho php b nh hot ng bnh thng khi n ang mc cao. Nu u vo ny mc thp th n khng cho php b nh hot ng. V d 1: Trnh by trng thi ti mi u vo, ra khi d liu 1110 c ghi vo a ch 01101. Gii : u vo a ch: 01101 u vo d liu: 1110 : thp u vo cho php b nh: cao u ra d liu: xxxx (khng s dng) V d 2: Mt b nh c dung lng 4Kx8. Hi a. C bao nhiu u vo d liu v u ra d liu?

209
b. C bao nhiu ng a ch? c. Dung lng ca n tnh theo byte? Gii a. Bi v dung lng 4Kx8 nn c 8 u vo, 8 u ra, kch c t l 8 bit. b. B nh lu tr 4K= 4x1024 = 4096 t. V vy c 4096 a ch nh. V 4096 = 2 12 nn cn c m a ch 12 bit nh r mt trong 4096 a ch, cn 12 ng a ch. c. Mt byte = 8 bit nn b nh ny c dung lng 4096 bit. 3.2 CCH NI KT GIA CPU V B NH. Hu ht cc my tnh hin i ngy nay b nh chnh lun giao tip vi CPU. B nh chnh ca my tnh cu thnh t cc IC ROM v RAM. Cc IC ny giao tip vi CPU thng qua ba nhm ng truyn (bus) a ch, ng (bus) d liu v ng ( bus) iu khin. Hnh 4.4 minh ha cch kt ni cc nhm truyn (bus) ni t IC ca b nh chnh vi CPU.

Hot ng ghi CPU gi vo ng a ch (address bus) a ch vng nh mun lm vic. CPU t d liu cn lu ln cc ng truyn ca bus d liu. CPU kch hot cc ng tn hiu iu khin thch hp cho hot ng ghi vo b nh. Cc IC nh gii m a ch nh phn nhm xc nh u l v tr c chn cho hot ng lu tr. D liu trn bus d liu c truyn n v tr nh chn.

210
Hot ng c Bt c khi no CPU mun c d liu ti mt v tr nh c th u phi din ra cc buc sau: CPU cp a ch nh phn ca v tr nh cha d liu cn truy xut. N t a ch ny ln ng truyn ca bus a ch. CPU kch hot cc ng truyn tn hiu iu khin thch hp cho hot ng c b nh. Vi mch nh gii m a ch nh phn nhm xc nh u l v tr nh c chn cho hot ng c. Vi mch nh t t d liu t v tr nh c chn vo cc ng truyn d liu, t d liu c chuyn n CPU. Qua hai hot ng ghi v c ta thy c chc nng ca cc ng bus nh sau: Bus a ch: y l bus mt chiu mang kt qu xut a ch nh phn t CPU n IC nh chn mt v tr nh. Bus d liu: y l bus hai chiu, chuyn ti d liu qua li gia CPU v b nh. Bus iu khin: Bus ny truyn tn hiu iu khin t CPU n cc IC nh.

BI 4: PHN LOI B NH BN DN
CC LOI ROM
4.1 ROM LP TRNH BNG MT N (Mask Programed ROM) Vi ROM c lp trnh bng mt n, nh sn xut ghi (lp trnh) cc v tr nh ca n theo yu cu ca khch hng. Mt phm m bn, gi l mt n c s dng kim sot cc mi ni in trn chip. V mt n rt t nn loi ROM ny khng c mang li hiu qu kinh t. Nhc im ca loi ROM ny l n khng cho php lp trnh li, v vy n l dng ROM ng ngha. Tuy nhin ROM c lp trnh bng mt n vn ch l phng php tit kim nht khi cn trang b s lng ln ROM cng loi. Hnh 4.10 trnh by cu trc ca mt MROM TTL nh, gm 16 nh c sp xp thnh 4 hng x 4 ct. Mi l mt transistor lng cc c kt ni theo cc C chung. Gii m 1 sang 4 ng c s dng gii m a ch ng vo A 1A0 khi

211
chn thanh ghi hng c d liu. Mch gii m trng thi cao cung cp cho php gii m hng ca ng vo cc B cho gi tr ca nh.

V d : Mt MROM c ng lu tr bng gi tr cc hm ton hc: y = x2 + 3, vi x l ng vo, y l ng ra. Ta c bng gi tr sau: S x biu th qua gi tr A1A0. Khi x = A1A0 = 102 = 210 suy ra y = 22+ 3 = 710 = 01112

4.2 ROM CHO PHP LP TRNH (Programmable ROM PROM) PROM c cu to nh ROM nhng c hai c im khc bit, l: Tt c cc t bo nh u c diode hay transistor lng cc hay transistor MOS, ty theo cng ngh ch to.

212
Phn t bn dn c ni vi cu ch tch hp. Cu ch t ri khng th ni li c do ta ch c th lp trnh PROM mt ln thi. Mun i t bit 1 sang bit 0 ngi ta dng mt xung in c bin v rng xung thch hp (cho bit bi nh sn xut) gia ng t v ng bit tng ng lm t cu ch. Hnh 4.11 minh ha hot ng lp trnh ca mt PROM

4.3 ROM CHO PHP LP TRNH GHI XO C (Erasable PROM EPROM) PROM ch lp trnh c mt ln v cu ch t khng th ni li c t bn ngoi. Nn khi np chng trnh sai hay mun i chng trnh th ta phi dng mt PROM mi. Do ngui ta ch to ra loi EPROM cho php ngi s dng c th lp trnh v xa c. Cch np nh sau t mc in p t bit (t 25V 50V ty loi) vo ng vo (+Vpp) v cn mt thi gian (50ns cho mt vng nh) do thi gian np mt EPROM mt vi pht. nh trong EPROM l nhng transistor MOS vi cng logic silic th ni. trng thi bnh thng mi transistor u tt v mi nh lu tr logic 1. Xung in p s y cc electron nng lng cao vo khu vc cng th ni v chng vn cn kt trong lc xung in kt thc, do khng c ng phng in. V vy transistor c tip tc m ngay khi ngt in vi thit b v nh lc ny lu tr logic 0. Khi mt nh ca EPROM c lp trnh th c th xa n bng cch chiu tia cc tm (UV) qua mt ca s trn v chip. Tia UV to mt dng quang in t cng th ni tr v chn bng silic, qua n xa i cc in tch lu tr, tt transitor v phc hi nh v trng thi logic 1. Qu trnh xa ny thng cn t 15 n 20 pht. Nhc im ca EPROM:

213
Phi tho EPROM ra khi mch mi xa ri mi np trnh c. Khi cn xa hay thay i mt t cng khng th np chng ln t m phi xa ht v np li t u. 4.4 ROM CHO PHP LP TRNH V XA C BNG IN (Electrically Erasable PROM EEPROM) Khuyt im ca EPROM c khc phc vi s ra i ca EEPROM. EEPROM gi li cu trc cng th ni ca EPROM, nhng c thm mt lp oxit rt mng pha trn cc mng ca nh MOSFET. S b xung ny hnh thnh nn c im chnh ca EEPROM l kh nng xa bng in. Nguyn l cn bn ca EEPROM cng ging nh EPROM dng cu trc tha ni. Nh thm vo mt lp oxide mng gn cc thot ca t bo MOSFET, khi p in cao (21V) gi cc G v D vi mt lng in tch c th len vo cng ni lu tr ti ngay c khi ngng cung cp in tch khi cng ni v xa nh. Do c ch truyn in tch ny ch i hi dng in rt thp nn vic xa v lp trnh EEPROM c th thc hin ngay trong mch (khng cn ngun UV v my lp trnh PROM c bit). u im ca EEPROM C kh nng np tng t ring l (khng ging nh EPROM phi np c IC). Xa rt nhanh (10ms trn mch ) so vi 30 pht phi nh sng UV. Np rt nhanh (10ms so vi 50ms ca EPROM). c tnh np - xa trn mch EEPROM cn c ngun 5V(Vcc) v 21V : ly t 5V qua b chuyn i DC-DC. Mch khng ch xung 10ns to cho qu trnh np v xa. NG DNG CA ROM Lu tr chng trnh chy my tnh Lu tr chng trnh chi ng my (boottrap memory). Hot ng nh mch t hp, ROM m nhim chc nng nh PLA (programmable logic array chui hm logic) Bng d liu: cha cc d liu cn tham kho chng hn nh bng chuyn i m, bng cc gi tr lng gic. B to k t nh to cc k m ASCII. Mch to dng sng (function generator) l mt mch to cc dng sng nh hnh sine, sng rng ca, sng tam gic, sng vung.

214

CC LOI RAM
5.1 RAM TNH (Static RAM) l RAM c th lu tr d liu n khi no chip vn cn c cp in. Ngy nay RAM lng cc tnh c ch to theo cng ngh TTL, cng ngh ECL t n dung lng nh hn 16Kbit, thi gian truy xut di 10ns v cng sut tiu th di 0,1mW/bit v cng ngh NMOS, CMOS, HMOS, MIXMOS, XMOS vi dung lng 256Kb, thigian truy xut thp n 15ns. Bng di y l mt s thng s ca cc loi RAM tnh theo cc cng ngh ch to khc nhau.

T bng thng s trn cho thy: ECL c thi gian truy xut ngn nht ECL, TTL c dung lng nh hn CMOS, NMOS CMOS, NMOS c cng sut thp hn ECL, TTL. ECL c cng sut cao nht 5.1.1 Gin thi gian ca SRAM Cc IC RAM thng c dng lm b nh trong my tnh. Chip nh giao din vi CPU phi nhanh mi p ng c cc lnh c v ghi ca CPU. Khng phi tt c cc loi RAM u c c im thi gian nh nhau. Hnh 4.17 biu din s thi gian cho mt chu k c v chu k ghi hon chnh ca mt chip SRAM in hnh.

215

Hnh 4.17 S thi gian tiu biu ca SRAM 5.1.2 Chu k c Dng sng hnh 4.17a minh ha hnh vi ca u vo a ch chu k c ca b nh. Chu k c bt u ti thi im t0. Trc thi im ny, u vo a ch c th l bt k a ch no c sn trn bus a ch t hot ng ngay trc . V u vo ca RAM khng tch cc nn n s khng p ng a ch c. Ti thi im t 0 CPU , u vo trong

216
cung cp a ch mi cho u vo ca RAM, y chnh l a ch ca v tr nh cn c. Sau thi gian n nh tn hiu a ch, ng c kch hot. RAM p ng bng cch thay t d liu t v tr nh c a ch xc nh vo ng ra d liu ti thi im t1. tACC l thi gian truy cp ca RAM. tCO l thi gian cn thit u vo ca RAM i t mc Hi-Z n mc d liu hp l mt khi tch cc. Ti thi im t2, tr v mc cao, v u ra ca RAM tr v trng thi Hi-Z sau khong thi gian tOD. Vy d liu ca RAM s trn bus d liu trong khong thi gian t t1 n t3. Thi gian ca mt chu k hon chnh l t RC, ko di t t0 n t4 khi CPU thay i u vo a ch mi cho chu k c/ghi khc din ra tip theo. 5.1.3 Chu k ghi Hnh 4.17b biu din hot ng ca tn hiu cho mt chu k ghi bt u khi CPU cung cp a ch mi cho RAM ti thi im t1. CPU a v xung thp sau khi

ch qua khong thi gian tAS, thi gian thit lp a ch, cho php b gii m a ch ca RAM c thi gian p ng a ch mi. gi l thi gian duy tr d liu. Trong thi gian ghi, ti thi im t1, CPU cung cp d liu hp l cho bus d liu ghi vo RAM. D liu ny phi c duy tr ti u vo ca RAM t nht mt khong thi gian tDH sau khi v khng cn tch cc ti thi im t2. Tng t, u vo v b gi mc thp trong

khong thi gian tW gi l thi gian ghi. tDS gi l thi gian thit lp d liu cn tDH

a ch phi tip tc n nh trong khong thi gian duy tr a ch, tc sau thi im t2. nu khng tha bt k iu kin no v thi gian thit lp v thi gian duy tr th hot ng ghi xy ra s khng ng tin cy. Thi gian ca mt chu k ghi hon chnh t WC ko di t t0 n t4 khi CPU i sang a ch mi cho chu k c/ghi tip theo. 5.2. RAM NG (DRAM) Ram ng c t bo nh l mt FF. RAM ng dng k thut MOS lu tr cc bit 0 hay 1 trong cc in dung bm sinh gia ca v lp nn cu transistor MOS. D liu ny lu tr t ny khng c duy tr lu v s r ca t cng nh ca cc transistor MOS chung quanh nn cn c lm ti (refresh) trong khong vo mili giy (nu khng t x in s mt d liu). S lm ti t cn phi c b iu khin (Dynamic Memory Controller) bn ngoi v trn cng vi mch. V y cng l nhc im ca RAM ng so vi RAM tnh.

217
Nhng ngc li RAM tnh cng c nhiu u im nh: dung lng nh, tc , cng sut tiu th, gi thnh h. Ngy nay RAM ng c ch to theo cng ngh nh NMOS, CMOS, CHMOS, XMOS vi dung lng nh trn Megabit, thi gian thm nhp di 100ns v cng sut tiu tn rt nh. Bng di y cho bit mt vi thng s so snh gia RAM tnh v RAM ng

5.2.1 Cu trc v hot ng ca DRAM. Cu trc bn trong ca DRAM c th hnh dung nh mt mng nh bit n, c minh ha nh hnh 4.18. y, 16384 nh c sp xp thnh ma trn 128 x128. Mi nh chim mt v tr ring bit trong hng v ct thuc phm vi ma trn. C 14 u a ch chn 1 trong 16384 nh (214 = 16384); nhng bit a ch thp t A0 n A6 chn hng, cn nhng bit a ch cao t A7 n A13 chn ct. Mi a ch 14 bit chn nh ring bit c ra hay ghi vo.

218

Hnh 4.19 l k hiu mt nh ng v mch tng ng ca n. Da vo s n gin ny ta c th hiu c cch c hay ghi d liu vo DRAM. Cc chuyn mch t SW1 n SW4 thc cht l cc transistor MOSFET c iu khin bng cc u ra khc nhau ca b gii m a ch v bng tn hiu nhin y t in mi l nh ch thc. tuy

Khi ghi d liu th cng tc SW1 v SW2 ng li trong khi cng tc SW3 v SW4 vn m, ni d liu nhp vo t C. logic 1 ti u vo d liu tch in cho t C cn

219
logic 0 th x in cho t C. V lun c s r in qua cc chuyn mch ng nn t C b mt in dn.

c d liu ti nh th chuyn mch SW2, SW3 v SW4 ng li cn SW1 vn m ni in th lu tr vi b khuch i. B khuch i s so snh in th ny vi gi tr tham kho no quyt nh l logic 1 hay logic 0, ri a ra gi tr 0V hay 5V cho u ra d liu. u ra ny li c ni vi t qua SW2 v SW4 nn t in s c lm ti. Nh vy bit d liu trong nh c lm ti mi khi n c c. 5.2.2 Dn knh a ch - Address Multiplexing (ghp a ch) Hin nay cc nh sn xut sn xut ra nhiu loi DRAM vi dung lng kh ln. Vi cc loi DRAM c dung lng ln th i hi phi c nhiu chn vo a ch nu yu cu mt chn ring bit. khc phc yu im ny cc nh sn xut s dng phng php ghp knh a ch. Bng cch ny mi chn vo a ch c th dung np hai bit a ch khc nhau, tit kim c s chn gip gim ng k kch c ca v IC. Hnh 4.20 trnh by b nh c dung lng t 16K v trc cn 14 ng a ch bus ti trc tip t CPU n b nh.

220

Hnh 4.21 minh ha a ch CPU dng mch Multiplex a a ch t CPU ti DRAM. Ta thy ch c 7 ng a ch ng vo n DRAM, ngha l 14 ng a ch t bus a ch CPU c a vo mch Multiplexer s truyn 7 bit a ch ti thi im no ti ng vo a ch nh. Khi MUX = 0 th truyn A 0 A6 n DRAM, khi MUX = 1 th truyn A7 A13 n DRAM.

221

Gin thi gian ca tn hiu MUX Thi gian ca tn hiu MUX phi ng b vi tn hiu thp khi v . MUX phi mc

b kch xung mc thp, sao cho cc ng a ch A7 A13 t CPU s b kch

n c u vo a ch DRAM. Tng t MUX phi mc cao khi xung thp, sao cho A0 - A6 t CPU s c mt ti u vo ca DRAM. Hnh 4.22 minh ho thi gian ca tn hiu MUX.

222

Hnh 4.23 cho thy cu trc ca mt DRAM 16Kx1 sau khi dng MUX

5.2.3. Chu k c/ghi ca DRAM

223
Chu trnh c/ghi ca DRAM phc tp hn nhiu so vi SRAM bi v cn c b nh thi khng ch lm ti v b iu khin b m ca thanh ghi, b a hp hng ct thng qua hai chn Chu k c DRAM Hnh 4.24 biu din hot ng tiu biu ca tn hiu trong sut hot ng c. v .

Gi s

ang mc cao trong sut hot ng c. Sau y l phn m t tng

bc hot ng xy ra ti nhng thi im trong s tn hiu. t0 : MUX b a xung mc thp p cc bit a ch hng ( A0 A6) vo u vo a ch ca DRAM. t1 : b a xung mc thp np a ch hng vo DRAM

t2 : MUX ln mc cao t a ch ct (A7 A13 ) ti cc u vo a ch ca DRAM. t3: xung thp np a ch ct vo DRAM.

t4 : DRAM p ng li bng cch t d liu hp l t vo nh c chn ln ng d liu ra. t5 : MUX, , v ng d liu ra tr v trng thi ban u.

Chu k ghi ca DRAM

224
Hnh 4.25 biu din hot ng tiu biu ca tn hiu trong hot ng ghi vo DRAM.

Qu trnh ghi c m t nh sau: t0 : MUX mc thp t cc bit a ch hng ( A0 A6) vo u vo a ch ca DRAM. t1 : = NGT np a ch hng vo DRAM

t2 : MUX ln mc cao t a ch ct (A7 A13) ti cc u vo a ch ca DRAM. t3: = NGT np a ch ct vo DRAM.

t4 : D liu cn ghi c t ln ng d liu vo. t5 : b kch xung thp ghi d liu vo nh c chn.

t6 : D liu vo b loi b khi ng d liu vo. t7 : MUX, , v ng d liu vo tr v trng thi ban u.

5.2.4. Lm ti DRAM

225
Vic lm ti DRAM phi c xy ra mi 2ms duy tr d liu. Mi mt trong 256 hng phi c kch bi chn . c th mc cao trong trnh t lm

ti gim cng sut tiu th. D c hay vit vo mt t bo no ca mt hng u phi lm ti ton b hng . lm ti DRAM cn phi c b m lm ti DRAM (Refresh Controler). Phng php l ti ph bin nht l lm ti ch vi chn mt a ch hng vi trong khi v , thc hin bng vic la vn mc cao.

Click vo mc di xem cc vi mch nh in hnh

BI 5: GII THIU VI MCH S IN HNH


5.1 CHIP EPROM M2732A Hin nay trn th trng c nhiu loi EPROM vi dung lng v thi gian truy xut khc nhau. IC 2732A l loi EPROM NOMS nh c dung lng 4Kx8 hot ng vi ngun in +5V trong sut tin trnh vn hnh bnh thng. Hnh 4.12 minh ha s chn v cc ch hot ng ca IC ny. IC M2732A c 12 u vi a ch v 8 u ra d liu. Hai u vo iu khin l v . l u vo cho php ca

chip, c s dng t thit b vo ch c i khi nng lng tiu th gim. Chn l u vo hai mc ch, c chc nng ph thuc vo ch hot ng cho php u ra v c s dng kim sot vng m u ra d

ca thit b.

liu ca thit b, sao cho c th ni thit b ny vi bus d liu ca b vi x l m khng xy ra chanh chp bus. Vpp l in th lp trnh t bit bt buc phi c trong sut giai on lp trnh.

226

Hnh 4.12 (a) K hiu logic ca EPROM M2732A; (b) S chn; (c) V EPROM vi ca s tia t ngoi; (d) Ch hot ng ca EPROM M2732A

227
5.2 Chip EPROM M27C64A IC EPROM M27C62A l loi EPROM c dung lng ln 8Kx8 v thi gian truy xut l 150ns. y l loi EPROM ang ph bin trn th trng, c hai dng v khc nhau ngi dng c th chn la tu theo nhu cu. Hnh 4.13 minh ha k hiu logic v chc nng ca cc chn EPROM M27C64A.

Ch hot ng ca EPROM M27C64A nh bng hnh 4.14

228

5.3 IC SRAM MCM6264C Mt loi IC SRAM thc t hin dn c mt trn th trng l MCM6264C CMOS 8Kx8 vi chu k c v chu k ghi l 12ns, cng sut tiu th ch standby ch l 100mW. S chn v hnh dng ca IC ny c minh ha trong hnh 4.28.

229

Cu trc bn trong ca IC SRAM nh hnh 4.29. y c 13 u vo a ch v 8 ng vo/ra d liu. 4 u vo iu khin quyt nh ch vn hnh ca thit b, theo nh bng cc ch hot ng hnh 4.30.

230

231

u vo

cng chnh l u vo

mc thp cho php ghi d liu vo mc cao

RAM, vi iu kin RAM ny c chn c hai u vo E u tch cc.

s cho php hot ng c, min l linh kin phi c chn v b m u ra c kch hot bng = LOW. Khi khng c chn linh kin ny s tr vo ch

nng lng thp, v khng c u vo no c hiu lc. 5.4 IC DRAM TMS44100 Hin nng trn th trng ang c mt IC DRAM TMS44100 4Mx1 ca hng Texas Intruments. S chn v chc nng ca cc chn c minh ha hnh 4.31.

232

Hnh 4.32 l s cu trc bn trong ca IC DRAM TMS44100.

Mt mng nh sp xp thnh 2048 hng x 2048 ct. B gii m a ch, do mi ln ch chn mt hng nn c th xem y nh l b gii m 1 trong 2048. Do cc ng a ch c dn knh nn ton b 22 bit a ch khng th xut hin cng mt lc. Mt iu lu l, y ch c 11 ng a ch v chng phi i n c thanh ghi a ch hng ln thanh ghi a ch ct. Mi thanh ghi a ch cha mt na a ch 22 bit. Thanh ghi hng lu tr na trn, thanh ghi ct lu tr na di. Hai u vo xung chn (strobe) rt quan trng chi phi thi im thng tin a ch

233

c cht li. u vo chn a ch hng bit. u vo chn a ch ct

m nhp thanh ghi a ch hng 11

m nhp thanh ghi a ch ct 11 bit.

Mt a ch 22 bit c p vo DRAM ny qua 2 buc, s dng u c ln

. Ban

u mc cao (hnh 4.33 minh ha thi gian).Ti thi im t 0,

a ch hng 11 bit (A11 n A22) c p vo u vo a ch. Sau thi gian cho php tRS cn thit t thanh ghi a ch hng, u vo b y xung thp ti

thi im t1. NGT (chuyn trng thi trn sn xung ca tn hiu) np a ch hng vo thanh ghi a ch hng sao cho t A11 n A21 lc ny xut hin ti u vo b gii m hng. mc thp cn cho php b gii m hng, hu c th

gii m a ch hng v chn c 1 hng trong mng. Ti ti im t2, a ch ct 11 bit (t A0 n A10) c p vo u vo a ch. Ti thi im t3 u vo xung thp np a ch ct vo thanh ghi a ch ct,

vy l c th tin hnh hot ng c hay ghi trn nh nh trong RAM tnh.

BI 6: M RNG DUNG LNG B NH BN DN


Trong thc t nhiu ng dng mt chip nh khng th p ng c, do vic m rng b nh v tng kch c t l mt vn ht sc cn thit. 6.1 TNG KCH C T

234
Gi s chng ta cn mt b nh c th lu tr c 16 t 4 bit, nhng thc t ta ch c cc chip RAM 16x4 vi cc ng vo/ra (I/O) chung. gii quyt vn ny ta c th kt hp hai chip 16x4 li vi nhau to thnh mt b nh mong mun. Hnh 4.26 minh ha cch kt hp ny.

Bi v mi chip ch c th lu tr 16 t 4 bit nn ta c th xem nh ang s dng mi chip lu tr phn na t. C ngha l RAM-0 cha 4 bit cao ca tng t

235
trong s 16 t, v RAM-1 cha 4 bit thp ca tng t trong s 16 t. Mt t c 8 bit c mt ti cc u ra ca RAM ni vi bus d liu. Nh vy th bt c t no trong s 16 t cng c chn bng cch a m a ch tng ng vo 4 ng ca bus a ch. iu ny c ngha l, mt khi c t ln bus a ch, m a ch s c p vo c hai chip, sao cho mi chip c truy xut cng v tr ng thi. Khi c a ch c chn, ta c th c hoc ghi ti a ch ny di s iu khin ca ng v ng chung.

c th

phi mc cao, cn

mc thp. iu ny lm cc ng I/O

ca RAM hot ng nh u ra. RAM-0 t t 4 bit c chn ca n ln 4 ng trn ca bus d liu, RAM -1 t t 4 bit c chn ca n ln 4 ng di ca bus d liu. Lc ny bus d liu cha t 8 bit hon chnh c chn.

ghi th

mc thp v

cng mc thp, lm cho cc ng I/O ca

RAM hot ng nh u vo. T 8 bit cn ghi c t ln bus d liu, 4 bit cao s c ghi vo v tr chn ca RAM-0 v 4 bit thp s c ghi vo v tr chn ca RAM-0. 6.2 M RNG DUNG LNG Gi s ta cn m b nh c dung lng cha 32 t 4 bit m trong tay ta ch c cc chip 16x4. to ra b nh c dung lng 32x4 ta s kt hp 2 chip 16x4. Cch kt hp c minh ha nh hnh 4.27.

236

Mi RAM c dng lu tr 16 t 4 bit. 4 chn vo ra d liu (I/O) ca mi RAM c ni chung mt bus d liu 4 ng. Ti mt thi im ch cho php chn mt chip RAM khng ny sinh vn tranh chp bus. V tng dung lng ca m-un nh ny l 32x4 nn phi c 32 a ch khc nhau, i hi n 5 ng a ch. ng a ch AB4 cng chn mt trong hai RAM (qua u vo ) c c ra hay ghi vo. 4 ng a ch cn li dng xc

nh mt trong 16 v tr nh ca chip RAM c chn.

BI 7: CC MCH NG DNG
1. n qung co

237

Mt ng dng rt ph dng ca b nh bn dn trong thc t. Mch in c th trnh by trn hnh 4.34. Mch in gm ba khi chnh: - Vi mch 555 to nn mch dao ng to xung, cung cp xung nhp cho h thng. - Vi mch 4040 gi chc nng gii m a ch, to a ch gi d liu t EPROM 2764 xut ra iu khin n. - Vi mch nh 2764 c np sn chng trnh v chy ch c d liu. Mi a ch a vo cc chn t A0 n A11 s c mt d liu 8 bit xut ra theo chng trnh nh trc np trong EPROM. 2. n giao thng

238

Nguyn l lm vic ging nh ng dng n qung co nhng c thm mch chn vng nh khi c d liu cho EPROM 2764. C th nh sau: - Trong vng nh t 00000B n 00111B, EPROM 2764 lu tr chng trnh iu khin n giao thng ch u tin 1 (v d ng A u tin hn ng B). Lc ny chn SW1=0 v SW2=0, tng ng A 3=0, A4=0. Vi mch 4555 thc LED1 sng, hin th ch lm vic u tin 1 cho mch iu khin n. - Trong vng nh t 01000B n 01111B, EPROM 2764 lu tr chng trnh iu khin n giao thng ch u tin 2 (v d ng B u tin hn ng A). Lc ny chn SW1=0 v SW2=1, tng ng A3=1 A4=0. Vi mch 4555 thc LED2 sng, hin th ch lm vic u tin 2 cho mch iu khin n. - Trong vng nh t 10000B n 10111B, EPROM 2764 lu tr chng trnh iu khin n giao thng ch ng quyn (ng A v ng B ng cp u tin). Lc ny chn SW1=1 v SW2=0, tng ng A3=0, A4=1. Vi mch 4555 thc LED3 sng, hin th ch lm vic ng quyn cho mch iu khin n.

239
- Trong vng nh t 11000B n 11111B, EPROM 2764 lu tr chng trnh iu khin n giao thng ch v khuya (ch c n vng nhp nhy). Lc ny chn SW1=1 v SW2=1, tng ng A3=1, A4=1. Vi mch 4555 thc LED4 sng, hin th ch lm vic v khuya cho mch iu khin n. Chng trnh np trong mch ny ch mang tnh gii thiu nguyn l lm vic ca EPROM. c th m rng thm cc chng trnh iu khin n giao thng, cn thit phi m rng thm s vng nh cng nh s a ch trong mt vng nh, gip mch in c th ng dng c trong thc tin.

Chng 5 MCH KHUYTCH I THUT TON


y l mt vi mch tng t. Mch khuch i thut ton (Op-Amps) c mt ng dng rt rng ri trong k thut in t hin i. C th ni khng ngoa rng: "Nu hc vi mch m cha bit Op-Amps coi nh cha hc vi mch!". Ni dung chng ny c trnh by di cc mc sau: Bi Bi Bi Bi Bi Bi 1: 2: 3: 4: 5: 6: Khi nim c bn Cu to - Nguyn l lm vic Phn hi & n nh ch lm vic Cc mch c bn Phn tch mch s dng Op-Amps Cc mch ng dng

BI 1: CC KHI NIM C BN V MCH KHUCH I THUT TON


1. Gii thiu Mch khuch i thut ton (Operational Amplifier: Op-Amps) c k hiu nh hnh sau:

240

y l mt vi mch tng t rt thng dng do trong Op-Amps c tch hp mt s u im sau: - Hai ng vo o v khng o cho php Op-Amps khuch i c ngun tn hiu c tnh i xng (cc ngun pht tn hiu bin thin chm nh nhit , nh sng, m, mc cht lng, phn ng ho-in, dng in sinh hc ... thng l ngun c tnh i xng) - Ng ra ch khuch i s sai lch gia hai tn hiu ng vo nn Op-Amps c min nhiu rt cao v khi tn hiu nhiu n hai ng vo cng lc s khng th xut hin ng ra. Cng v l do ny Op-Amps c kh nng khuch i tn hiu c tn s rt thp, xem nh tn hiu mt chiu. - H s khuch i ca Op-Amps rt ln do cho php Op-Amps khuch i c nhng tn hiu vi bin ch vi chc mico Volt. - Do cc mch khuch i vi sai trong Op-Amps c ch to trn cng mt phin do n nh nhit rt cao. - in p phn cc ng vo v ng ra bng khng khi khng c tn hiu, do d dng trong vic chun ho khi lp ghp gia cc khi (module ho). - Tng tr ng vo ca Op-Amps rt ln, cho php mch khuch i nhng ngun tn hiu c cng sut b. - Tng tr ng ra thp, cho php Op-Amps cung cp dng tt cho ph ti. - Bng thng rt rng, cho php Op-Amps lm vic tt vi nhiu dng ngun tn hiu khc nhau

241
... Tuy nhin cng nh cc vi mch khc, Op-Amps khng th lm vic n nh khi lm vic vi tn s v cng sut cao. S chn v hnh dng mt op-amps in hnh

2. Op-Amps l tng - Op-Amps thc t n gin trong vic tnh ton trn op-amps, c th tnh ton trn op-amps l tng sau thc hin b chnh cc thng s trong mch. c c mt ci nhn tng quan gia op-amps thc t v op-amps l tng, c th so snh mt vi thng s gia op-amps l tng v op-amp thng dng (general purpose) nh bng sau

(*) Trn thc t c nhng op-amps c ch to vi mc ch chuyn dng (trong k thut hng khng v tr, qun s, y t, cng nghip ...), cc c tnh ca n rt

242
gn vi c tnh ca op-amps l tng. y ch so snh vi loi ph dng gi thnh thp cht lng cng khng cao. 3. H s nn tn hiu kiu chung (CMRR: Common Mode Rejection Ratio) Do op-amps c ng vo l mch khuch i vi sai nn c mt ch s rt quan trng khi nh gi cht lng ca mch khuch i vi sai cng dng c cho op-amps: l h s CMRR. Gi tr CMRR cng cao mch c tnh trit nhiu ng pha cng tt. Thng s ny c nh ngha nh sau:

Vi Avd l h s khuch i vi sai v AvCM h s khuch i common mode. Kt hp vi cc cng thc khi tnh trong mch khuch i vi sai, ta c:

T cng thc ny ta thy: RE cng ln cng tt cho vic trit nhiu ng pha nhng lm nh vy li lm gim h s khuch i p ca mch. Do c li i ng ngi ta s dng ngun dng thay th cho R E.

BI 2: CU TO - NGUYN L LM VIC
1. Cu to Op-Amps l tng c cu to nh hnh v

243

- Khi 1: y l tng khuch i vi sai (Differential Amplifier), nhim v khuch i sai lch tn hiu gia hai ng vo v+ v v-. N hi cc u im ca mch khuch i vi sai nh: min nhiu cao; khuch i c tn hiu bin thin chm; tng tr ng vo ln ... - Khi 2: Tng khuch i trung gian, bao gm nhiu tng khuch i vi sai mc ni tip nhau to nn mt mch khuch i c h s khuch i rt ln, nhm tng nhay cho Op-Amps. Trong tng ny cn c tng dch mc DC t mc phn cc DC ng ra. - Khi 3: y l tng khuch i m, tn ny nhm tng dng cung cp ra ti, gim tng tr ng ra gip Op-Amps phi hp d dng vi nhiu dng ti khc nhau. Op-Amps thc t vn c mt s khc bit so vi Op-Amps l tng. Nhng d dng trong vic tnh ton trn Op-Amps ngi ta thng tnh trn Op-Amps l tng, sau dng cc bin php b chnh (b) gip Op-Amps thc t tim cn vi Op-Amps l tng. Do thun tin cho vic trnh by ni dung trong chng ny c th hiu Op-Amps ni chung l Op-Amps l tng sau s thc hin vic b chnh sau. 2. Nguyn l lm vic Da vo k hiu ca Op-Amps ta c p ng tn hiu ng ra Vo theo cc cch a tn hiu ng vo nh sau:

244
- a tn hiu vo ng vo o, ng vo khng o ni mass: V out = Av0.V+ - a tn hiu vo ng vo khng o, ng vo o ni mass: Vout = Av0.V- a tn hiu vo ng thi trn hai ng vo (tn hiu vo vi sai so vi mass): V out = Av0.(V+-V-) = Av0.(Vin) vic kho st mang tnh tng quan, xt trng hp tn hiu vo vi sai so vi mass (lc ny ch cn cho mt trong hai ng vo ni mass ta s c hai trng hp kia). Op-Amps c c tnh truyn t nh hnh sau

Trn c tnh th hin r 3 vng: - Vng khuch i tuyn tnh: trong vng ny in p ng ra Vo t l vi tn hiu ng vo theo quan h tuyn tnh. Nu s dng mch khuch i in p vng h (Open Loop) th vng ny ch nm trong mt khong rt b. - Vng bo ho dng: bt chp tn hiu ng vo ng ra lun +Vcc. - Vng bo ho m: bt chp tn hiu ng vo ng ra lun -Vcc. Trong thc t, ngi ta rt t khi s dng Op-Amps lm vic trng thi vng h v tuy h s khuch i p Av0 rt ln nhng tm in p ng vo m Op-Amps khuch i tuyn tnh l qu b (khong vi chc n vi trm micro Volt). Ch cn mt tn hiu nhiu nh hay b tri theo nhit cng lm in p ng ra V cc. Do mch khuch i vng h thng ch dng trong cc mch to xung, dao

245
ng. Mun lm vic ch khuch i tuyn tnh ngi ta phi thc hin vic phn hi m nhm gim h s khuch i vng h Av0 xung mt mc thch hp. Lc ny vng lm vic tuyn tnh ca Op-Amps s rng ra, Op-Amps lm vic trong ch ny gi l trng thi vng kn (Close Loop). 3. Ngun cung cp Op-Amps khng phi lc no cng i hi phi cung cp mt ngun n p i xng 15VDC, n c th lm vic vi mt ngun khng i xng c gi tr thp hn (v d nh +12VDC v -3VDC) hay thm ch vi mt ngun n +12VDC. Tuy nhin vic thay i v cu trc ngun cung cp cng lm thay i mt s tnh cht nh hng n tnh i xng ca ngun nh Op-amps s khng ly in p tham chiu (reference) l mass m chn nh hnh sau:

Mc d ngun n c u im l n gin trong vic cung cp ngun cho op-amps nhng trn thc t rt nhiu mch op-amps c s dng ngun i i xng. 4. Phn cc cho op-amps lm vic vi tn hiu ac Cng nh mch khuch i ni tng RC, cc op-amps dng trong khuch i tn hiu ac cn c t lin lc trnh nh hng ca thnh phn dc gia cc tng khuch i. Di y l s mt mch khuch i m tn c li 40dB S dng ngun n.

246

5. Mch so snh v Schmitt Trigger Hai dng mch ny c mt im chung l c phn cc lm vic vng bo ho. Tuy nhin gia chng vn c nhng im khc bit. a. Mch so snh Mch so snh tn dng ti a h s khuch i vng h trong op-amps (ti thiu khong 100 000 ln) v c ch to thnh nhng vi mch chuyn dng (comparators) nh LM339, LM306, LM311, LM393, NE527, TLC372 ... Cc VI MCH NY C THIT K P NG RT NHANH THEO S THAY I CA TN HIU VO (Slew rate khong vi ngn volt/microsecond). Tuy nhin vi p ng cc nhanh nh vy i lc dn n nhng phin toi, v d trong mch in sau

247

R rng tn hiu ng ra b dao ng mi khi chuyn trng thi, iu ny rt nguy him cho cc mch pha sau. khc ph nhc im trn ngi ta s dng mch Schmitt Trigger. b. Mch Schmitt Trigger Mch Schmitt Trigger l mch so snh c phn hi nh hnh sau

248
Lc ny do vin so snh vi tn hiu ng vo v+ l in th trn mch phn p R4-R2, nn theo s bin thin gia hai mc in p ca v out, mch Schmitt Trigger cng c hai ngng so snh l VH v VL.

Qua hnh trn ta nhn thy, mch Schmitt Trigger l mch so snh v in theo hai ngng VH v VL. Khi in p vin vt qua VH th gi tr ca vout l 0V v khi vin thp hn VL th vout s +Vcc (ngha l c s o pha). minh ho trc quan cho dng mch ny ngi ta thng s dng k hiu

Mch Schmitt Trigger cn c mt dng k hiu khc ngc chiu vi k hiu trn khi ta thay i cc tnh ng vo vin, lc ny vin v vout s ng pha.

BI 3: PHN HI V N NH CH LM VIC
1. Phn hi Nh trnh by trong phn nguyn l lm vic, khi dng mch khuch i vng h ch cn tri nhit, ngun cung cp khng n nh, hay nhiu bin in p ng vo rt b cng a ng ra trng thi bo ho. Minh ha qua mch in sau

249

Vi Vcc=15 VDC, ch cn V+V- khong 1 miliVolt cng a Vo bo ho (vng lm vic phi tuyn). iu ny dn n mch khuch i sai dng: bt n. gim thiu s bt n ny ngi ta thc hin phn hi. Thng thng, OP-AMP s dng phn hi theo 2 dng: Thot nhn c v phn hi dng l tt (lm tng li), nhng tht ra phn hi m mi tht s lm h thng n nh. - Phn hi dng - Phn hi m

V d, ngay sau khi dng xong mt mn c nhiu ng lm cho nng ng trong mu s tng ln. x l hin tng ny ngi ta tim vo mu mt liu INSULIN kch thch s tch t ng trong mu lm nng ng trong mu gim xung. Hin tng ny gi l phn hi m? Nh vy nh vo phn hi m ta c th la chn c h s khuch i ca mch thng qua vic hiu chnh cc gi tr in tr xung quanh Op-Amps. Tu vo tnh

250
cht mch, ngi ta s chnh nh li cc thng s ca cc linh kin a OpAmps vo vng lm vic tng ng. iu ny tng t nh khi phn cc transistor. 2. B chnh in p lch a. in p lch khng Trong Op-Amps l tng khi Vin=0 th Vout=0. Nhng vi Op-Amps thc t th khng c nh vy. Do cc linh kin bn trong mch khng hon ton i xng, nh hng ln nht trong op-amps l mch khuch i vi sai ng vo nn lc ny ng ra vn xut hin mt in p khc 0, gi l in p lch khng ng ra Voffset (output offset voltage).

b. B chnh in p lch khng iu chnh li in p ng ra ging nh Op-Amps l tng, ngi ta t mt in p nh gia hai ng vo sao cho khi Vin=0 th Vout=0. i vi mt s vi mch c sn chn hai chn a ra hiu chnh (thng l Null hay Offset) cho php mc thm vo mt bin tr hiu chnh in p lch ng vo. Minh ho trn hnh sau

251

Vi cc vi mch khng c hai chn trn, ta c th mc thm mch chnh bn ngoi nh hnh

R1 phi ln hn nhiu ln so vi R 2 nhm trnh s phn dng qua R1. 3. B chnh dng lch a. Dng phn cc ng vo v dng lch khng Trong Op-Amps l tng, do tng tr ng vo v cng ln do dng phn cc ng vo bng 0. Nhng vi Op-Amps thc t th khng c nh vy, dng in ng vo vn tn ti kh nh (hng trm nA). Mt khc do cc linh kin bn trong mch khng hon ton i xng nn gi tr hai dng ny cng khng bng nhau v lng chnh lch gia chng c gi l dng chnh lch ng vo (input offset current). Minh ho qua hnh sau

252

Hnh a Hnh b Hnh a trnh by p lch ng ra do Iib- gy ra v hnh b a thm dng Iib+ nhm b li p lch 0 do Iib- gy ra. b. Bin php b chnh Khi lp vo u vo khng o mt in tr R, dng phn cc Iib+ to ra mt st p l VR=R.Iib+ . Chn R sao cho in p ny b c p lch ng ra do Iib- gy ra. Tnh ton theo iu kin Iib- = Iib+, ta c: R = RF // Rin 4. B chnh common Mode Vi op-amps l tng in p common mode (Vcm) bng khng do mch ch khuch i s sai lch gia hai tn hiu ng vo. Nhng op-amps thc t th khng nh vy, ta c th kim tra in p common mode qua mch in sau

Vi ngun Vin c bin 1VAC, thay i tn s ngun theo tn s lm vic ca mch khuch i. Do h s nn tn hiu kiu chung (CMRR) n nh 80 n 100

253
dB, nn vi bin tn hiu ng ra (chnh l Vcm) < 10V l t. Vi Op-Amps thc t in p ny lun hin hu v khng phi l hng khi tn s lm vic thay i trong khong rng. gim thiu gi tr Vcm c th thc hin theo nhiu cch, cch n gin thc hin nh hnh sau

Gi tr ca RCM1 v RCM2 phi ln khng nh hng bi tng tr vo ca Op-Amps. Vi mt s op-amps chuyn dng, ngi ta trang b thm cc mch trit gim common mode ngay bn trong vi mch, v d vi vi mch LH0026 c th mc thm mch trit gim common mode nh sau

y ngun vCM c chn c bin l 1V v tn s nm trong vng tn s lm vic ca mch khuch i, sau khi cp ngun chnh li gi tr ca R 3 sao cho vout = 0V l c. Ngoi ra cn c mt s phng thc trit gim common mode khc trit b in p ny ngay t ngun tn hiu vo minh ho qua hnh

254

S dng hai cun dy cm ng cng thng s v mc h cm vi nhau nh hnh c. Dng tn hiu (khng ng pha) c th qua d dng (do XL=L. rt nh) minh ho trn hnh a, nhng khi tn hiu C.M i qua s b dng cm ng ca chnh n tr kh hnh b. Cch lp cun dy trit gim C.M v c tuyn trit gim nh hnh sau

Cc dng cun dy C.M c ch to trit gim C.M hin c trn th trng

255

5. B chnh tn s a. c tnh bin - tn s Trong thc t, khi khuch i tn hiu xoay chiu li A s t l nghch vi tn s tn hiu cn khuch i, minh ha cc c tuyn bin tn ca cc op-amps 741, 748, 739 khi khuch i vng h nh hnh sau

iu ny c ngha op-amps khng khuch i c khi tn s ngun tn hiu ng vo qu cao. iu ny c th l gii d dng do in dung k sinh ca cc

256
transistor v cc in tr trong mch to thnh cc mch lc thng thp, minh ho qua hnh

y xt mt op-amps l tng c ng vo l mt mch khuch i vi sai (KVS) c h s khuch i A=A0 (h s khuch i vng h); Cc khu +1 v mch RC c trng cho in tr v in dung tp tn ca mch (cc khu +1 c trng cho khu ghp in khng ph thuc vo tn s v c h s truyn t bng 1). T y c th tnh c h s khuch i:

Vi f1 , f2 , f3 l tn s ti hn ca 3 khu lc thng thp. T cng thc ny c th thy khi tn s tng th gc lch pha gia ng ra v ng vo s tng theo, khi gc lch pha ny t n 180 th c th xy ra hin tng dao ng (nu tho thm iu kin v bin ). Nh vy mch khuch i s dng op-amps s do ng khi tn s ngun tn hiu vo t n mt gi tr tn s no mch bt n. b. Cc bin php b c tuyn tn s (b pha)

257
d tr v bin v pha cng ln th h thng cng n nh. Nhng do hai thng s ny lin quan chc ch vi nhau nn trong thc t ch cn xt mt trong hai tham s l . Thng thng ngi ta s dng h s d tr v pha. Vi b khuch i c mch hi tip m khng ph thuc tn s ngha l mch hi tip khng gy ra mt gc lch pha no, th d tr ch cn 45 l . Nhng khi mch hi tip khng phi l thun tr, ngha l c lm lch pha th yu cu d tr v pha phi ln hn (thm ch c khi ngi ta chn n 90 ). V nguyn tc, b tn s hay cn gi l b pha thc cht l lm thay i c tnh tn s ca h s khuch i vng kn sao cho |Av|=|A0.Afeedback|<1 trc khi gc lch pha = 180 . thc hin c iu ny, c th thay i A 0 gi l b trong hay Afeedback gi l b ngoi cn thay i c A0 v Afeedback gi l b hn hp. Thng thng ngi ta cho b trong v khi thay i A0 s t nh hng n hm truyn chung ca mch khuch i c hi tip. Cc mch b c th mc ng ra, ng vo hay gia cc tng khuch i op-amps nh hnh

Tu vo c tuyn truyn t ca cc mch b ngi ta to ra nhiu dng mch b khc nhau, cc mch b c tnh cht chung l lm gim dc ca c tnh bin theo tn s ca h s khuch i xung quanh tn s ct fc, ngha l gim gc lch pha ti thi im c kh nng xy ra dao ng (|A0.Afeedback|=1). C th cc dng mch b l

258

BI 4: CC MCH C BN
Do gio trnh ch t nng phn ng dng, do y ch trnh by nguyn l lm vic v cng thc quan h gia ng ra vi ng vo. 1. Mch khuch i o Tn hiu ng ra o pha so vi tn hiu ng vo

2. Mch khuch i khng o Tn hiu ng ra cng pha so vi tn hiu ng vo

3. Mch theo in p Mch ny khng khuch i in p, ch khuch i dng

259

4. Mch cng o Tn hiu ng ra l tng gia cc thnh phn ng vo nhng tri du.

5. Mch khuch i vi sai (mch tr) Mch ch khuch i khi gia hai tn hiu ng vo c s sai lch v in p.

6. Mch tch phn

260
Tn hiu ng ra l tch phn tn hiu ng vo.

7. Mch vi phn Tn hiu ng ra l vi phn tn hiu ng vo

8. Mch to hm m

9. Mch to hm logarith

261

BI 5: PHN TCH S DNG OP-AMPS


1. Phng php phn tch Phn tch v thit k l hai qu trnh thun nghch, khi nm vng phng php phn tch s h tr rt nhiu cho qu trnh thit k. phn tch mt mch in s dng Op-Amps l tng, u tin thay th Op-Amps l tng bi s tng ng

Sau tun t thc hin ba bc sau: - Vit phng trnh Kirchhoff cho u vo V+. - Vit phng trnh Kirchhoff cho u vo V-. - Cho V+=V-, ta tm c mi quan h gia Vin v Vo. 2. Cc bi ton in hnh a. Bi ton 1: Phn tch mch in sau

262

- Vit phng trnh Kirchhoff cho u vo V+. v+=0 - Vit phng trnh Kirchhoff cho u vo V-.

vout v vin v 0 RF Rin


- Cho v+=v- v+=v-= 0, ta tm c mi quan h gia vin v vout: vout = RF/Rin .vin b. Bi ton 2: Phn tch mch in sau

- Vit phng trnh Kirchhoff cho u vo V+. v+=0 - Vit phng trnh Kirchhoff cho u vo V-.

- Cho v+=v- v+=v-= 0, ta tm c mi quan h gia Vin v Vout.

263

BI 6: CC MCH NG DNG
Phm vi ng dng ca Op-Amps rt phong ph, y ch nu mt s ng dng mang tnh minh ho nguyn l lm vic ca Op-Amps. 1. Mch so snh ca s y l mch in ng dng trong vic cnh bo qu nhit hay thiu nhit ca mi trng cn theo di. Mch lm vic theo nguyn l so snh ca s, mt nguyn l rt thng dng trong cc thit b cng nghip. Minh ho qua hnh.

Khi mun khng ch nhit l 40oC, ngi ta tin hnh nh sau: t nhit mi trng ang l 27oC, bt u cp nhit cho l (im A). Nhit l tng dn vt qua 36oC (im B), ri qua 40oC mch vn tip tc cp nhit cho n khi nhit ca l n 44oC (im C), l mi ct in tr gia nhit. Nhit l bt u gim dn t 44oC (im D). Gim qua 40oC vn tip tc gim. Cho n 36oC (im E) th li tip tc cp nhit cho l (im B) nhit l tng dn ln.

S nguyn l mch bo nhit

264
R rng gi nhit l nm trong khong 40oC, ngi ta cp nhit cho l theo chu trnh B, C, D, E ri tr li B: hnh dng nh mt ca s nn c tn l mch so snh ca s (window comparator). Nguyn l so snh ny c ng dng rt rng ri trong cng nghip, dn dng, qun s, y t... Tm tt nguyn l lm vic nh sau: in tr nhit PTR phi hp vi R1 v R2 to ra Vs l mt hm bin thin theo nhit mi trng t PTR. C th c th tnh Vs: R rng Vs = f(To) l mt hm ca nhit . Do , o Vs chnh l o nhit . C th cc gi tr in tr trong mch c cn chnh 2 OP-AMPS lm vic nh sau : * Khi thiu nhit: Lc ny VS < VA < VB, u vo v+ ca op-amps II nh hn u vo v- nn ng ra op-amps II xung thp, LED 2 sng. Trong khi u vo v + ca op-amps I ln hn u vo v- nn ng ra op-amps I ln cao, LED 1 tt. * Khi nhit: Lc ny VA < VS < VB, u vo v+ ca op-amps II ln hn u vo v- nn ng ra op-amps II ln cao, LED 2 tt. Trong khi u vo v+ ca op-amps I ln hn u vo v- nn ng ra op-amps I ln cao, LED 1 tt. * Khi qu nhit: Lc ny VA < VB < VS, u vo v+ ca op-amps II ln hn u vo v- nn ng ra op-amps II ln cao, LED 2 tt. Trong khi u vo v+ ca op-amps I nh hn u vo v- nn ng ra op-amps I xung thp, LED 1 sng. R rng ch cn nhn vo sng ti ca 2 LED, ta c th nhn bit c nhit ca mi trng cn cnh bo nhit . mch cnh bo hiu qu hn c th thm vo mt mch dao ng, mch ny gip khi c s c cc LED s khng sng lin tc m nhp nhy. 2. Mch chnh lu chnh xc Trong thc t, i lc ngi ta cn mch chnh lu c in p ng ra nh hnh v trong iu kin l tng, nhng trn thc t d diode c phn cc thun v dn dng th vn c mt st p ng k trn diode (chnh lu cu st p ny l 2V D). iu ny dn n s mo dng in p ng ra nh hnh v.

265

khc phc nhc im ny, ngi ta s dng mch chnh lu chnh xc s dng Op-Amps nh hnh v

Do dng in hai ng vo ca Op-Amps bng khng nn trong chu k phn cc thun ca diode (chu k chnh lu) Vin=Vout, v vy sng dng in p ng ra b chnh lu nh sng dng b chnh lu l tng. 3. Mch lc Mch lc th ng c u im l rt n gin, tuy nhin h s truyn t nh do b tn hao trn RC, ph thuc nhiu vo ti, kh phi hp tng tr vi cc mch ghp. Mun hn ch suy gim th phi lp nhiu mt lc lin tip, lc ny tn s ct ca b lc s khc vi cc tn s ct ca cc mt lc. Cch khc phc nhc im trn l s dng cc mch lc tch cc. C th l a mt lc RC vo ng hi

266
tip ca Op-Amps tng h s truyn t, tng h s phm cht, ng thi lm gim nh hng ca ti bng cch dng tng m phi hp tr khng. Cng nh mch lc th ng, c th phn mch lc tch cc theo tn s lm vic nh: mch lc thng thp, mch lc thng cao, mch lc dy. y gii thiu mt mch lc tch cc lc thng thp: mch lc m tn s thp c truyn qua nguyn vn, c tn s cao b suy gim v chm pha vi tn hiu vo.

C th dng cng thc tnh ton v thnh lp biu Bode v bin - tn ca mch lc trn nh hnh

Cc nhn xt v mch lc thng thp: - Ti tn s ct fc c lch pha l -45o; bin in p ra gim gn 3 dB. - Ti tn s thp f << fc: bin |A| = 1 0dB - Ti tn s cao f >> fc: bin |A| = 1/RC, h s khuch i t l nghch vi tn s theo quan h: tn s tng 10 ln th h s khuch i gim 10 ln tc l gim 20dB/decade hay 6dB/octave. 4. Ngun dng cng sut ln Trong thc t i khi ngun dng cung cp nng lng ra ti s tt hn ngun p v d nh khi np bnh c qui, nu s dng ngun dng bnh s lu h hn nhiu ln so vi np bng ngun p; c bit khi ngun p cung cp thng xuyn c gi

267
tr bt n nh (nh ly in t nng lng mt tri, sc gi ...). Nhng lc nh vy ta c th s dng ngun dng trnh by trn hnh sau:

C th tng thm dng cho mch in trn khi thay Q2 bng cc transistor darlington (transistor c lp ghp sn dng darlington bn trong linh kin). Nhng lc ny R1 cng phi gim theo mt cch tng ng. 5. Ngun n p Hin nay, n p DC s dng vi mch chuyn dng t n n nh rt cao, tuy nhin mun ch to mt b n p s dng Op-Amps c n nh tng i tt cng khng phi l iu kh! C th thc hin theo mch sau:

268
Khi chnh nh t s gia R2 v R3 thay i h s khuch i vng kn ca mch s lm thay i c in p ng ra mc n nh mi. Vi dng ti ti a l 1A trong khi in p ng vo bin thin trong mt dy in p rng, b ngun ny chc chn s dng c kh nhiu vic trong lnh vc in t vi mch.

Chng 6 CC B CHUYN I ADC/DAC


Trong t nhin a phn cc ngun tn hiu thng l dng tng t (Analog) h thng s c th x l c cc tn hiu ny cn thit phi chuyn i chng sang tn hiu s (ADC). Sau khi tnh ton, x l xong cn thit phi chuyn i cc tn hiu ny t tn hiu s v li tng t (DAC). Chng 5 s gii thiu cc k thut chuyn i ny cng vi cc chip thng dng hin c trn th trng. Ni dung chng 5 gm:

BI 1.1: B CHUYN I S - TNG T-DAC


Trang 1
Trong k thut s, ta thy i lng s c gi tr xc nh l mt trong hai kh nng l 0 hoc 1, cao hay thp, ng hoc sai, vv Trong thc t chng ta thy rng mt i lng s (chng hn mc in th) thc ra c th c mt gi tr bt k nm trong khong xc nh v ta nh r cc gi tr trong phm vi xc nh s c chung gi tr dng s. V d: Vi logic TTL ta c: T 0V n 0,8V l mc logic 0, t 2V n 5V l mc logic 1 Nh vy th bt k mc in th no nm trong khong 0 0,8V u mang gi tr s l logic 0, cn mi in th nm trong khong 2 5V u c gn gi tr s l 1. Ngc li trong k thut tng t, i lng tng t c th ly gi tr bt k trong mt khong gi tr lin tc. V iu quan trng hn na l gi tr chnh xc ca i lng tng t l l yu t quan trng. Hu ht trong t nhin u l cc i lng tng t nh nhit , p sut, cng nh sng, Do mun x l trong mt h thng k thut s, ta phi chuyn i sang dng i lng s mi c th x l v iu khin cc h thng c. V ngc li c nhng h thng tng t cn c iu khin chng ta cng phi chuyn i t s sang tng t. Trong phn ny chng ta s tm hiu v qu trnh chuyn i t s sang tng t -DAC (Digital to Analog Converter).

269
Chuyn i s sang tng t l tin trnh ly mt gi tr c biu din di dng m s ( digital code ) v chuyn i n thnh mc in th hoc dng in t l vi gi tr s. Hnh 5.1 minh ha s khi ca mt b chuyn i DAC.

1.1 PHN GII phn gii (resolution) ca b bin i DAC c nh ngha l thay i nh nht c th xy ra u ra tng t bi kt qua ca mt thay i u vo s. phn gii ca DAC ph thuc vo s bit, do cc nh ch to thng n nh phn gii ca DAC dng s bit. DAC 10 bit c phn gii tinh hn DAC 8 bit. DAC c cng nhiu bit th phn gii cng tinh hn. phn gii lun bng trng s ca LSB. Cn gi l kch thc bc thang (step size), v l khong thay i ca Vout khi gi tr ca u vo s thay i t bc ny sang bc khc.

270

Dng sng bc thang (hnh 5.2) c 16 mc vi 16 thng thi u vo nhng ch c 15 bc gia mc 0 v mc cc i. Vi DAC c N bit th tng s mc khc nhau s l 2 N, v tng s bc s l 2N 1. Do phn gii bng vi h s t l trong mi quan h gia u vo v u ra ca DAC. u ra tng t = K x u vo s Vi K l mc in th (hoc cng dng in) mi bc. Nh vy ta c cng thc tnh phn gii nh sau:

Vi N l s bit

l u ra cc i ( y thang )

Nu tnh theo phn trm ta c cng thc nh sau:

V d nh hnh 5.1 ta c

V d 1: Mt ADC 10 bit c kch thc bc thang = 10mV. Hy xc nh in th u ra cc i ( y thang ) v t l % phn gii.

271
Gii: DAC c 10 bit nn ta c S bc l 210 1 = 1023 bc Vi mi bc l 10mV nn u ra cc i s l 10mVx1023 = 10.23V

T v d trn cho thy t l phn trm phn gii gim i khi s bit u vo tng ln. Do ta cn tnh c % phn gii theo cng thc:

Vi m u vo nh phn N bit ta c tng s bc l 2N 1 bc. 1.2 CHNH XC C nhiu cch nh gi chnh xc. Hai cch thng dng nht l sai s ton thang (full scale error) v sai s tuyn tnh (linearity error) thng c biu bin dng phn trm u ra cc i (y thang) ca b chuyn i. Sai s ton thang l khong lch ti a u ra DAC so vi gi tr d kin (l tng), c biu din dng phn trm. Sai s tuyn tnh l khong lch ti a kch thc bc thang so vi kch thc bc thang l tng. iu quan trng ca mt DAC l chnh xc v phn gii phi tng thch vi nhau. 1.3 SAI S LCH Theo l tng th u ra ca DAC s l 0V khi tt c u vo nh phn ton l bit 0. Tuy nhin trn thc t th mc in th ra cho trng hp ny s rt nh, gi l sai s lch ( offset error). Sai s ny nu khng iu chnh th s c cng vo u ra DAC d kin trong tt c cc trng hp. Nhiu DAC c tnh nng iu chnh sai s lch bn ngoi, s cho php chng ta trit tiu lch ny bng cch p mi bit 0 u vo DAC v theo di u ra. Khi ta iu chnh chit p iu chnh lch cho n khi no u ra bng 0V. 1.4 THI GIAN N NH Thi gian n nh (settling time) l thi gian cn thit u ra DAC i t zero n bc thang cao nht khi u vo nh phn bin thin t chui bit ton 0 n chui bit ton l 1. Thc t thi gian n nh l thi gian u vo DAC n nh trong phm vi 1/2 kch thc bc thang ( phn gii) ca gi tr cui cng. V d: Mt DAC c phn gii 10mV th thi gian n nh c o l thi gian u ra cn c n nh trong phm vi 5mV ca gi tr y thang.

272
Thi gian n nh c gi tr bin thin trong khong 50ns n 10ns. DAC vi u ra dng c thi gian n nh ngn hn thi gian n nh ca DAC c u ra in th. 1.5 TRNG THI N IU DAC c tnh cht n iu ( monotonic) nu u ra ca n tng khi u vo nh phn tng dn t gi tr ny ln gi tr k tip. Ni cch khc l u ra bc thang s khng c bc i xung khi u vo nh phn tng dn t zero n y thang. T s ph thuc dng: DAC cht lng cao yu cu s nh hng ca bin thin in p ngun i vi in p u ra v cng nh. T s ph thuc ngun l t s bin thin mc in p u ra vi bin thin in p ngun gy ra n. Ngoi cc thng s trn chng ta cn phi quan tm n cc thng s khc ca mt DAC khi s dng nh: cc mc logic cao, thp, in tr, in dung, ca u vo; di rng, in tr, in dung ca u ra; h s nhit, 2.1 DAC dng in tr c trng s nh phn v b khuch i cng. Hnh 5.3 l s mch ca mt mch DAC 4 bit dng in tr v b khuch i o. Bn u vo A, B, C, D c gi tr gi nh ln lt l 0V v 5V.

B khuch i thut ton (Operational Amplifier Op Amp) c dng lm b cng o cho tng trng s ca bn mc in th vo. Ta thy cc in tr u vo gim dn 1/2 ln in tr trc n. Ngha l u vo D (MSB) c R IN = 1k, v vy b khuch i cng chuyn ngay mc in th ti D i m khng lm suy gim (v Rf = 1k). u vo C c R = 2k, suy gim i 1/2, tng t u vo B suy gim 1/4 v u vo A gim 1/8. Do u ra b khuch i c tnh bi biu thc:

273

du m (-) biu th b khuch i cng y l khuch i cng o. Du m ny chng ta khng cn quan tm. Nh vy ng ra ca b khuch i cng l mc in th tng t, biu th tng trng s ca cc u vo. Da vo biu thc (4) ta tnh c cc mc in p ra tng ng vi cc t hp ca cc ng vo (bng 5.1). Bng 5.1 u ra ng vi iu kin cc u vo thch hp 0V hoc 5V.

phn gii ca mch DAC hnh 5.2 bng vi trng s ca LSB, ngha l bng x 5V = 0.625V. Nhn vo bng 5.1 ta thy u ra tng t tng 0.625V khi s nh phn u vo tng ln mt bc. V d 2: a. Xc nh trng s ca mi bit u vo hnh 5.2 b. Thay i Rf thnh 500W.Xc nh u ra cc i y thang. Gii: a. MSB chuyn i vi mc khuch i = 1 nn trng s ca n u ra l 5V. Tng t nh vy ta tnh c cc trng s ca cc bit u vo nh sau:

274
MSB # 5V MSB th 2 # 2.5V (gim i 1/2) MSB th 3 # 1.25V (gim i 1/4) MSB th 4 (LSB) # 0.625V (gim i 1/8) b. Nu Rf = 500W gim theo tha s 2, nn mi trng s u vo s nh hn 2 ln so vi gi tr tnh trn. Do u ra cc i ( y thang) s gim theo cng tha s, cn li: -9.375/2 = -4.6875V 2.2 DAC R/2R ladder Mch DAC ta va kho st s dng in tr c trng s nh phn to trng s thch hp cho tng bit vo. Tuy nhin c nhiu hn ch trong thc t. Hn ch ln nht l khong cch chnh lch ng k gi tr in tr gia LSB v MSB, nht l trong cc DAC c phn gii cao (nhiu bit). V d nu in tr MSB = 1k trong DAC 12 bit, th in tr LSB s c gi tr trn 2M. iu ny rt kh cho vic ch to cc IC c bin thin rng v in tr c th duy tr t l chnh xc. khc phc c nhc im ny, ngi ta tm ra mt mch DAC p ng c yu cu l mch DAC mng R/2R ladder. Cc in tr trong mch ny ch bin thin trong khong t 2 n 1. Hnh 5.4 l mt mch DAC R/2R ladder c bn.

T hnh 5.4 ta thy c cch sp xp cc in tr ch c hai gi tr c s dng l R v 2R. Dng IOUT ph thuc vo v tr ca 4 chuyn mch, u vo nh phn B0B1B2B3 chi phi trng thi ca cc chuyn mch ny. Dng ra IOUT c php

275
chy qua b bin i dng thnh in (Op-Amp) bin dng thnh in th ra VOUT. in th ng ra VOUT c tnh theo cng thc:

Vi B l gi tr u vo nh phn, bin thin t 0000 (0) n 1111(15) V d 3: Gi s VREF = 5V ca DAC hnh 5.4. Tnh phn gii v u ra cc i ca DAC ny? Gii phn gii bng vi trng s ca LSB, ta xc nh trng s LSB bng cch gn B = 00012 = 1. Theo cng thc (5), ta c:

u ra cc i xc nh c khi B = 1111 2 = 1510. p dng cng thc (5) ta c:

2.3 DAC vi u ra dng Trong cc thit b k thut s i lc cng i hi qu trnh iu khin bng dng in. Do ngi ta to ra cc DAC vi ng ra dng p ng yu cu . Hnh 5.5 l mt DAC vi ng ra dng tng t t l vi u vo nh phn. Mch DAC ny 4 bit, c 4 ng dn dng song song mi ng c mt chuyn mch iu khin. Trng thi ca mi chuyn mch b chi phi bi mc logic u vo nh phn.

276

Dng chy qua mi ng l do mc in th quy chiu V REF v gi tr in tr trong ng dn quyt nh. Gi tr in tr c trng s theo c s 2, nn cng dng in cng c trng s theo h s 2 v tng cng dng in ra IOUT s l tng cc dng ca cc nhnh.

DAC vi u dng ra c th chuyn thnh DAC c u ra in th bng cch dng b khuch i thut ton (Op-Amp) nh hnh 5.6.

277

hnh trn IOUT ra t DAC phi ni n u vo ca b khuch i thut ton. Hi tip m ca b khuch i thut ton buc dng IOUT phi chy qua RF v to in p ng ra VOUT v c tnh theo cng thc:

Do VOUT s l mc in th tng t, t l vi u vo nh phn ca DAC. 2.4 DAC in tr hnh T Hnh 5.7 l s DAC in tr hnh T 4 bit. Trong s c hai loi in tr l R v 2R c mc thnh 4 cc hnh T ni dy chuyn. Cc S3, S2, S1, S0 l cc chuyn mch in t. Mch DAC ny dng b khuch i thut ton (Op-Amp) khuch i o. VREF l in p chun lm tham kho. B3, B2, B1, B0 l m nh phn 4 bit. Vo l in p tng t ng ra. Ta thy cc chuyn mch chu s iu khin ca s nh phn tng ng vi cc cng tc: khi Bi = 1 th cng tc Si ng vo VREF, kho Bi = 0 th Si ni t.

278

Nguyn l lm vic ca DAC ny cng n gin. Ngi c c th gii thch c hot ng ca mch da trn hnh v v nhng kin thc hc. Chng ta ch cn cho ln lt cc bit Bi bng logic 1 v 0 ta s tnh c VOUT sau dng nguyn xp chng ta s tnh c in p ra:

Biu thc (7) chng t rng bin in p tng t u ra t l thun vi gi tr tn hiu s u vo. Chng ta c th thy rng i vi DAC in tr hnh T N bit th in p tng t u ra VOUT s l:

Sai S Chuyn i i vi mch DAC in tr hnh T th sai s chuyn i do cc nguyn nhn sau: K Sai lch in p chun tham chiu VREF . T cng thc (8) ta c th tnh sai s chuyn i DA do ring sai s lch in p chun tham chiu VREF gy ra nh sau:

279

Biu thc trn cho thy sai s ca in p tng t DVOUT t l vi sai lch DVREF v t l thun vi gi tr tn hiu s u vo. K S tri im 0 ca khuch i thut ton. S tri im 0 ca b khuch i thut ton nh hng nh nhau i vi mi gi tr tn hiu s c bin i. Sai s DVOUT do tri im 0 khng ph thuc gi tr tn hiu s. K in p ri trn in tr tip xc ca tip im chuyn mch. Cc chuyn mch khng phi l l tng, thc t in p ri khi ni thng ca mch in chuyn mch khng th tuyt i bng 0. Vy in p ri ny ng vai tr tn hiu sai s a n u vo mng in tr hnh T. K Sai s ca in tr . Sai s in tr cng gy ra sai s phi tuyn. Sai s ca cc in tr khng nh nhau, tc ng gy sai s chuyn i DA ca nhng in tr khc nhau v v tr l khc nhau. Tc chuyn i: DAC in tr hnh T cng tc song song (cc bit tn hiu s u vo c a vo song song) nn c tc chuyn i cao. Thi gian cn thit cho mt ln chuyn i gm hai gai on: thi gian tr truyn t ca bit tn hiu vo xa nht n b khuch i thut ton v thi gian cn thit b khuch i thut ton n nh tn hiu ra.

BI 1.2: CC DNG MCH DAC


Trang 2
C nhiu phng php v s mch gip to DAC vn hnh nh gii thiu. Sau y l mt s dng mch DAC c bn s gip chng ta hiu r v su hn v qu trnh chuyn i t s sang tng t. 2.1 DAC dng in tr c trng s nh phn v b khuch i cng. Hnh 5.3 l s mch ca mt mch DAC 4 bit dng in tr v b khuch i o. Bn u vo A, B, C, D c gi tr gi nh ln lt l 0V v 5V.

280

B khuch i thut ton (Operational Amplifier Op Amp) c dng lm b cng o cho tng trng s ca bn mc in th vo. Ta thy cc in tr u vo gim dn 1/2 ln in tr trc n. Ngha l u vo D (MSB) c R IN = 1k, v vy b khuch i cng chuyn ngay mc in th ti D i m khng lm suy gim (v Rf = 1k). u vo C c R = 2k, suy gim i 1/2, tng t u vo B suy gim 1/4 v u vo A gim 1/8. Do u ra b khuch i c tnh bi biu thc:

du m (-) biu th b khuch i cng y l khuch i cng o. Du m ny chng ta khng cn quan tm. Nh vy ng ra ca b khuch i cng l mc in th tng t, biu th tng trng s ca cc u vo. Da vo biu thc (4) ta tnh c cc mc in p ra tng ng vi cc t hp ca cc ng vo (bng 5.1). Bng 5.1 u ra ng vi iu kin cc u vo thch hp 0V hoc 5V.

281

phn gii ca mch DAC hnh 5.2 bng vi trng s ca LSB, ngha l bng x 5V = 0.625V. Nhn vo bng 5.1 ta thy u ra tng t tng 0.625V khi s nh phn u vo tng ln mt bc. V d 2: a. Xc nh trng s ca mi bit u vo hnh 5.2 b. Thay i Rf thnh 500W.Xc nh u ra cc i y thang. Gii: a. MSB chuyn i vi mc khuch i = 1 nn trng s ca n u ra l 5V. Tng t nh vy ta tnh c cc trng s ca cc bit u vo nh sau: MSB # 5V MSB th 2 # 2.5V (gim i 1/2) MSB th 3 # 1.25V (gim i 1/4) MSB th 4 (LSB) # 0.625V (gim i 1/8) b. Nu Rf = 500W gim theo tha s 2, nn mi trng s u vo s nh hn 2 ln so vi gi tr tnh trn. Do u ra cc i ( y thang) s gim theo cng tha s, cn li: -9.375/2 = -4.6875V 2.2 DAC R/2R ladder

282

Mch DAC ta va kho st s dng in tr c trng s nh phn to trng s thch hp cho tng bit vo. Tuy nhin c nhiu hn ch trong thc t. Hn ch ln nht l khong cch chnh lch ng k gi tr in tr gia LSB v MSB, nht l trong cc DAC c phn gii cao (nhiu bit). V d nu in tr MSB = 1k trong DAC 12 bit, th in tr LSB s c gi tr trn 2M. iu ny rt kh cho vic ch to cc IC c bin thin rng v in tr c th duy tr t l chnh xc.
khc phc c nhc im ny, ngi ta tm ra mt mch DAC p ng c yu cu l mch DAC mng R/2R ladder. Cc in tr trong mch ny ch bin thin trong khong t 2 n 1. Hnh 5.4 l mt mch DAC R/2R ladder c bn.

T hnh 5.4 ta thy c cch sp xp cc in tr ch c hai gi tr c s dng l R v 2R. Dng IOUT ph thuc vo v tr ca 4 chuyn mch, u vo nh phn B0B1B2B3 chi phi trng thi ca cc chuyn mch ny. Dng ra IOUT c php chy qua b bin i dng thnh in (Op Amp) bin dng thnh in th ra VOUT. in th ng ra VOUT c tnh theo cng thc:

Vi B l gi tr u vo nh phn, bin thin t 0000 (0) n 1111(15) V d 3: Gi s VREF = 5V ca DAC hnh 5.4. Tnh phn gii v u ra cc i ca DAC ny?

283
Gii phn gii bng vi trng s ca LSB, ta xc nh trng s LSB bng cch gn B = 00012 = 1. Theo cng thc (5), ta c:

u ra cc i xc nh c khi B = 1111 2 = 1510. p dng cng thc (5) ta c:

2.3 DAC vi u ra dng Trong cc thit b k thut s i lc cng i hi qu trnh iu khin bng dng in. Do ngi ta to ra cc DAC vi ng ra dng p ng yu cu . Hnh 5.5 l mt DAC vi ng ra dng tng t t l vi u vo nh phn. Mch DAC ny 4 bit, c 4 ng dn dng song song mi ng c mt chuyn mch iu khin. Trng thi ca mi chuyn mch b chi phi bi mc logic u vo nh phn.

Dng chy qua mi ng l do mc in th quy chiu V REF v gi tr in tr trong ng dn quyt nh. Gi tr in tr c trng s theo c s 2, nn cng dng in cng c trng s theo h s 2 v tng cng dng in ra IOUT s l tng cc dng ca cc nhnh.

284

DAC vi u dng ra c th chuyn thnh DAC c u ra in th bng cch dng b khuch i thut ton (Op Amp) nh hnh 5.6.

hnh trn IOUT ra t DAC phi ni n u vo ca b khuch i thut ton. Hi tip m ca b khuch i thut ton buc dng IOUT phi chy qua RF v to in p ng ra VOUT v c tnh theo cng thc:

<p class="MsoNormal"

BI 2.1: CHUYN I TNG T - S

ADC
Trang 1
1.1 S khi B chuyn i tng t sang s ADC (Analog to Digital Converter) ly mc in th vo tng t sau mt thi gian s sinh ra m u ra dng s biu din u vo tng t. Tin trnh bin i A/D thng phc tp v mt nhiu thi gian hn

285
tin trnh chuyn i D/A. Do c nhiu phng php khc nhau chuyn i t tng t sang s. Hnh v 5.16 l s khi ca mt lp ADC n gin.

Hot ng c bn ca lp ADC thuc loi ny nh sau: Xung lnh START khi ng s hot ng ca h thng. Xung Clock quyt nh b iu khin lin tc chnh sa s nh phn lu trong thanh ghi. S nh phn trong thanh ghi c DAC chuyn i thnh mc in th tng t VAX. B so snh so snh VAX vi u vo trng t VA. Nu VAX < VA u ra ca b so snh ln mc cao. Nu VAX > VA t nht bng mt khong VT (in th ngng), u dra ca b so snh s xung mc thp v ngng tin trnh bin i s nh phn thanh ghi. Ti thi im ny VAX xp x VA. gi dtr nh phn thanh ghi l i lng s tng ng VAX v cng l i lng s tng ng VA, trong gii hn phn gii v chnh xc ca h thng. Logic iu khin kch hot tn hiu ECO khi chu k chuyn i kt thc. Tin trnh ny c th c nhiu thay di i vi mt s loi ADC khc, ch yu l s khc nhau cch thc b iu khin sa i s nh phn trong thanh ghi.

286

1.2 Cc ch tiu k thut ch yu ca ADC phn gii phn gi ca mt ADC biu th bng s bit ca tn hiu s u ra. S lng bit nhiu sai s lng t cng nh, chnh xc cng cao. Di ng, in tr u vo. Mc logic ca tn hiu s u ra v kh nng chu ti (ni vo u vo). chnh xc tng i Nu l tng ha th tt c cc im chuyn iphi nm trn mt ng thng. chnh xc tng i l sai ds ca cc im chuyn i thc t so vi c tuyn chuyn i l tng. Ngoi ra cn yu cu ADC khng b mt bit trong ton b phm vi cng tc. Tc chuyn i Tc chuyn i c xc nh thi gian bi thi gian cn thit hon thnh mt ln chuyn i A/D. Thi gian ny tnh t khi xut hin tn hiu iu khin chuyn i n khi tn hiu s u ra n nh. H s nhit H s nhit l bin thin tng i tn hiu s u ra khi nhit bin i 10C trong phm vi nhit cng tc cho ph p vi iu kin mc tng t u vo khng i. T s ph thuc cng sut Gi s in p tng t u vo khng i, nu ngun cung cp cho ADC bin thin m nh hng n tn hiu s u ra cng ln th t s ph thuc ngun cng ln. Cng sut tiu hao. 1.3 Cc bc chuyn i AD Qu trnh chuyn i A/D nhn chung c thc hin qua 4 bc c bn, l: ly mu; nh mu; lng t ha v m ha. Cc bc lun lun kt hp vi nhau trong mt qu trnh thng nht. 1.3.1 nh l ly mu i vi tn hiu tng t VI th tn hiu ly mu VS sau qu trnh ly mu c th khi phc tr li VI mt cch trung thc nu iu kin sau y tha mn:

287

fS 2fImax (10) Trong fS : tn s ly mu fImax : l gii hn trn ca gii tn s tng t Hnh 5.17 biu din cch ly mu tn hiu tng t u vo. Nu biu thc (10) c tha mn th ta c th dng b t lc thng thp khi phc VI t VS. V mi ln chuyn i in p ly mu thnh tn hiu s tng ng u cn c mt thi gian nht nh nn phi nh mu trong mt khong thi gian cn thit sau mi ln ly mu. in p tng t u vo c thc hin chuyn i A/D trn thc t l gi tr VI i din, gi tr ny l kt qu ca mi ln ly mu.

1.3.2 Lng t ha v m ha Tn hiu s khng nhng ri rc trong thi gian m cn khng lin tc trong bin i gi tr. Mt gi tr bt k ca tn hiu s u phi biu th bng bi s nguyn ln gi tr n v no , gi tr ny l nh nht c chn. Ngha l nu dng tn hiu s biu th in p ly mu th phi bt in p ly mu ha thnh bi s nguyn ln gi tr n v. Qu trnh

288

ny gi l lng t ha. n v c chn theo qui nh ny gi l n v lng t, k hiu D. Nh vy gi tr bit 1 ca LSB tn hiu s bng D. Vic dng m nh phn biu th gi tr tn hiu s l m ha. M nh phn c c sau qu trnh trn chnh l tn hiu u ra ca chuyn i A/D. 1.3.3 Mch ly mu v nh mu Khi ni trc tip in th tng t vi u vo ca ADC, tin trnh bin i c th b tc ng ngc nu in th tng t thay i trong tin trnh bin i. Ta c th ci thin tnh n nh ca tin trnh chuyn i bng cch s dng mch ly mu v nh mu ghi nh in th tng t khng i trong khi chu k chuyn i din ra. Hnh 5.18 l mt s ca mch ly mu v nh mu. <p class="MsoNormal" ali

BI 3: GII THIU CC VI MCH IN HNH


Hin nay trn th trng c nhiu loi IC c chc nng chuyn i t s sacng tng t. y ch gii thiu 2 loi IC thng dng, cc loi khc bn c c th tham kho trong Datasheet hay trn Internet. 3.1 IC AD7524 IC AD7524 ( IC CMOS) l IC chuyn dng dng chuyn i t s sang tng t. AD7524 l b chuyn i D/A 8 bit, dng mng R/2R ladder. C s bn trong nh hnh 5.8.

289

AD7524 c u vo 8 bit, c th b cht trong di s iu khin ca u vo CHN CHIP OUT2 ni t). Nu mt trong hai u vo iu khin ln cao th lc ny d liu vo b cht li v u ra tng t duy tr ti mc ng vi d liu s b cht . Nhng thay i k tip u vo s khng tc ng n ng ra tng t OUT 1 trng thi cht ny. Cc thng s ca IC c lit k bng 5.2 Bng 5.2 Cc thng s ca IC DA7524 v u vo ghi khi c hai u vo iu khin ny u mc

thp, th 8 u vo d liu D7 D0 sinh ra dng tng t OUT1 v OUT2 (thng

290

Quan h ng vo v ng ra tng ng c trnh by bng 5.3 Bng 5.3 Quan h ng vo v ng ra

ng dng ca IC AD7524 thng dng giao tip vi cc vi x l v vi iu khin chuyn i tn hiu s sang tng t nhm iu khin cc i tng cn iu khin. Sau y l mt s ng dng ca IC AD7524 giao tip vi cc IC khc.

291

292

3.2 IC DAC0830 DAC 0830 l IC thuc h CMOS. L b chuyn i D/A 8 bit dng mng R/2R ladder. C th giao tip trc tip vi cc vi x l m rng hot ng chuyn i D/A. S chn v cu trc bn trong ca DAC0830

293

Hot ng ca cc chn ( CHIP SELECT) l chn chn hot ng mc thp. c kt hp vi chn ITL c th vit d liu. ITL (INPUT LACTH ENABLE) l chn cho php cht ng vo, hot ng mc cao. ITL kt hp vi cho php vit.

(WRITE) hot ng mc thp. c s dng np cc bit d liu ng vo cht. D liu c cht khi mc cao. cht c d liu vo th v

phi mc thp trong khi ITL phi mc cao. (WRITE) tc ng mc thp. Chn ny kt hp vi chn mch cht c truyn ti thanh nghi DAC trong IC. (TRANSFER CONTROL SIGNAL) tc ng mc thp. Cho php DI0 DI7 l cc ng vo s trong DI0 l LSB cn DI7 l MSB. IOUT1 ng ra dng DAC1. C tr s cc i khi tt c cc bit vo u bng 1, cn bng 0 khi tt c cc bit vo u bng 0. c vit. cho php d liu cht ng vo

294
IOUT2 ng ra dng DAC2. Nu IOUT1 tng t 0 cho n cc i th IOUT2 s gim t cc i v 0 sao cho IOUT1 + IOUT2 = hng s. Rfb in tr hi tip nm trong IC. Lun c s dng hi tip cho Op Amp mc ngoi. Vref ng vo in p tham chiu t -10 n +10V. VCC in p ngun cp cho IC hot ng t 5 n 15V. GND (mass) chung cho IOUT1 v IOUT2. Sau y l mt s ng dng ca DAC0830 chuyn i t s sang tng t. iu khin volume bng s

iu khin my pht sng bng s

295

B iu khin dng bng s

296

DAC8030 c th iu khin c dng ra thay i theo d liu s vo. Dng ra thay i t 4mA (khi D = 0) n 19.9mA (khi D = 255). Mch in trn s dng cho cc mc in p vo khc nhau t 16V n 55V. P2 thay i gi tr dng

BI 4: CC MCH NG DNG
1. iu chnh v n nh v tr ca mt vt Khi yu cu mch iu khin i hi khng ch mt vt dch chuyn v c nh mt mc khng i c th thc hin mch iu khin theo s trn hnh sau

297

Khi t mt gi tr s nh phn vo ng vo DAC, in p ng ra Va tc ng mch Op-Amps iu khin ng c servo M a vt cn iu khin n mt v tr t trc (v tr ny c xc lp khi Va = Vp). Nh vy tu vo gi tr ca s nh phn, vt cn iu khin s dch chuyn trong chiu di t 0 n 100mm. V mt l do no lm cho vt cn iu khin lch khi v tr cn bng (Va Vp) v d nh antenna b gi thi lch khi v tr cn bng ... s lm thay i in p Vp so vi mass (do bin tr thay i v tr), iu ny s tc ng vo Op-Amps thay i in p trn ng c servo M, tc ng da vt cn iu khin v v tr cn bng. 2. Mch khi ng m (Ramp-Start) Trong mch iu khin h truyn ng c ng c s dng k thut s, ngi ta thng s dng cc b khi ng m gip h thng trnh c cc xung t bin c hc gip ng khng b xon gy trc hay h hng cc chi tit c kh cng nh in t khc. Mch ny c s khi v nguyn l lm vic nh hnh sau:

298

Khi h nhn c tn hiu "START" t mch iu khin, mch m nhn xung clock v bt u m ln, cng lc ny ng ra Op-Amps l tn hiu EOC (End-OfConversion) ang mc cao. Theo nhp m ln ca mch m, DAC chuyn i cc s nh phn theo gi tr ln dn nh dng sng in p VAX trn hnh v. Tn hiu ny iu khin h thng khi ng m cho n khi VA = VAX th tn hiu ng ra Op-Amps EOC s v 0 dn n kt thc qu trnh khi ng m do cng AND 3 ng vo hot ng nh mt kho in t. R rng, thay v t bin t 0 n VA, tn hiu in p VAX tng dn theo tng nc nh. Khong cch gia 2 nc chnh l phn gii ca DAC. 3. Mch pht xung chnh c tn s v sng dng in p Nguyn l lm vic ca mch ny tng t nh mch iu khin n qung co trong chng vi mch nh nhng thay v cc ng ra iu khin n th y cc tn hiu ny a vo DAC 0808. Khi thay i chng trnh xut ra t vi mch nh ta s thay i c sng dng in p pht ra vout.

299

Nu mun tn hiu ng ra l sng vung, ch cn np trnh vo EPROM nh sau:

Nh vy ch cn tnh ton li cc mc in p tng ng vi cc ng vo tn hiu s ly t chng trnh trong EPROM, ta c th to ra bt k sng dng in p no ng ra. Khi mun thay i tn s ca sng dng in p vout, ta ch vic thay i tn s ca mch pht xung dng vi mch 555. Do , tn s ca in p v out c chnh trong mt khong rng v trn.