




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、1基本邏輯電路: 組合邏輯電路、 時(shí)序邏輯電路一 組合邏輯電路設(shè)計(jì) 簡(jiǎn)單門電路、編碼器、譯碼器、 加法器、多路選擇器、三態(tài)門等。3.9 基本邏輯電路設(shè)計(jì)21、基本門電路32、譯碼器 譯碼器是編碼器的逆過程。如 3-8 譯碼器:sel=000Y=00000001sel =001Y=00000010sel =010Y=00000100sel =011Y=00001000sel =100Y=00010000sel =101Y=00100000sel =110Y=01000000sel =111Y=100000004方法方法1 1:使用邏輯左移運(yùn)算符:使用邏輯左移運(yùn)算符 library ieee; u
2、se ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity decoder is port(inp : in std_logic_vector(2 downto 0); outp : out std_logic_vector(7 downto 0); end decoder; architecture rtl of decoder is begin outp=“00000001” sll(conv_integer(inp); end rtl;5方法方法2 2:使用:使用processprocess語句語句 librar
3、y ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity decoder is port(inp : in std_logic_vector(2 downto 0); outp : out std_logic_vector(7 downto 0); end decoder; architecture rtl of decoder is begin process(inp) begin outp0); outp(conv_integer(inp)=1; end process; end rtl;6方法
4、方法3 3:使用:使用 case case 語句實(shí)現(xiàn)。語句實(shí)現(xiàn)。7譯碼輸出低有效8方法方法4 4:使用條件賦值語句:使用條件賦值語句93-8譯碼器仿真結(jié)果:譯碼輸出低有效103、編碼器 設(shè)計(jì)一個(gè) 8 輸入優(yōu)先級(jí)編碼器,y0 級(jí)別最低,y7 級(jí)別最高;輸出為3位編碼。Y7=1Vec=111Y6=1Vec=110Y5=1Vec=101Y4=1Vec=100Y3=1Vec=011Y2=1Vec=010Y1=1Vec=001Y0=1Vec=00011方法方法1 1:利用 if 多選擇語句自頂向下的優(yōu)先特性12方法方法2 2:進(jìn)程內(nèi)為順序語句,最先描述優(yōu)先級(jí)最低, 最后描述優(yōu)先級(jí)最高,可實(shí)現(xiàn)優(yōu)先級(jí)編碼。
5、13方法方法3 3:利用條件賦值語句:利用條件賦值語句 architecture behavior of priority is begin vec = “111” when y7 = 1 else “110” when y6 = 1 else “101” when y5 = 1 else “100” when y4 = 1 else “011” when y3 = 1 else “010” when y2 = 1 else “001” when y1 = 1 else “000” when y0 = 1 else “XXX”; end behavior;144、加法器 帶進(jìn)位的 4位加法器符
6、號(hào)如下:Sum(i) = a(i) b(i) cinC(i+1) = a(i) b(i) +(a(i) + b(i) ) c(i) 15方法1:用for loop語句實(shí)現(xiàn) 16方法2:直接使用加法“+”函數(shù):17加法器仿真結(jié)果:185、多路選擇器 前面用 if 語句、case 語句、條件賦值語句、選擇賦值語句分別描述過4選1選擇器。6、三態(tài)門及總線緩沖器 VHDL語言通過指定大寫的Z值表示高阻狀態(tài) a : std_logic; a_bus:std_logic_vector(7 downto 0); 指定高阻狀態(tài)如下: a = Z ; a_bus = “ZZZZZZZZ” ;191)三態(tài)門電路描
7、述20三態(tài)門仿真結(jié)果:212)單向總線緩沖器223)雙向總線緩沖器23二 時(shí)序邏輯電路設(shè)計(jì) 觸發(fā)器、寄存器、計(jì)數(shù)器、分頻器、信號(hào)發(fā)生器等。一)時(shí)序電路特殊信號(hào)的描述 時(shí)鐘信號(hào)和復(fù)位信號(hào) 1、時(shí)鐘信號(hào)描述 常用的描述方式: 1)進(jìn)程的敏感信號(hào)是時(shí)鐘信號(hào),在進(jìn)程內(nèi) 部用if 語句描述時(shí)鐘的邊沿條件。24如: process (clock_signal) begin if (clock_edge_condition) then signal_out = signal_in ; 其它時(shí)序語句 end if ; end process ; 252)在進(jìn)程中用wait until語句描述時(shí)鐘信號(hào),此 時(shí)進(jìn)
8、程將沒有敏感信號(hào)。 如: process begin wait until (clock_edge_condition); signal_out = signal_in ; 其它時(shí)序語句 end process ; 26 注意: a.在對(duì)時(shí)鐘邊沿說明時(shí),一定要注明是上升沿 還是下降沿。 b.一個(gè)進(jìn)程中只能描述一個(gè)時(shí)鐘信號(hào)。 c.wait until 語句只能放在進(jìn)程的最前面或 最后面。3)時(shí)鐘邊沿的描述 時(shí)鐘上升沿: (clockclockevent and clock = event and clock = 1 1) 時(shí)鐘下降沿: (clockclockevent and clock = e
9、vent and clock = 0 0) 272、觸發(fā)器的復(fù)位信號(hào)描述 1)同步復(fù)位:在只有以時(shí)鐘為敏感信號(hào)的進(jìn)程 中定義。 如: process (clock_signal) begin if (clock_edge_condition) then if (reset_condition) then signal_out = reset_value; else signal_out = signal_in ; end if ; end if ; end process ; 28 2)異步復(fù)位:進(jìn)程的敏感信號(hào)表中除時(shí)鐘信 號(hào)外,還有復(fù)位信號(hào)。 如:process (reset_signal,
10、 clock_signal) begin if (reset_condition) then signal_out = reset_value; elsif (clock_edge_condition) then signal_out = signal_in ; end if ; end process ; 29二) 常用時(shí)序電路設(shè)計(jì) 1、觸發(fā)器(Flip_Flop) 1)D觸發(fā)器30異步置位/復(fù)位D觸發(fā)器31同步復(fù)位D觸發(fā)器32比較:異步置位的鎖存器(Latch)33 library ieee; use ieee.std_logic_1164.all; entity t_ff is port
11、(t, clk : in std_logic; q : buffer std_logic); end t_ff; architecture rtl of t_ff is begin process(clk) begin if clkevent and clk=1 then if t=1 then q=not q; else q=q; end if; end process; end rtl;TClkQQ2)T觸發(fā)器34 library ieee; use ieee.std_logic_1164.all; entity rs_ff is port(r, s, clk : in std_logic
12、; q, qn : buffer std_logic); end rs_ff; architecture rtl of rs_ff is begin process(r, s, clk) begin if clkevent and clk=1 then if s = 1 and r = 0 then q=0; qn=1; elsif s=0 and r=1 then q=1; qn=0; elsif s=0 and r=0 then q=q; qn=q n; else null; end if; end if; end process; end rtl;SClkQQRSRQQn00QQn011
13、01001113)RS觸發(fā)器352、寄存器 8位串行輸入、串行輸出移位寄存器:z0z1z2z3z4z5z6z7z8368位移位寄存器描述(結(jié)構(gòu)描述)378位移位寄存器直接用信號(hào)連接描述38移位寄存器仿真結(jié)果:393、計(jì)數(shù)器 計(jì)數(shù)器分為:同步計(jì)數(shù)器 異步計(jì)數(shù)器(1)同步計(jì)數(shù)器 同步計(jì)數(shù)器指在時(shí)鐘脈沖(計(jì)數(shù)脈沖)的控 制下,構(gòu)成計(jì)數(shù)器的各觸發(fā)器狀態(tài)同時(shí)發(fā)生變化 的計(jì)數(shù)器。40帶允許端的十二進(jìn)制計(jì)數(shù)器41可逆計(jì)數(shù)器(加減計(jì)數(shù)器)42可逆計(jì)數(shù)器仿真結(jié)果:43例:六十進(jìn)制(分、秒)計(jì)數(shù)器444560進(jìn)制計(jì)數(shù)器仿真結(jié)果:46(2)異步計(jì)數(shù)器 異步計(jì)數(shù)器又稱為行波計(jì)數(shù)器,它的低位計(jì)數(shù)器的輸出作為高位計(jì)數(shù)器的時(shí)鐘信號(hào)。 異步計(jì)數(shù)器采用行波計(jì)數(shù),使計(jì)數(shù)延遲增加,計(jì)數(shù)器工作頻率較低。 描述異步計(jì)數(shù)器與同步計(jì)數(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度競(jìng)業(yè)協(xié)議失效一個(gè)月競(jìng)業(yè)限制解除補(bǔ)償合同
- 二零二五年度大型商場(chǎng)裝修合同(含室內(nèi)外環(huán)境美化)
- 二零二五年度特色主題展臺(tái)設(shè)計(jì)制作安裝一體化合同
- 二零二五年度紋身技藝培訓(xùn)與加盟合作協(xié)議
- 二零二五年度新能源產(chǎn)業(yè)臨時(shí)研發(fā)人員服務(wù)協(xié)議
- 2025年度網(wǎng)絡(luò)安全防護(hù)合同價(jià)款調(diào)整與網(wǎng)絡(luò)安全事件應(yīng)對(duì)
- 二零二五年度虛擬現(xiàn)實(shí)產(chǎn)業(yè)利潤(rùn)分配協(xié)議書
- 二零二五年度搏擊教練員免責(zé)責(zé)任書
- 農(nóng)業(yè)現(xiàn)代化技術(shù)推廣合作協(xié)議
- 智能建筑系統(tǒng)合同
- 工作室成員成長(zhǎng)檔案模板(內(nèi)部版)課件
- 項(xiàng)目滯后趕工措施
- 預(yù)防接種人員崗位培訓(xùn)習(xí)題(Ⅰ類培訓(xùn)練習(xí)題庫共385題)
- 現(xiàn)場(chǎng)經(jīng)濟(jì)簽證單范本
- 固定義齒工藝流程圖
- 《網(wǎng)店運(yùn)營與管理》課件(完整版)
- (高職)員工培訓(xùn)與開發(fā)(第四版)完整版教學(xué)課件全套電子教案
- 相親相愛 簡(jiǎn)譜
- 第四章工具鋼
- 2022年春新冀人版科學(xué)五年級(jí)下冊(cè)全冊(cè)課件
- 服裝購銷合同最新版
評(píng)論
0/150
提交評(píng)論