基本時(shí)序邏輯電路設(shè)計(jì)_第1頁
基本時(shí)序邏輯電路設(shè)計(jì)_第2頁
基本時(shí)序邏輯電路設(shè)計(jì)_第3頁
基本時(shí)序邏輯電路設(shè)計(jì)_第4頁
基本時(shí)序邏輯電路設(shè)計(jì)_第5頁
已閱讀5頁,還剩52頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、第五講基本時(shí)序邏輯電路設(shè)計(jì)2010年12月基本時(shí)序邏輯電路設(shè)計(jì)A時(shí)序邏輯電路的基本知識(shí)A時(shí)序邏輯電路的VHDL描述同步時(shí)序邏輯電路和異步時(shí)序邏輯電路A時(shí)序邏輯電路的基本知識(shí)時(shí)序邏輯電路的電路特征:肘序勒路的輸出信號(hào)不僅取決于勒路旨時(shí) 的輸入,還取決于電路原來的狀態(tài),體現(xiàn)了 “記憶”特性。從勒路行為上講,不管輸入如何變化,僅 當(dāng)時(shí)鐘的沿(上升沿或下吟沿丿到達(dá)時(shí), 才有可能使輸出發(fā)生變化。觸發(fā)器由對(duì)鐘 信號(hào)來觸發(fā),控制翻轉(zhuǎn)時(shí)刻,而對(duì)觸發(fā)器 翻轉(zhuǎn)到何種狀態(tài)并無影響。時(shí)序邏輯電路的兩個(gè)基本組成部分:用來計(jì)算輸入和寄存春的因數(shù)值的邏輯 用來椽持肘序邏輯削路狀態(tài)的存儲(chǔ)單元描述時(shí)序邏輯電路的基本方式:表達(dá)式

2、(輸出邏輯表達(dá)式、存儲(chǔ)單元驅(qū)動(dòng) 表達(dá)式、觸發(fā)器狀態(tài)方程丿;狀態(tài)轉(zhuǎn)換圖/表;肘序圖設(shè)計(jì)時(shí)序邏輯電路的基本方法:寄存賽傳輸級(jí)模矍CRTLJ :根據(jù)肘存圖把行為描述成奇存賽值的轉(zhuǎn)換 狀態(tài)機(jī):根據(jù)狀態(tài)轉(zhuǎn)換圖/表描述狀態(tài)機(jī)的行為狀態(tài)轉(zhuǎn)換圖寄存器傳輸級(jí)結(jié)構(gòu)分析一個(gè)時(shí)序電路,就是要找出給定時(shí)序電路的邏輯 功能。具體地說,就是要求找出電路的狀態(tài)和輸出狀 態(tài)在輸入變量和時(shí)鐘信號(hào)作用下的變化規(guī)律。狀態(tài)方程輸出方程Y = XQ"CX Qn + XQn驅(qū)動(dòng)方程T = X觸發(fā)器特征方程 °"+1二卩歹+初oXQnQn+iY0010010010001111Kue¥alueo PS1

3、 1 1 1 1 1 1 1 1200? 000 ps1 1 1 1 1 1 1 1 1400,000 ns61 1 1 1 1 1 1 1 100j 000 ps806 000 ps1 1 1 1 1 1 1 1 1I I I L 1 11W1WIriuuiuuuBJWWWIl伽0001in_n_n_n_nJT_ 1J寄存器傳輸級(jí)時(shí)序模型 D觸發(fā)器觸發(fā)器應(yīng)用電路計(jì)數(shù)器設(shè)計(jì)(同步、異步計(jì)數(shù))分頻電路設(shè)計(jì) 電平鎖存器時(shí)鐘信號(hào)、獲取 邊沿觸發(fā)描述方式: if> wait until, rising_edge, falling_edge同步和非同步復(fù)時(shí)序邏輯電路的VHDL描述/D觸發(fā)器:邊沿觸

4、發(fā)的存儲(chǔ)設(shè)備(FlipFlop)entity dff isPort ( elk : in std_logic;d : in std_logic; q,qn : out std_logic );end dff; architecture Behavioral of dff is signal outp:std_logic;beginqn<=not outp; q<=outp; process beginwait until rising_edge(clk); outp<=d;end process;end Behavioral;dkdff:1fdoutpinvqn_imp_qn

5、1qndff同步D觸發(fā)器RTL綜合結(jié)果圖同步D觸發(fā)器仿真結(jié)果圖可設(shè)計(jì) 同步削路 延遲勒路A延遲電路entity delay isport( clk9din: in std_logic; dl,d2,dout:out std_logic);end delay;architecture rtl of delay issignal 11 ,t2,tout: std_logic;beginprocess(clk)beginif rising_edge(clk) then tl<=din; t2<=tl; tout<=t2;end if;end process;FDdout<=t

6、out; d2<=t2; dl<=tl; end rtl;Current SimulationTime: 1000 nsr200I I I400I I600I I800I IoJ'doul0Xyen0XQj'd20 ®IPERIOD31:03.廠3200000028訓(xùn) DUTY CYCLE0.50.5E3 §slOFFSET31:03.廠32'h00000028切elk0n nnnnninnnnnnnnnim口 i副din0A微分器電路entity diff isport( elk,din: in stdjogic; d15d25up_d

7、iff,dn_diff5up_dn_diff:out stdjogic); end diff;architecture rtl of diff issignal t1,t2:stdjogic;beginprocess(clk)beginif rising_edge(clk) then t1<=din; t2<=t1; end if;end process;d2<=t2; d1<=t1;up_diff<=t1 and not t2;dn_diff<=not t1 and t2;up_dn_diff<=t1 xor t2;end rtl;dn_dif>

8、;DZB1up_dif>Current Simulation Time: 1000 ns0200I400I600800I IoJIdn.ditf0XqJ! up_dn_diff0oJ!up_diff0御CM0qJ!d20XH <PERIOD31:03廠J3200000028<yi DUPCCYCLE0.50.5El <OFFSET31:03.廠J3200000028劃! elk0rLFLTVmWmp_njTjrm釧din0JFTPT觸發(fā)器|PRE>-PREIQIUFE>AND3CXQn0+1Y00100100100()1111E>輸出方程Y = XQH

9、C狀態(tài)方程Qn+ = XQ + XQnentity testservhdl isPort ( C : in stdogic;X : in stdjogic;Y : out stdogic; PRE : in stdjogic); end testservhdl;architecture Behavioral of testservhdl is signal q,t:stdJogic;begint<=not X;Y<=q and C and X;process begin if PRE=fVthen qv=T; elsif rising_edge(C) then if t=fr th

10、en q<=not q; else q<=q; end if; end if;end process; end Behavioral;testservhdtl同步時(shí)序邏輯電路與異步時(shí)序邏輯電路根據(jù)電路中各級(jí)觸發(fā)器時(shí)鐘端的連接方式同步時(shí)序電路設(shè)計(jì)各觸發(fā)器的時(shí)鐘端全部連接到同一個(gè)時(shí)鐘源上,統(tǒng)一受 系統(tǒng)時(shí)鐘的控制,各級(jí)觸發(fā)器的狀態(tài)變化是同時(shí)的。異步時(shí)序電路設(shè)計(jì)各觸發(fā)器的時(shí)鐘信號(hào)是分散連接的,因此觸發(fā)器的狀態(tài) 變化不是同時(shí)進(jìn)行的。1 同步時(shí)序電路設(shè)計(jì)1)同步時(shí)序電路原理說明從構(gòu)成方式上講,同步時(shí)序電路所有操作都是在同一時(shí)鐘嚴(yán) 格的控制下步調(diào)一致地完成的。從電路行為上講,同步電路的 時(shí)序電路

11、共用同一個(gè)時(shí)鐘,而所有的狀態(tài)變化都是在時(shí)鐘的上 升沿(或下降沿)完成的??谠赩HDL實(shí)現(xiàn)時(shí)并不要求同一時(shí)鐘,而是同源時(shí)鐘。所謂的同 源時(shí)鐘是指同一個(gè)時(shí)鐘源衍生頻率比值為2的需次方,且初相位 相同的時(shí)鐘。2)同步時(shí)序電路的VHDL描述同步與門的描述entity syngate isport ( elk : in stdogic; a : in stdogic; b : in stdogic; y : out stdjogic);end syngate;/1、敏感信號(hào)只能是時(shí)鐘信號(hào);2、時(shí)鐘信號(hào)必須是同源的3、時(shí)鐘只能使用一個(gè)跳變沿architecture behavioral m syngate

12、 is 同步復(fù)位的描述 begin/process(clk) /if rising_edge(clk) thebeginif rst_n=l0, thenif rising_edge(clk) theny<=a and b;elseend if;.end process;endif;end Behavioral;end if;具有同步 復(fù)位功能 的同步與 門的描述entity syngate isport ( elk : in stdjogic; a : in stdogic; b : in stdjogic;rst_n:in stdogic; y : out stdogic); end

13、 syngate;architecture Behavioral of syngate is beginprocess(clk) begin if rising_edge(clk) then if rst_F=O then yv=O else y<=a and b;end if; end if;end process;end Behavioral;syngate:!and2nrst n inv imp rst n mv1H MMWI WH Hy andOOOO imp y andDOOOl復(fù)位信號(hào)rst_n 過D觸發(fā)器的控制 端來實(shí)現(xiàn)。syngate:!syngate:!RTL綜合結(jié)果圖

14、3)同步時(shí)序電路的設(shè)計(jì)準(zhǔn)則單肘鐘策略.單肘鐘沿策略口盡量在設(shè)計(jì)中使用單時(shí)鐘,在單時(shí)鐘設(shè)計(jì)中,很容易就將整 個(gè)設(shè)計(jì)同步于驅(qū)動(dòng)時(shí)鐘,使設(shè)計(jì)得到簡(jiǎn)化。口盡量避免使用混合時(shí)鐘沿來采樣數(shù)據(jù)或驅(qū)動(dòng)電路。使用混合 時(shí)鐘沿將會(huì)使靜態(tài)時(shí)序分析復(fù)雜,并導(dǎo)致電路工作頻率降低。下。一個(gè)process的雙時(shí)鐘邊緣描述方法:process(clk) begin對(duì)于可編程邏輯器件,不推薦同時(shí)使用 同一信號(hào)的兩個(gè)沿。這是因?yàn)槠骷?nèi)部 的時(shí)鐘處理電路,只能保證時(shí)鐘的一個(gè) 沿具有非常好的指標(biāo),而另外一個(gè)沿的 抖動(dòng)、偏斜以及過渡時(shí)間等指標(biāo)都不保 證,因此同時(shí)采用兩個(gè)沿會(huì)造成時(shí)鐘性 能的惡化。end process;二個(gè)proces

15、s的雙時(shí)鐘邊緣描述方法:process(clk) beginif rising_edge(clk) then- end if;end process; process(clk) begin if fallingedge(clk) then- end if;end process;推薦首先將慮對(duì)鐘僖頻,然后利用單沿對(duì)削路進(jìn)行操作。利用混合時(shí)鐘先 后完成輸入數(shù)據(jù) 的下降沿和上升 沿采樣,并級(jí)聯(lián) 輸出entity dualedge isport (input: in stdjogic_vector (7 downto 0); outputl : out stdjogic_vector (7 down

16、to 0); output2 : out stdogic_vector (7 downto 0); elk : in stdjogic);end dualedge;architecture Behavioral of dualedge is signal dt:stdogic_vector(7 downto 0);begin outputl <=dt; process(clk) beginif rising_edge(clk) then dt<=input; end if;end process;process(clk)beginif falling_edge(clk) then

17、output2<=dt; end if;end process;end Behavioral;dualedge :1避免使用門控時(shí)鐘口如果一個(gè)時(shí)鐘節(jié)點(diǎn)由組合邏輯驅(qū)動(dòng),那么就形成了門控時(shí)鐘。門控時(shí)鐘常用來減少功耗。FDFD門控時(shí)鐘相關(guān)的邏輯不是同步電路,即可能帶有毛刺,而任何的 一點(diǎn)點(diǎn)小毛刺都可以造成D觸發(fā)器誤翻轉(zhuǎn)。門控邏輯會(huì)污染時(shí)鐘質(zhì)量,產(chǎn)生毛刺,并惡化偏移和抖動(dòng)等指標(biāo)。 口減少功耗的方法是:低核電壓FPGA、FPGA休眠技術(shù)以及動(dòng)態(tài)部分 重構(gòu)技術(shù)等laaeValue0 rsi i i i 1 i i i i10, 000 rs1 1 1 1 1 1 1 1 120, 000 psi i

18、 i i 1 i i i i30, 000 psi i i i 1 i i i i40, 000 psi i i i 1 iw clk1II轉(zhuǎn) input7:005t 01:02 :03 ):04 J;05圈 out put 17:0055 X 0L X 02X03> 01* r圈 out put 2 7:004(013(02 ):031im混合時(shí)鐘邊緣采樣功能仿真圖Current Simulation Time: 1000 nsjns25 nsI I15CIns 175nsI I I I I I I20(Ins I225 I InsI I250 ns I I275 ris 300 ns

19、 325 n I I Illi Illi5I350 ns 375 ns 4C I I I I I I Illininput7:08,hF4F4 XX8tF7 X8MF8 X8*hF9%8'hFAX8怖日X&hFCXS'hFDXs'hFE )L闕clk1rLa outputi 7:08TiF3ThF3j #hF4 Xj'hF弓乂汕F6關(guān)8怖7乂汕刊)$hF9j(汕魚乂汕閃冶怖匚丿 汕FDjxhFE乂a Eoutput27:0S'hOO : G R I 0K0 ILG JK G jyiclkperiod20000000混合時(shí)鐘邊緣采樣時(shí)序仿真圖避免在

20、子棋塊內(nèi)部使用計(jì)數(shù)器分頻產(chǎn)生所需時(shí)鐘口各個(gè)模塊內(nèi)部各自分頻會(huì)導(dǎo)致時(shí)鐘管理混亂,不僅使得時(shí)序 分析變得復(fù)雜,產(chǎn)生較大的時(shí)鐘漂移,并且浪費(fèi)了寶貴的時(shí)序 裕量,降低了設(shè)計(jì)可靠性??谕扑]的方式是由一個(gè)專門的子模塊來管理系統(tǒng)時(shí)鐘,產(chǎn)生其他模 塊所需的各個(gè)時(shí)鐘信號(hào)。具有異步 復(fù)位功能 的同步與 門的描述entity asyngate is port ( elk : in stdjogic; a : in stdogic; b : in stdjogic;rst_n:in stdogic;y : out stdjogic);end asyngate;architecture Behavioral of as

21、yngate is beginprocess(clk5rst_n)beginif rst_n=,0, then y<=,0,;elsif rising_edge(clk) then y<=a and b;end if;end process;end Behavioral;asynstand*!RTL綜合結(jié)果圖VueValue逼elk0111111111 OOj 000 psIlli150i 000 psiiii200j 000 psiiii250j 000 dsiiiuuinJirLTLTLrJUIRJITTLnrmJinn111異步復(fù)位與門仿真結(jié)果圖2.異步時(shí)序電路設(shè)計(jì)1)異步時(shí)序電路原理說明異步時(shí)序電路,顧名思義就是電路的工作節(jié)奏不一致,不存在 單一的主控時(shí)鐘,電路狀態(tài)的改變由外部輸入的變化直接引起。主要是用于產(chǎn)生地址譯碼器、FIFO和異步RAM的讀寫控制信號(hào)脈 沖。除可以使用帶時(shí)鐘的觸發(fā)器外,還可以使用不帶時(shí)鐘的觸發(fā)器 和延遲元件作為存儲(chǔ)元件。由于異步電路沒有統(tǒng)一的時(shí)鐘,狀態(tài)變化的時(shí)刻是不穩(wěn)定的,通 常輸入信號(hào)只在電路處于穩(wěn)定狀態(tài)時(shí)

溫馨提示

  • 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ì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論