版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)3.1.1 基本邏輯門(mén)設(shè)計(jì)architecture behave of gate isbegin process(a,b) begin y1=a and b; y2=a nand b; y3=a xor b; end process;end; 第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)1.編碼器architecture behave of encoder isbegincodeout=111 when h=1 else 110 when g=1 else 101 when f=1 else 100 when e=1 el
2、se 011 when d=1 else 010 when c=1 else 001 when b=1 else 000 when a=1 else 000;end behave;3.1.2 編碼器、譯碼器和數(shù)據(jù)選擇器第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)architecture behave of encoder isbeginprocess(a,b,c,d,e,f,g,h)beginif h=1 then codeout=111 ;elsif g=1 then codeout=110;elsif f=1 then codeout=101 ;elsif e=1 then
3、codeout=100 ;elsif d=1 then codeout=011 ;elsif c=1 then codeout=010 ;elsif b=1 then codeout=001 ;elsif a=1 then codeout=000 ;else codeout=000;end if;end process;end behave;優(yōu)先編碼器(priority encoder)第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)2.譯碼器3-8譯碼器還有3個(gè)選通輸入端g1,g2a和g2b。只有在g11,g2a=0,g2b0時(shí),3-8譯碼器才進(jìn)行正常譯碼,否則y0y7輸出將均為高
4、電平。 3.數(shù)據(jù)選擇器第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)process(input,sel)beginif (sel=00) theny=input(0);elsif (sel=01) theny=input(1);elsif (sel=10) theny=input(2);elsey=input(3);end if;end process;第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)3.1.3 加法器(全加器、BCD碼加法器)entity adder14 isport(op1,op2:in std_logic_vector(12 downto 0);ci
5、:in std_logic;result:out std_logic_vector(13 downto 0);end;architecture behave of adder14 issignal halfadd:std_logic_vector(13 downto 0);beginhalfadd=(0&op1)+(0&op2);result=halfadd when ci=0 else halfadd+1;end;第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)architecture behave of bcdadd issignal binadd:std_logic_vecto
6、r(4 downto 0);beginbinadd9 thenresult=binadd+6;elseresult=binadd;end if;end process;end;例3-8 BCD碼加法器 第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)3.1.4 三態(tài)門(mén)及總線緩沖器1.三態(tài)門(mén)電路 三態(tài)門(mén)具有一個(gè)(組)數(shù)據(jù)輸入端din,一個(gè)數(shù)據(jù)輸出端dout和一個(gè)使能控制端en。當(dāng)en=1時(shí),dout=din;當(dāng)en0時(shí),dout=Z,輸出是呈現(xiàn)高阻,即懸浮狀態(tài)。第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)architecture behave of tristate is
7、beginprocess(en,din)beginif en=1 thendout=din;elsedout=Z;end if;end process;end behave;第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)2.單向總線緩沖器 在微型計(jì)算機(jī)的總線驅(qū)動(dòng)中經(jīng)常要用單向總線緩沖器,它通常由多個(gè)三態(tài)門(mén)組成,用來(lái)驅(qū)動(dòng)地址總線和控制總線。一個(gè)8位的單向總線緩沖器如圖3-10所示。8位單向總線緩沖器由8個(gè)三態(tài)門(mén)組成,具有8個(gè)輸入端和8個(gè)輸出端。所有的三態(tài)門(mén)的控制端連在一起,由一個(gè)控制輸入端en控制。第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)architecture b
8、ehave of unidir isbeginprocess(en,din)beginif en=1 thendout=din;elsedout=ZZZZZZZZ;end if;end process;end behave;第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)3.雙向總線緩沖器雙向緩沖器有兩個(gè)數(shù)據(jù)輸入/輸出端a和b,一個(gè)方向控制端dir和一個(gè)選道端en。當(dāng)en1時(shí),雙向總線緩沖器未被選通,a和b都呈現(xiàn)高阻。當(dāng)en1時(shí),雙向總線緩沖器被選通,如果dir=0,則a=b;如果dir=1,則b=a。第3章 基本邏輯單元的VHDL模型architecture behave of b
9、idir issignal aout,bout:std_logic_vector(7 downto 0);beginprocess(a,en,dir)beginif en=0 and dir=0 thenbout=a;elsebout=ZZZZZZZZ;end if; b=bout;end process;process(b,en,dir)beginif en=0 and dir=1 thenaout=b;elseaout=ZZZZZZZZ;end if;a=aout;end process;end behave;3.1 組合邏輯電路設(shè)計(jì)第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)
10、計(jì)3.1.5運(yùn)算電路1.算術(shù)運(yùn)算architecture behave of arithmetic isbeginprocess(a,b)beginq1=(0&a)+(0&b);-additionq2=a-b;-subtractionq3=a*b;-multiplicationend process;end behave;第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)例3-13除法運(yùn)算 第3章 基本邏輯單元的VHDL模型3.1 組合邏輯電路設(shè)計(jì)2.求補(bǔ)運(yùn)算architecture rtl of complement isbeginprocess(a)variable tmp:std
11、_logic_vector(7 downto 0);beginif a(7)=0 thenb=a;elsetmp:=not a+1;tmp(7):=1;b=tmp;end if;end process;end rtl;第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電路設(shè)計(jì)3.2.1 觸發(fā)器1.D觸發(fā)器(1)基本D觸發(fā)器。 (2)異步復(fù)位/置位的D觸發(fā)器異步復(fù)位/置位的D觸發(fā)器是在基本D觸發(fā)器的基礎(chǔ)上增加了一個(gè)異步清零端clr(clear),異步置位端set。當(dāng)set=0置位,使q=1,當(dāng)clr=0時(shí),其q端輸出被強(qiáng)迫置為0。第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電路設(shè)計(jì)proc
12、ess(clk,set,clr)beginif set=0 thenq=1;elsif clr=0 thenq=0;elsif clkevent and clk=1 thenq=d;end if;end process;第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電路設(shè)計(jì)2.JK觸發(fā)器process(clk,reset,input)beginif reset=1 thenstatestatestatestate null;end case;end if;end process;第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電路設(shè)計(jì)3.2.2 寄存器1.數(shù)碼寄存器2.移位寄存器 pro
13、cess(clk) beginif clkevent and clk=1 thentemp(0)=a;temp(1)=temp(0);temp(2)=temp(1);temp(3)=temp(2);temp(4)=temp(3);temp(5)=temp(4);temp(6)=temp(5);temp(7)=temp(6);b=temp(7);end if; end process;(1)串行輸入、串行輸出移位寄存器第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電路設(shè)計(jì)(2).雙向移位寄存器第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電路設(shè)計(jì)3.2.3 計(jì)數(shù)器1.同步計(jì)數(shù)器(1)二進(jìn)
14、制加法計(jì)數(shù)器 architecture behave of cnt4 issignal ql:std_logic_vector(3 downto 0);beginprocess(clk)beginif clkevent and clk=1 thenql=ql+1;end if;end process;q=ql;end behave;第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電路設(shè)計(jì)(2)可逆計(jì)數(shù)器。 可逆計(jì)數(shù)器有一個(gè)特殊的控制端,這就是updown端。當(dāng)updown=1時(shí),計(jì)數(shù)器進(jìn)行加1操作;當(dāng)updown0時(shí),計(jì)數(shù)器進(jìn)行減l操作。 第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電
15、路設(shè)計(jì)process(clk,reset,updown)beginif reset=1 thentemp0);elsif clkevent and clk=1 thenif updown=1 thentemp=temp+1;elsetemp=temp-1;end if;end if;end process;第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電路設(shè)計(jì)(3) 四十八進(jìn)制計(jì)數(shù)器。 例3-23帶有異步復(fù)位、同步預(yù)置數(shù)功能的8421BCD碼四十八進(jìn)制計(jì)數(shù)器。 第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電路設(shè)計(jì)2.異步計(jì)數(shù)器第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電路設(shè)計(jì)3.2.4 分頻器(1)利用計(jì)數(shù)器的進(jìn)位端。 (2)數(shù)控分頻器。 第3章 基本邏輯單元的VHDL模型3.2 時(shí)序邏輯電路設(shè)計(jì)3.2.5 序列信號(hào)發(fā)生器和檢測(cè)器1.序列信號(hào)發(fā)生器2.序列信號(hào)檢測(cè)器3.3 存儲(chǔ)器
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(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云南昆明安寧市連然街道辦事處(第一批)招聘村(社區(qū))工作人員7人備考題庫(kù)附答案
- 2025年三原縣選聘縣直事業(yè)單位工作人員真題匯編附答案
- 商品選品員安全專項(xiàng)水平考核試卷含答案
- 辦公設(shè)備維修工9S考核試卷含答案
- 糖坯制造工標(biāo)準(zhǔn)化知識(shí)考核試卷含答案
- 注聚工QC管理考核試卷含答案
- 鍋爐設(shè)備裝配工操作評(píng)估評(píng)優(yōu)考核試卷含答案
- 水聲測(cè)量工安全生產(chǎn)能力模擬考核試卷含答案
- 2024年湖南信息學(xué)院輔導(dǎo)員招聘?jìng)淇碱}庫(kù)附答案
- 2024年湖北省直屬機(jī)關(guān)業(yè)余大學(xué)輔導(dǎo)員招聘?jìng)淇碱}庫(kù)附答案
- 離婚協(xié)議標(biāo)準(zhǔn)版(有兩小孩)
- 浙江省臺(tái)州市路橋區(qū)2023-2024學(xué)年七年級(jí)上學(xué)期1月期末考試語(yǔ)文試題(含答案)
- 假體隆胸后查房課件
- 2023年互聯(lián)網(wǎng)新興設(shè)計(jì)人才白皮書(shū)
- DB52-T 785-2023 長(zhǎng)順綠殼蛋雞
- c語(yǔ)言知識(shí)點(diǎn)思維導(dǎo)圖
- 關(guān)于地方儲(chǔ)備糧輪換業(yè)務(wù)會(huì)計(jì)核算處理辦法的探討
- GB/T 29319-2012光伏發(fā)電系統(tǒng)接入配電網(wǎng)技術(shù)規(guī)定
- GB/T 1773-2008片狀銀粉
- GB/T 12007.4-1989環(huán)氧樹(shù)脂粘度測(cè)定方法
- (完整版)北京全套安全資料表格
評(píng)論
0/150
提交評(píng)論