使用D觸發(fā)器設(shè)計(jì)一個(gè)11001序列檢測器_第1頁
使用D觸發(fā)器設(shè)計(jì)一個(gè)11001序列檢測器_第2頁
使用D觸發(fā)器設(shè)計(jì)一個(gè)11001序列檢測器_第3頁
使用D觸發(fā)器設(shè)計(jì)一個(gè)11001序列檢測器_第4頁
使用D觸發(fā)器設(shè)計(jì)一個(gè)11001序列檢測器_第5頁
已閱讀5頁,還剩5頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、討論使用D觸發(fā)器設(shè)計(jì)一個(gè)11001序列檢測器,討論序列可交迭(Overlap)檢測和不可交迭檢測在設(shè)計(jì)上的區(qū)別,討論分別采用Mealy機(jī)設(shè)計(jì)和采用Moore機(jī)設(shè)計(jì)的區(qū)別,討論未用狀態(tài)的處理問題。【要求】給出電路原理圖或HDL代碼,要求進(jìn)行仿真,并給出仿真結(jié)果。1.原件介紹D觸發(fā)器(74LS74)、“與”門(74LS08)、“或”門(74LS32)、“非”門(74LS04), 集成電路引腳2.設(shè)計(jì)思路根據(jù)要求,設(shè)計(jì)的序列檢測器有一個(gè)外部輸入x和一個(gè)外部輸出Z。輸入和輸出的邏輯關(guān)系為:當(dāng)外部輸入x第一個(gè)為"1",外部輸出Z為"0";當(dāng)外部輸入x第二個(gè)為&qu

2、ot;1",外部輸出Z為"0";當(dāng)外部輸入第三個(gè)x為"0",外部輸出Z為"0",當(dāng)外部輸入第四個(gè)x為“0”,外部輸出Z為0,當(dāng)外部輸入第五個(gè)x為“1”,外部輸出Z為“1”。假定有一個(gè)外部輸入x序列以及外部輸出Z為:輸入X011100101輸出Y000000100 要判別序列檢測器是否連續(xù)接收了"11001",電路必須用不同的狀態(tài)記載外部輸入x的值。假設(shè)電路的初始狀態(tài)為A,x 輸入第一個(gè)"1",檢測器狀態(tài)由A裝換到B,用狀態(tài)B記載檢測器接受了"11001"序

3、列的第一個(gè)"1",這時(shí)外部輸出Z=0;x輸入第二個(gè)"1",檢測器狀態(tài)由B裝換到C,用狀態(tài)C記載檢測器接了“11001”序列的第二個(gè)"1",外部輸出Z=0;x輸入第三個(gè)"0",檢測器狀態(tài)由C裝換到D,外部輸出Z=0;x輸入第四個(gè)為“0”,檢測器狀態(tài)由D裝換到E,外部輸出Z=0;x輸入第五個(gè)為“1”,檢測器狀態(tài)由E裝換到F,外部輸出Z=1。然后再根據(jù)外部輸入及其他情況時(shí)的狀態(tài)轉(zhuǎn)移,寫出相應(yīng)的輸出。以上分析了序列檢測器工作,由此可畫出原始狀態(tài)圖。根據(jù)原始狀態(tài)圖可列出原始狀態(tài)表。 00000011001010FEDCAB0

4、0001010狀態(tài)轉(zhuǎn)換表現(xiàn)態(tài)X01AA0B0BA0C0CD0B0DE0A0EA0F1ZAQ2Q1Q0000001010011100000000100001 Q2*AQ2Q1Q0000001011010110000010100000Q1*AQ2Q1Q0000001011010110000100101100Q0*AQ2Q1Q0000001011010110000100110010得到狀態(tài)方程和輸出方程Z=AQ2*=Q1*=Q0*=D2=Q2*D1=Q1*D0=Q0* 3.未用狀態(tài)關(guān)于未用狀態(tài)涉及到了D觸發(fā)器自啟動(dòng)的檢驗(yàn):前一狀態(tài)為 111時(shí),Q3*=A; Q2*=0; Q1*=A,下一狀態(tài)為有效狀

5、態(tài)。前一狀態(tài)為110時(shí),Q3*=A; Q2*=1; Q1*=1,對A值分類討論:A=0,下一狀態(tài)為有效狀態(tài);A=1,下一狀態(tài)為111,再下一個(gè)狀態(tài)為有效狀態(tài)。4.實(shí)際代碼設(shè)計(jì)與仿真MOORE機(jī)有交迭的程序設(shè)計(jì)library ieee;use ieee.std_logic_1164.all;entity schk is   port(din,clk,rst:in std_logic;      sout:out std_logic);end

6、0;schk;architecture behave of schk is   type states is(s0,s1,s2,s3,s4,s5);   signal st,nst:states :=s0;begin com: process(st,din) begin  case st is     when s0=>&

7、#160;if din='1' then nst <=s1;else nst <= s0;end if;   when s1=> if din='1' then nst <=s2;else nst <= s0;end if;   when s2=> if din

8、='0' then nst <=s3;else nst <= s0;end if;   when s3=> if din='0' then nst <=s4;else nst <= s0;end if;   when s4=> if din='1'

9、0;then nst <=s5;else nst <= s0;end if;   when s5=> if din='1' then nst <=s2;else nst <= s0;end if;   when others => nst <=s0;end case;en

10、d process;reg:process (clk,rst)  begin-shixujincheng  if rst='1' then st <=s0;     elsif clk'event and clk='1'  then st <= nst; end if;  en

11、d process reg;sout <= '1' when st=s5 else '0'end behave;         仿真結(jié)果小的體現(xiàn)了交迭mealy有交迭的程序設(shè)計(jì)library ieee;use ieee.std_logic_1164.all;entity schk2 is port(din,clk,rst:in std_logic; sout:out std_l

12、ogic);end schk2;architecture behave of schk2 is type states is(s0,s1,s2,s3,s4,s5); signal st:states :=s0;begin process(clk,rst,st,din) begin if rst='1' then st <=s0; elsif clk'event and clk='1' then case st is when s0=> if din='1' then st <=s1; else st <= s0;e

13、nd if; when s1=> if din='1' then st <=s2; else st <= s0;end if; when s2=> if din='0' then st <=s3; else st <= s0;end if; when s3=> if din='0' then st <=s4; else st <= s0;end if; when s4=> if din='1' then st <=s5; else st <= s0;end i

14、f; when s5=> if din='1' then st <=s2; else st <= s0;end if; when others => st <=s0;end case; if(st=s5) then sout<='1' else sout <= '0'end if ; end if;end process;end behave;實(shí)現(xiàn)檢測11001的圖體現(xiàn)交迭的圖 Mealy機(jī)無交疊的library  ieee;use ieee.std_logic_1164.a

15、ll;entity schk2 is   port(din,clk,rst:in std_logic;      sout:out std_logic);end schk2;architecture behave of schk2 is   type states is(s0,s1,s2,s3,s4,s5);   signal 

16、st:states :=s0;begin process(clk,rst,st,din)  begin if rst='1' then st <=s0; elsif clk'event and clk='1' thencase st is     when s0=> if din='1'&#

17、160;then st <=s1; else st <= s0;end if;   when s1=> if din='1' then st <=s2; else st <= s0;end if;   when s2=> if din='0' then

18、 st <=s3; else st <= s0;end if;   when s3=> if din='0' then st <=s4; else st <= s0;end if;   when s4=> if din='1' then st

19、 <=s5; else st <= s0;end if;   when s5=> if din='1' then st <=s0; else st <= s0;end if;   when others => st <=s0;end case; 

20、60; if(st=s5) then sout<='1' else sout <= '0'end if  end if;end process;end behave;   體現(xiàn)沒有交迭的Moore沒有交迭的圖library  ieee;use ieee.std_logic_1164.all;entity schk is  &

21、#160;port(din,clk,rst:in std_logic;      sout:out std_logic);end schk;architecture behave of schk is   type states is(s0,s1,s2,s3,s4,s5);   signal st,nst:states :=s0;begin com:

22、0;process(st,din) begin  case st is     when s0=> if din='1' then nst <=s1;else nst <= s0;end if;   when s1=> if din='1' then nst

23、60;<=s2;else nst <= s0;end if;   when s2=> if din='0' then nst <=s3;else nst <= s0;end if;   when s3=> if din='0' then nst <=s4;else nst <= s0;end if;   when s4=> if din='1' then nst <=s5;else nst <= s0;end if;   when 

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論