Mi \Ch lufin Ilf cling tlHrong OU\)'( !TIa hlnh hoa btmg cac ng{)n IlgCf lilu tl,lC. Cic alomat co In.mg thai hiIu hi.m bicll dicn hm.11 d(lllg eua mach co the dW,Je mo til bang nhGng 1110 hloh thu II,lC Irang do de bie~n lu'U giiI de lhClI1g tin tn.li1g thai, Khi d6 de Ihan t;.ic cua otomat huu h<;ln ouve me) ta b.\ng nhCmg buoe l~p dong b(J thea xung nhjp dong h6, \'I1'i nhung phfll1 llil.inil L'lHly~n Irang thai lUang ling yoi Ir<;lng thai hi¢n thai. Day la vf dy mn ta olomat hOll h,-,111 Ihlfc hl~n vi¢c nh:111 bJd c,\c bIt '\' lien lie~p l1 dong dO' li~u vao. \10 1;i dWl'C \'iet Irell ngon ngu' Vl-lDL architecture BEHAVIOR or RcC is type STATE_TYPE is (STATE_ZERO. STATCO"E): signal STATE: STATE_TYPE:~ STATEjERO: process hegin 11 wait until clock 'event' and clol'k = '\ '; i[(in ~'l')tben . case STATE is Hinh 4.5 D6 hlnh ehlly~n lrang th,li ella (itlJmat hliu hannhan bie~t da)' de hit' I' lien licp, else end if end process end BEHAVIOR. when =0 STATE ZERO STATE ¢= STATE O"E: out ¢::: '0'; when =0 STATE_OKE STATE <= STATE O~E: out ¢::: '! '; end case STATE <= STATE_ZERO, out ¢::: '0'; Ta xet tnJ'ong hqp mo hlnh hoa hllllh vi 6 muc kien true hang nhUng ngon ngu thu U,Le, Phuung thtIC chung la bieu dicn cae phep gan luan tt! cho d,e bien bang nhDng cau true di~u khien lu6ng thong lin nhu re nhi-inh, \'ong 85 1'.lp. g9i de m6 hlnh ( trong ngiJ u."luh ella de ng(m ngiJ HDL, cae m6 blnh IU"O"llg dU'l1ng voi nlllTng chuang trlnh COil trong de ngan ngiJ I~p trlnh phfln lll~m ). Dietl !lay e!lO 101 th:iy cae h~H1h vi eLla mi teh co th~ duoc mo hlnh hoa !lllu' Et (flp h(.1"p de phep toc.in va quan h¢. Ok phep lo{m se wong lmg v6i phep g,in, nhom dc gi.l.ll ho~c de phcp gQi ma hlnh. SLr pill.! thuQe clla c te Mlllg (hT ii¢u vi:' dong dicu khien se .xae d~nh nhfrng rimg bu\)e vc trtnh tL.f eLla de phcp loall va l11ue d() Mmg thai tlwe hi¢n ehlmg trung hicll dien 1116 hlnh. Vi du nhu klli ta m6 1.1. lap hqp de l~nh m{lY h~ng ngon ngiJ VHDL, ta co the Jlh'~11 dune elm.1ll cllLwng trlnh sau. Ir <= [deh l pc ): case ir is when ~ AND ace <= rcgu and rcgh: when ~ OR aec <= rcga and n:gh: Whl'lI ~XOR ace <= rega and rcgh: when ~ ADD end case: pe<=pc+l: ace <= I"l'ga and rcgh: Do,.tll ehu(1ng trlnh nay ma la ba buoe tlll!e hi~n. G(Ji hiunjdc/i. h~l.1n nay td h.li gia trj eua Ihanh ghi iI", Cic il!<I cl10n gia Iri ello (ICC tuang ung \'O"i e,i.e phcp to{m duoe ghi trong thanh ghi I¢nh il" \"oi de 10i.1.11 iWng ntllH trong thanh ghi reg(f va rcgh. Tang h9 d~m chuang trinh pc len 1. Ph;}n tlch de qua trlnh tlll.fe hi~n 1~l1h ta thay dong l~nh phep loan cu6i cung e6 th~ tlll.rc hi¢rl song song vO"i hai phcp trcn. Ok mo hlnh banh eha phep bieu dicn de khung thCii gian thl!e hi¢n ph~p to,.in \"oi nl<)t nlue dQ tl! do nhi.lt djnh. Vi~e kiem soat tr1nh II! thl!e hi¢n va hanh vi ella m',lch theo thai gian Cling e6 the dUQ'e ma blnh hanh vi eung K6 c£\p. Ta xcI m() hlllh (Jt(m1i11 htiu h'.l11 dil ncu ('j \'1 du tJ'U'lk IrUt')',,', VI':,,' ki':ll1 ,,0(11 \'C: Ihi\i gian duo'c IIH,rc hicn dU'a \'~IO cue loan IU dClllg bt.) dU't'ii d'.ll1g hl~U tlllrc elm clIU l~nh wail. Do 1116 hlllh chi co llH:I\ to(m ttl' \\'elll 1\<:11 ut c.i uie phep to(\l1 se Ilulc lll~n trong m(lt YDng l~p Ihl)"i gian, Vi2c dlCU khll'll \'C: Illi)'j gian cho pilep til kiem .,>oM trlnh t~r Ilmc hien cue plll:p to(m Cli,1 lll(l llinh. Trong "\ d~L Inro-e, hai phcp loun cHili ph;,'li lhl\'e hi¢n lU:in tl.r. Cl)1l I'!kp t()(111 thu' ha co lh6 : ong song YlTi ml)t lrong hai phep toun lren. Do lit') 1,1 , ':lll thcnl ei\c diu l~nh \\'1.111 d~ kie'm soat lrinh \It 111lye hi¢n cining: wait until dock' event and clock = 'J ': ir <= fdeh (pc): wait until clock' evcnt and dock = 'J' Case ir is when ~ ADD ace <= rcga + regh: when:::=> AND ace <== rcga & rcgb: end case pc <== pc + l: Trong trUt>"ng hqp Jl~IY, mel hinh tae d~lng v;\o b(l mCi ph(SJl!;; \'il b(l mel phung ~0 lam tre qui\. tdnh thu hai vi\ thl\' ha. §·t3, C~k Inti hinh triIU tuVng Trong 1ll\IC n~ly, eht"lllg ta mo tit d.c m() hlnh trU'l1 IU\illg dlll1g dii bi~u eliell nweh tren cae mLi'c ell) ph[lll tich va theo cae goe d(l quail ~al khac nhau tren !TIue logic vii lllLfc kicn truc. Cae 1110 h1nh lIay thU(Jllg d~i'a trcn uieh bieu dien hang e,ic do hinh. 1. Cac call trUe C[ill true Cll<.l m<'.lch c6 the; m6 hlnh hoa d~fa \,iiO de c,fu tnk lien k~'t. Oic dIU true lien ke't hao g6m t(lp hgp de m6c\un, t.)p h0P d.c t1l<lng k~'t n6i yZI K7 quail h~ Iicn ke~t giUa ute m6dun va m<.mg ket noi. M6 hinh diu tnk e6 the dU\1C bieu dien btmg nhieu d.eh. Co the' bi~u dien m6 hinh c;lU true mQt deh don gi[lll bAng de S[eU d6 th!. trong do moi dinh cua de) tili wong U'ng \'6i cae m6dun V~I eung wang (fng \'oj mang licn keL Quan h~ licn ket gua de m()(lun va m,.mg dut;1c m6 tii bang de 111a tr~l11 lien kct. Ta e6 "jeu ck,) th\ tuong duong \'6i !ll0t do thi hai phan eo t(lp hqp dinh ehia lam hai phfln, trong do m0t ph{in llfcmg duong \'61 de rnodull, ph[in ell]) h.li wong duong Vl1i de !lli}ng, ~'l()t deh bicu elien kl1k ella e\u true I~I hicu dH:n nH)[ m6dun hAng de diem dAu euoi hay la eang \,,\ m6 til Sl/ kc't noi giil'a de Ill'-,lilg \'O'i uic e6ng el\a mod un. Th6ng Ihu011g de ma tr,~n lien kct rt\1 t,.1n m',m. khi do slr dl.ll1g (\allh sach m~l11g eo hi~u qu,i han de m6 la e[lll true. Trong danh sJch m'.l11g ta d(ll1h sei tftt d cae IlWl1g n6i voi tll'ilg modun ( danh saeh Im.li nilY g9i Iii danh <leh 1l1<,lng huang mbdun ) 11O[le (i<illil sCi t[lt ca de m6dull kct neii v6i m9t m'.lllg ( danh s{\eh m',mg hlt'O'ng l~wng ). Vi dy, tren hlnh 4.6 ta bieu dicn cau tnk eua m()t doi tlfl,1ng gam ba khoi ea so. Ciie e,1'u true kc't noi dL(qe bieu dien btlllg ma tr(m lien ket vii do th!: ._-', 88 · 1 -p,!i L m . . " Ma tr~n lien ket & danh siteh lien kct: III I 1112 Ill., 1 0 0 I1 1 n 2 il 3 lIinh 4.6 nJ~U dien m() hlntl c.Yu tnk, Cae cau true lien ke't eo the t~\o thinh tr~t ll! nhu sau: nhung mod un Bam ti,li cae nut la Ii de doi tuqng co sa eling t~\P hqp de eang, Cae mod un kh6ng nam t~li nut hi l~l t(\P hQP d.e mbdun con, T(Lp IWp cae mi.mg va cae cau true lien kct sc gttn ket cae m,.mg yoi dc cring clla dc mouun ho~c v6i dc cong eua dc m{xlull con. Trong Vt dlJ tr116c. cae modun c6 th~ co dura ute 1l10UUIl con nhu' kh(}i me' Kh(}i m.: chLra cac kh6i m: 1 va 01 22 va cac cong Pli' Pn. Pl;' p_,~. P2" 2. M~ng logic M,.mg 16gic \('lng quat Iil. ITIi)t cau true lrong d6 nhu-ng modun t' II hi Wong ling \'oi d.c h~lln logic tuan II! h04C 16 ht;lp. Kh,ii tli¢In Bay Ia kha tong qu,it va m,.mh. Ta gi6i han hai llUong htJp doi vai nwng cau truc: m' l1lg logic to h0P va ITI".lOg logic dong hQ. M<'lI1g logic t6 hQ'p hay can gt:;ti ia m,~ng Baal la mQl c,lu truc phan cAp. trong do: • ~16i m6dun I,.ti la tliang ling vai InQI ham logic co nhieu diiu V~IO \,~l m()t dilu ra. Ham nay gqi \;J. h~l\n el:lc bO. • Ole cang vilo ra dLrtJc chi a lam hai nhom: dc c6ng \,~IO \'~I dc cong ra. Ck c6ng kh6ng thuQc dc mMun can cling dl1qc chi a lam hai nhom: dc dau vito va doc dd.u ra so dip. • \tlc')i m,~ng c6 IlH?t c6ng tach bi~t gqi iil. cring nguon \'~I co djnh lmong tlr cong nguon t6i dc cong khac. o.IC c6ng nguon ella Ill mg c6 the ho(\c la ctiu d.o so cfip hO(IC la daLl ra so (fip dla IlH",dun thuQC IllUC thrip hon. Tren tlwc Ie'. cong ngu6n con co the EI dc Mill ra ella nhu-ng ham Cl:lC ht). • Quan he giu-<\ dc nwng trong m6dun la quan h¢ dU(K sAp 11191 phan. a : b =1 p= ab i- 1 x n~ q = p+c :- y M()t m'.lI1g logic co the dU0C bic"u dien king cac eto th!. Dc" dOll gi,-'tn. lit xcm xGI tru'ang h0P rnallg kh6ng phfll1 cAp. 86 thi m:.lI1g l6gic G,,(V,E) la del th! co hu6ng Irong et6 t(lp htJp C,-lC dinh V chua d.c phan tLr IiI wang u'ng "m9t- , , c-: Hlnh 4.8 Sa do Illang logic. mOl" v6i d.c diiLl \'~IO sa cap. cac ham Cl:lC b<) ( Iii. dc modun ) va cae dd.u ra so cAp. T~p IH;tp d.c cLIng co huong E bicu dicn sY' phflll tach m,.mg nhicu qrc thanh dc m' lIlg hai clJc. Then ctjnh nghTa. do Ihi nh(lll duvc se kh6ng chua m~\ch vong hai VI nwng hI dl1t;1c sflp 89 / -" , Va.: ~/- , Vp :: ' '", IIlnh ·t9 So do Illang logIc- m()l phfin d6i \'O'i de m6dull. Hlnh ,-1 9 the hi¢n do th! mang ltigle ella du tnk 6 h1nh , UL trong do: v ",Vh'\', n ha dlllh \';\0: v"v): hal dl11h ra: VI"\"I: hai dillh trung glan tHong {fng \'('1i cae h~un I()gic. Mi,mg logic lit hicli dicil h(m hop theu eau true V~l hanh vi, VI cae eo ehe 1ii.?11 k2"t cung cap cac cau true. con cie hilln logic chra ra hanh vi !,.ti cae eang ella dc modun !lam lili nul I,i. Trong m(lt so Inrlmg IWp, de h~lln logic kh6ng Ihe' tillfc hl~1I dUq"c nhu ViJy VI d.e gi6i h,-,111 ky thu(11. Vi dl.l ham AND 64 (hiu vau e6 Ihoi bicll chen himg cae hilln qle b(l ella m,.mg logic. Nlllrng trong k5' thlli~t h;lIn AND tl6 co Ihd dm,1C phan tach thanh t(lp hqp de phAn ILl' Ar ;D hai eong vii UO L16 co e~lu Irue khac v6i han dilU. Trang nhCIng tll1lmg hqp ma m~U1g logie dung de m6 ta de lien ke't giiIa dc cong 16gic. ta eo bicu dien cau true t!IlUhl tuY'. PIHln h'm, lll'-,Illg logic SU u~lng doi bieu dien cie ham logic e6 nhieu dUll \"ilo-d~iu ra himg phuong phiip cAu true. Th{lt v,-)y. cae I1li,1ng logic CIS luang lluan "m(ll - m(lC \'6i h~l1n vilo / ra logic to hqp, Chung 1<-1 c6 th~ nh<~n dLf<jc h~lIn nay bang dlCh kc'[ h<.ip de hiun n,le b¢ \'di nhau de: xac dillh dc (ttu ra Sl1 Ctp Ih~o de dill! \',\0 "Ci e:'ln. Thono thuQ'llo de hilln \'J.o/ra kh6ng the de (btu! bie:u die!! du6i (I<In" I' D LO L" /;) ehurin dc, VI (iL,1 nhu ch.lIlg ehurin tac tuycn hO~le ht)i, hO(lc duoi u;mg cic S(1 do qlly~t djllh nhi phJn do k[Ch Ihu'de v21 d(l phuc l<.lp ella hilill. D6 lit lllt)t trong cIc nguyell nhfm su- dl,lllg m6 hinh llli,Il1g kigie. Mei hlnh n,\y cung kh6ng ph",i ia biell (lien duy nlH'lt ella cae nwch 10 bqp. Cic nwng logic co dong bt) ia tru'ong IWp t6ng l\U[lt h6a eLla dc 1ll<.lIlg logic [6 hqp. M'.lIlg logic \m.li nay dung dC' IllO I,,'t <.:ac lll<,leh lUan Il,r iillll vi~c Iheo ehl>' tI(1 dong bl\ Trang m6 hlnh nily cac moctlln li.li la c{l the: dung ct~ m6 l,i de h:lln ltigie to hqp c{l nhifu dau vao \'O'i Jlll?t ("-'iu ra huilc de ph an ILl' Ire d6ng b(1. M •. lng khong nhSt Ihiet phi"ti clLrQ'c S{lp ti:mg ph[in tll'lmg ung v6i ("IC modun. Tuy nhiC'Jl. 11101 In<.mg con eLla m,.tng dang xct, trong d6 dc ph{in IU ngu6n kh6ng ph"li l~l phtin tu tre dong b(l, c6 th~ dU0c S{lp Hrng ph:in de m6 hlnh ho,i nhCIng tnJ'('mg hqp d~le hi~1. NhCIng t!"lIong hqp d~le hi~t n~ly y~lI diu !rong nhfrng: m~lCh dong b9 kh6ng chua nhCIng v(mg ph,,'\l1 hl)i qua' dc nli,leh to hQp. 90 3. C{IC oUnnat y~ su do tr:;mg tluH Tren phuong di¢ll hill1h vi, 6' lllue logie, cae nwch day co th~ duqe bi~ll <lien bAng d.c 616mal huu IWll. Oie 616111al huu IWn dU0e dinh nghi<l I;) m(ll bO n[lIn A == < X, y, S, 8, 'A. >, Ir(Jng do: X I~l I,~p h(/p de k)' tl! vao eua 616111<1t. Y Ii 1(lp hqp cac ky II! ra ella alamat. S I;) I,~p IWp CiIC tr<.ll1g thai ella diamat. - T(lp IH.1p de hi:l!11 chuyen tn.lIlg Ihai : 8 : X x S ) S T(lp hqp de h~Hn HI: 'A.: X x S ) Y : 6t(Jmat Mealy 'A. : S ) Y : OlOmal Moore. Vii S,) la tl"i.ll1g Ih;.ii kh6i dOng ella 6t6mal. Ikmg ehuyen If' ll1g tluii ella 6t6mat ehua d.c tfi lI1g thili clwyen licp va nhiJng hilm ra. T1J'ung lrng voi eae b;'mg chuyen tn.lI1g th{li, khi bi~u di&n atomal btUlg do th! ta eo sO do ehuyen tr<.lI1g thili. So do ehuyc'n 1r<.lI1g thai Ill. mQt do thi co hlf{Jng (;,(V,E), trong do: - T~p hop de dinh ella do thi V tuang ung "11191 - ITIQI" v6i t(lp hqp cae trang thai Sella 6tomat. - T~lp h<.1p de eung co huong E tHong It'ng "11191 mQI" voi st.J' ehuyen tiep tr'.l11g Iluli. NhCing W ehuy{n tic'p Irang thai nay du'q'c d~\C Inmg b6i hiun ehuyen li6p t D~\C hi¢l, cung ( V" \'1 ) 16n t' li n2:\1 t611 1'.11 ] ;.)1 11,1' vao XE X S,-\O cho o(x, s,l ~ s" 'd i,j ~ 1,2, " 1 S I. Trong m() hinh ot6mat Mealy moi eung dU'<;1c g{m nhlin b<1i e(lp k)' tl! XIA(X, s,). Gm trang mo hinh 6t6mat Moore moi cling dHq'c gtlll nhan b<'ii or. va moi dinh I', E S duq'c dan nhun IU<1ng ung voi hilIl1 ra 'A.(s;). Ta hay xci vi dl.l ot6mal Mealy Ilwc hi¢1l \'i~e dong b9 giiJa hai lin hi~u. Cic d'-Iu vao so cap la a va h, lIn hi~u khiJ"i 1,.10 f. Otomal co mQt duu nl S<1 dp o. Dtiu ra 0 nh(1ll gia tri 'I' n6u hai tin hi¢u a vi:t b el:mg dong Ihoi nh~1ll gi<i trj fl"l/C ho~e lrong tlUang hop m¢ttfn hi¢u Ilh,~n gia tf! fl"ll(, con tin hieu kia nh(1l1 gia Irj Trill! trong thai diem tnr6e d6. Otomal eo bon tn __ ~ng th{ti "~IU: Tn.lllg th{li khi1i d<)ng sll' - Tn.ll1g thai nh6 Sl khi a ia lrue "a b lalalse, 91 . Mill ra ella nhu-ng ham Cl:lC ht). • Quan he giu-< dc nwng trong m6dun la quan h¢ dU(K sAp 11191 phan. a : b =1 p= ab i- 1 x n~ q = p+c :- y M()t m'.lI1g. dl1t;1c sflp 89 / -& quot; , Va.: ~ /- , Vp :: ' '", IIlnh ·t9 So do Illang logIc- m()l phfin d6i 'O'i de m6dull. Hlnh ,-1 9 the hi¢n do th!. PIHln h'm, lll&apos ;-, Illg logic SU u~lng doi bieu dien cie ham logic e6 nhieu dUll "ilo-d~iu ra himg phuong phiip cAu true. Th{lt v ,-) y. cae I1li,1ng logic CIS