![數(shù)字邏輯設(shè)計(jì)及應(yīng)用教學(xué)課件:7-5 同步狀態(tài)機(jī)設(shè)計(jì)2_第1頁](http://file4.renrendoc.com/view/542fd2f8558f35096e954f686de0b9ca/542fd2f8558f35096e954f686de0b9ca1.gif)
![數(shù)字邏輯設(shè)計(jì)及應(yīng)用教學(xué)課件:7-5 同步狀態(tài)機(jī)設(shè)計(jì)2_第2頁](http://file4.renrendoc.com/view/542fd2f8558f35096e954f686de0b9ca/542fd2f8558f35096e954f686de0b9ca2.gif)
![數(shù)字邏輯設(shè)計(jì)及應(yīng)用教學(xué)課件:7-5 同步狀態(tài)機(jī)設(shè)計(jì)2_第3頁](http://file4.renrendoc.com/view/542fd2f8558f35096e954f686de0b9ca/542fd2f8558f35096e954f686de0b9ca3.gif)
![數(shù)字邏輯設(shè)計(jì)及應(yīng)用教學(xué)課件:7-5 同步狀態(tài)機(jī)設(shè)計(jì)2_第4頁](http://file4.renrendoc.com/view/542fd2f8558f35096e954f686de0b9ca/542fd2f8558f35096e954f686de0b9ca4.gif)
![數(shù)字邏輯設(shè)計(jì)及應(yīng)用教學(xué)課件:7-5 同步狀態(tài)機(jī)設(shè)計(jì)2_第5頁](http://file4.renrendoc.com/view/542fd2f8558f35096e954f686de0b9ca/542fd2f8558f35096e954f686de0b9ca5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、7.4 Clocked Synchronous State-Machine Design時(shí)鐘同步狀態(tài)機(jī)設(shè)計(jì)-217.4 Clocked Synchronous State-Machine DesignConstruct a state/output table (狀態(tài)輸出表) corresponding to the word description.(Optional)Minimize the number of states.State assignment.(choose a set of state variables)Substitute the state-variable com
2、bination into a state/output table to create a transition/output tableChoose a flip-flop type for the state memory.Construct an excitation table ,get excitation equation and output equation.Draw a logic diagram.2Examples for Clocked Synchronous State-Machine DesignTwo simple examplesDesign a 3 bit m
3、odulo-8 binary counter設(shè)計(jì)一個(gè)3位二進(jìn)制模8計(jì)數(shù)器 Design a 110 sequence detector設(shè)計(jì)一個(gè)110序列檢測(cè)器 Examples for state table designExample 1(P558);Example 2(P566);Example 3(P570)State diagram design(T-bird tail-light )The Guessing Game 3Examples for Clocked Synchronous State-Machine DesignTwo simple examplesDesign a 3
4、bit modulo-8 binary counter設(shè)計(jì)一個(gè)3位二進(jìn)制模8計(jì)數(shù)器 Design a 110 sequence detector設(shè)計(jì)一個(gè)110序列檢測(cè)器 Examples for state table designExample 1(P558);Example 2(P566);Example 3(P570)State diagram design(T-bird tail-light )The Guessing Game 4State table design(example 1)(P554)Design a clocked synchronous state machine
5、with two inputs, A and B, and a single output Z that is 1 if: A had the same value at each of the two previous clock ticks, or B has been 1 since the last time that the first condition was true. Otherwise, the output should be 0.設(shè)計(jì)一個(gè)具有2個(gè)輸入(A、B),1個(gè)輸出(Z)的時(shí)鐘同步狀態(tài)機(jī),Z為1的條件是:在前2個(gè)脈沖觸發(fā)沿上,A的值相同從上一次第1個(gè)條件為真起,B的
6、值一直為1500100111000011111006SAB00 01 11 10S*ZState ExpressInitial state INIT0A0A0A1A1A0Got a 0 on AGot a 1 on AA10OK0OK0Two equal,A=0 last OK0A1A10A0A0OK1Two equal,A=1 last OK1OK11OK0OK0OK1BA1因B而OK,A為1 OK1B1A0OK0BOK1OK1因B而OK,A為0 OK0B1A0OK0BOK1OK11OK0OK0OK1BA11、state table 7SAB00 01 11 10S*ZState Expre
7、ss1、state transition tableInitial state INIT0A0A0A1A1A0Got a 0 on A Got a 1 on A A10OK0OK0Two equal,A=0 last OK0A1A10A0A0OK1Two equal,A=1 last OK1OK11OK0OK0 OK1BA1因B而OK,A為1 OK1B1A0OK0BOK1OK1因B而OK,A為0 OK0B1A0OK0BOK1OK11OK0OK0OK1BA12、minimize the number of states OK1 OK1 OK0 OK0OK,A=0OK,=0OK,A=18初始狀態(tài)
8、INITA0A上捕獲一個(gè)0 A上捕獲一個(gè)1 A1OK,A值為0 OK0OK,A值為1 OK1SAB00 01 11 10S*Z0A0A0A1A10OK0OK0A1A10A0A0OK1OK11OK0OK0 A11A0OK1OK1OK0 OK11、transition table 2、minimize 真的需要一一嘗試嗎?合理的狀態(tài)賦值(P412)最簡單的分解的單熱點(diǎn)的準(zhǔn)單熱點(diǎn)的0001001011101113、 State assignment.從23中選5種一共有 種8!5!3!8!5!3!5種編碼5個(gè)狀態(tài),又有5!種5!共有 94、transition /output tableINITA0
9、A1OK0OK1SAB00 01 11 10S*Z0A0A0A1A10OK0OK0A1A10A0A0OK1OK11OK0OK0 A11A0OK1OK1OK0 OK1 000100100100100100100101110101101101101101110110110110110111111111111111111Q1Q2Q3Q1*Q2*Q3*5 input variables: A,B,Q1,Q2,Q34 output variables : Z,D1,D2,D3D1 D2 D3transition/excitationtable5、choice the Flip-Flop,get the
10、excitation equation and output equation.Use D Flip-Flop10AB00 01 11 10Z00011000100101110111Q1Q2Q3100100100100100101101101101110110110110101110111111111111111Q1*Q2*Q3*D1 D2 D3Q2Q3AB00 01 11 1000011110Q1=0D2Q2Q3AB00 01 11 1000011110Q1=100001100001101111110000000000000Minimal risk (最小冒險(xiǎn)),未用狀態(tài)初始狀態(tài)Output
11、 equation:Z = Q1Q211Q2Q3AB00 01 11 1000011110Q1=0D20000000000000000Minimal risk最小冒險(xiǎn),未用狀態(tài)初始狀態(tài)Q2Q3AB00 01 11 1000011110Q1=11100001101111110D2 = Q1Q3A + Q1Q3A + Q1Q2BQ2Q3AB00 01 11 1000011110Q1=0D20000dddddddddddd Minimal cost.最小成本,未用狀態(tài)作為無關(guān)項(xiàng)D2 = Q1Q3A + Q3A+ Q2B12D1D2 = Q1Q3A + Q1Q3A + Q1Q2BD1 = Q2Q3 +
12、 Q1思考:最小成本法D1?13D3D3 = Q2Q3A + Q1AD2 = Q1Q3A + Q1Q3A + Q1Q2BD1 = Q2Q3 + Q1激勵(lì)方程D3 = Q2Q3A + Q1A思考:最小成本法D3?146、draw the logic circuit(略)D3 = Q2Q3A + Q1AD2 = Q1Q3A + Q1Q3A + Q1Q2BD1 = Q2Q3 + Q1Excitation equationD3 = Q2Q3A + Q1AOutput equation:Z = Q1Q2說明: 最小冒險(xiǎn)法 所有未用狀態(tài) “安全”狀態(tài). 最小成本法 所有未用狀態(tài)的下一狀態(tài)作為無關(guān)項(xiàng) 電路的
13、激勵(lì)方程簡單,不夠安全.15合理的狀態(tài)賦值選擇復(fù)位時(shí)容易進(jìn)入的狀態(tài)作為初始狀態(tài).使每次轉(zhuǎn)移時(shí)要發(fā)生改變的狀態(tài)變量數(shù)最小化使一組相關(guān)狀態(tài)中不變化的狀態(tài)變量數(shù)最大化發(fā)現(xiàn)和利用問題描述中的對(duì)稱性將狀態(tài)變量組分解為有明確含義的位或字段,相對(duì)于狀態(tài)機(jī)的輸入效果或者輸出特性可以使用多于最小值的狀態(tài)變量數(shù)(便于分解)未用狀態(tài)的考慮16Example 2: 1s-counting machine (“1”計(jì)數(shù)器)(P566)Design a clocked synchronous state machine with two inputs, X and Y, and one output, Z. The ou
14、tput should be 1 if the number of 1 inputs on X and Y since reset is a multiple of 4, and 0 otherwise.對(duì)兩個(gè)輸入X和Y同時(shí)計(jì)數(shù),當(dāng)1的個(gè)數(shù)為4的整數(shù)倍時(shí)輸出為1.17Example 2 1s-counting machine (P567)1Got zero 1s S0S0XY 00 01 11 10Zmeaning SS*S1Got one 1s S1S2Got two 1s S2S10S1S2S3Got three 1s S3S20S2S3S0S3S3S0S1S000001111018Exa
15、mple 3:combination lock (P568)a “combination lock” state machine that activates an “unlock” output when a certain binary input sequence is received:Design a clocked synchronous state machine with one input, X, and two outputs, UNLK and HINT. The UNLK output should be 1 if and only if X is 0 and the
16、sequence of inputs received on X at the preceding seven clock ticks was 0110111. The HINT output should be 1 if and only if the current value of X is the correct one to move the machine closer to being in the “unlocked” state (with UNLK = 1).設(shè)計(jì)一個(gè)具有個(gè)輸入和個(gè)輸出(和)的時(shí)鐘同步狀態(tài)機(jī)當(dāng)且僅當(dāng)為并且前面?zhèn)€脈沖觸發(fā)沿到來時(shí)接收到的輸入序列為時(shí),輸出為當(dāng)且
17、僅當(dāng)?shù)漠?dāng)前值是上述序列中的個(gè)正確值以使?fàn)顟B(tài)機(jī)逐步接近于“解鎖”(即)狀態(tài)時(shí),輸出為19Example 3:combination lock (P568)注意:輸出是中間過程,應(yīng)用時(shí)應(yīng)隱藏207.5 Designing State Machines Using State Diagrams T-bird tail-light(570)LALBLCRARBRCINPUT:LEFT(左轉(zhuǎn))、RIGHT(右轉(zhuǎn))、HAZ(應(yīng)急閃爍) , that requests the tail lights to be operated in hazardmodeall six lights flashing on
18、 and off in unison. a free-running clock signal (時(shí)鐘信號(hào))output:LC,LB,LA,RA,RB,RC(控制6個(gè)燈亮或滅 可以完全由狀態(tài)控制) 21Step 1: set up enough state with different meaning ;Examples : T-bird tail lights control 22IDLE:全滅L1:左邊1個(gè)燈亮L2:左邊2個(gè)燈亮L3:左邊3個(gè)燈亮R1:右邊1個(gè)燈亮R2:右邊2個(gè)燈亮R3:右邊3個(gè)燈亮LR3:全亮狀態(tài)輸 出直接利用狀態(tài)控制輸出231、Initial state diagram
19、and output table 構(gòu)造狀態(tài)圖IDLE:全滅L1:左邊1個(gè)燈亮L2:左邊2個(gè)燈亮L3:左邊3個(gè)燈亮R1:右邊1個(gè)燈亮R2:右邊2個(gè)燈亮R3:右邊3個(gè)燈亮LR3:全亮IDLEL1LL21L311R1RR21R311LR3H1HLRH+LRLHRRHL24IDLEL1LL21L311R1RR21R311LR3H1HLRH+LRLHRRHL1、構(gòu)造狀態(tài)圖完備性 離開某一狀態(tài)的弧線上的所有轉(zhuǎn)移表達(dá)式的邏輯和為1。無二義性的HRH+RH+RHRHLHLH+LH+L改進(jìn)互斥性 離開某一狀態(tài)的弧線上的任意一對(duì)轉(zhuǎn)移表達(dá)式的邏輯積為025Ambiguous(二義性) A state table i
20、s an exhaustive listing of the next states for each state/input combination. No ambiguity is possible. A state diagram contains a set of arcs labeled with transition expressions. Even when there are many inputs, only one transition expression is required per arc. However, when a state diagram is con
21、structed, there is no guarantee that the transition expressions written on the arcs leaving a particular state cover all the input combinations exactly once.26Ambiguous(二義性)In an improperly constructed (ambiguous) state diagram, the next state for some input combinations may be unspecified, which is
22、 generally undesirable, while multiple next states may be specified for others, which is just plain wrong. Thus, considerable care must be taken in the design of state diagrams; 272、狀態(tài)編碼Q2Q1Q00 0 00 0 10 1 10 1 01 0 11 1 11 1 01 0 01、構(gòu)造狀態(tài)圖IDLEL1L2L3R1R2R3LR3合理的狀態(tài)賦值3、得到轉(zhuǎn)移列表 P427Output-Coded State Ass
23、ignment 282、狀態(tài)編碼1、構(gòu)造狀態(tài)圖3、得到轉(zhuǎn)移列表 P427HLRLHRRHL0 0 00 0 00 0 00 0 0H+LR0 0 00 0 11 0 11 0 0IDLEQ2Q1Q0 S轉(zhuǎn)移表達(dá)式S* Q2*Q1*Q0*IDLEL1R1LR329Q2Q1Q0 S轉(zhuǎn)移表達(dá)式S* Q2*Q1*Q0*HLRLHRRHLH+LR0 0 00 0 00 0 00 0 00 0 00 0 11 0 11 0 0IDLEIDLEL1R1LR3L10 0 10 0 1L2LR30 1 11 0 0HRH+RL20 1 10 1 1L3LR30 1 01 0 0HRH+RL30 1 0IDLE0
24、 0 01R11 0 11 0 1R2LR31 1 11 0 0HLH+LR21 1 11 1 1R3LR31 1 01 0 0HLH+LR31 1 0IDLE0 0 01LR31 0 0IDLE0 0 011111Q0* = Q2Q1Q0(LHR)+ Q2Q1Q0(RHL)+ Q2Q1Q0(HR)+ Q2Q1Q0(HL)= Q2Q1Q0 H(LR) + Q2Q1Q0(HR) + Q2Q1Q0(HL)用轉(zhuǎn)移表綜合狀態(tài)機(jī) P57730The Guessing Game猜謎游戲機(jī)(P580)Design a clocked synchronous state machine with four i
25、nputs, G1G4, that are connected to pushbuttons. The machine has four outputs, L1L4, connected to lamps or LEDs located near the like-numbered pushbuttons. There is also an ERR output connected to a red lamp. In normal operation, the L1L4 outputs display a 1-out-of-4 pattern. At each clock tick, the
26、pattern is rotated by one position; the clock frequency is about 4 Hz. Guesses are made by pressing a pushbutton, which asserts an input Gi.When any Gi input is asserted, the ERR output is asserted if the “wrong” pushbutton was pressed, that is, if the Gi input detected at the clock tick does not ha
27、ve the same number as the lamp output that was asserted before the clock tick. Once a guess has been made, play stops and the ERR output maintains the same value for one or more clock ticks until the Gi input is negated, then play resumes. 31The Guessing Game猜謎游戲機(jī)(P580)4個(gè)燈(G1G4)由時(shí)鐘控制輪流亮起如果按下的按鈕(L1L4
28、)與亮的燈對(duì)應(yīng),則猜對(duì)否則,ERR燈亮,表示猜錯(cuò)輸入:G1、G2、G3、G4(4個(gè)按鈕)輸出:L1、L2、L3、L4、ERR(5個(gè)燈)狀態(tài):6個(gè),S1S4對(duì)應(yīng)L1L4 Serr對(duì)應(yīng)ERR;SOK表示猜對(duì)32G1G2G3G4G1G2G3G4G1G2G3G4G1G2G3G44個(gè)燈(L1L4)由時(shí)鐘控制輪流亮起(沒有按鈕按下)S1L1=1S4L4=1S2L2=1S3L3=133G1G2G3G4G1G2G3G4G1G2G3G4G1G2G3G4S1L1=1S4L4=1S2L2=1S3L3=1如果按下的按鈕與亮的燈對(duì)應(yīng),則猜對(duì)(SOK)SOKG1G2G3G4G1G2G3G4G1G2G3G4G1G2G3G4
29、34G1G2G3G4G1G2G3G4G1G2G3G4G1G2G3G4S1L1=1S4L4=1S2L2=1S3L3=1SOKG1G2G3G4G1G2G3G4G1G2G3G4G1G2G3G4否則猜錯(cuò)(Serr)SerrERR=1G2+G3+G4G1+G3+G4G1+G2+G4G1+G2+G335G1G2G3G4G1G2G3G4G1G2G3G4G1G2G3G4S1L1=1S4L4=1S2L2=1S3L3=1SOKG1G2G3G4G1G2G3G4G1G2G3G4G1G2G3G4SerrERR=1G2+G3+G4G1+G3+G4G1+G2+G4G1+G2+G3G1+G2+G3+G4G1G2G3G4G1G
30、2G3G4G1+G2+G3+G4狀態(tài)轉(zhuǎn)換圖361、狀態(tài)轉(zhuǎn)換圖2、狀態(tài)編碼3、轉(zhuǎn)移列表狀態(tài)S編碼Q2Q1Q0S1S2S3S4SOKSERR0 0 00 0 10 1 10 1 01 0 01 0 1 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 X X X X 0 1 X X X 0 0 1 X X 0 0 0 1 X 0 0 0 0 0 0 0 0 0 1用輸出作為狀態(tài)編碼L1 L2 L3 L4 ERR 無關(guān)項(xiàng)的使用L1 L2 L3 L4 ERRP585表7-16P585表7-17P434表7-1737Minimal risk.(P563)Minima
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度歷史遺跡保護(hù)裝修合同增項(xiàng)條款
- 2025年度智能制造生產(chǎn)線項(xiàng)目管理人員聘用合同
- 2024交通安全的總結(jié)范文(30篇)
- 2024-2025學(xué)年第16課國家出路的探索與列強(qiáng)侵略的加劇-勤徑學(xué)升高中歷史必修上同步練測(cè)(統(tǒng)編版2019)
- 2025年典型國際鐵路運(yùn)輸合同
- 2025年中介居間合同示例
- 2025年農(nóng)村基礎(chǔ)設(shè)施優(yōu)化共建協(xié)議
- 2025年住宅按揭貸款協(xié)議書樣本
- 2025年停車場(chǎng)地合同模板
- 2025年渦輪螺槳發(fā)動(dòng)機(jī)項(xiàng)目立項(xiàng)申請(qǐng)報(bào)告模板
- 勞動(dòng)合同薪酬與績效約定書
- 消除醫(yī)療歧視管理制度
- JT-T-1180.2-2018交通運(yùn)輸企業(yè)安全生產(chǎn)標(biāo)準(zhǔn)化建設(shè)基本規(guī)范第2部分:道路旅客運(yùn)輸企業(yè)
- QCT848-2023拉臂式自裝卸裝置
- 2024交管12123駕照學(xué)法減分必考題庫附答案
- 腦脊液常規(guī)檢查
- 2024年蘇州經(jīng)貿(mào)職業(yè)技術(shù)學(xué)院單招職業(yè)適應(yīng)性測(cè)試題庫附答案
- 柴油機(jī)油-標(biāo)準(zhǔn)
- 監(jiān)獄安全課件
- 《初三開學(xué)第一課 中考動(dòng)員會(huì) 中考沖刺班會(huì)》課件
- 護(hù)理干預(yù)在慢性病管理中的作用
評(píng)論
0/150
提交評(píng)論