版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、 12. Describe sequential systems in VHDL 12.1 Defining clocks, flip-flops and registers 12.2 Register Transfer Level (RTL) Coding12.3 Sequential logic 1 12.1 Defining clocks, flip-flops & registers 1. Defining a clock signal PROCESSBEGIN clock = 0;WAIT FOR 10 NS; clock = 1WAIT FOR 10 NS;END PROCESS;
2、There are many ways to define a clock. For example:Simulation waveform 2 12.1 Defining clocks, flip-flops & registers 2. The D-type flip-flopLIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY dff IS PORT ( d, clock: IN STD_LOGIC; Q: OUT STD_LOGIC);END ENTITY dff;ARCHITECTURE correct OF dff ISBEGIN PROC
3、ESS (clock) BEGIN IF ( rising_edge(clock) ) THEN q = d; END IF; END PROCESS;END ARCHITECTURE correct;3 12.1 Defining clocks, flip-flops & registers 3. The D-type flip-flop with reset If the Reset is synchronous, then it is ignored until the rising edge of the clock. When the rising edge comes, if Re
4、set=1 then q goes to 0. If Reset=0, then the flip-flop exhibits normal behavior, i.e. q=d. (1)If the Reset is synchronous4 12.1 Defining clocks, flip-flops & registers LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL; - D-type flip-flopENTITY dff IS PORT ( d : IN STD_LOGIC; - Data input clock: IN STD_LOGIC;
5、 - Clock input reset: IN STD_LOGIC; - Reset input Q : OUT STD_LOGIC); - OutputEND ENTITY dff;ENTITY definition 5 12.1 Defining clocks, flip-flops & registers ARCHITECTURE synch_reset OF dff ISBEGIN PROCESS (clock) BEGIN IF ( rising_edge(clock) ) THEN IF ( reset=1 ) THEN q = 0; ELSE q = d; END IF; EN
6、D IF; END PROCESS;END ARCHITECTURE synch_reset;Architecture declaration6 12.1 Defining clocks, flip-flops & registers If the Reset is asynchronous, then it takes immediate effect, no matter what the clock is doing. This means that the flip-flop is always sensitive to its Reset input. (2)If the Reset
7、 is asynchronous7 12.1 Defining clocks, flip-flops & registers ARCHITECTURE asynch_reset OF dff ISBEGIN PROCESS (clock, reset) BEGIN IF ( reset=1 ) THEN q = 0; ELSIF ( rising_edge(clock) ) THEN q = d; END IF; END PROCESS;END ARCHITECTURE asynch_reset;Architecture declaration should be:8 12.2 Registe
8、r Transfer Level Coding1. VHDL description of a registered adderARCHITECTURE behavioral OF adder ISBEGIN sum = a + b;END ARCHITECTURE behavioral;Behavioral description9 12.2 Register Transfer Level CodingAn obvious way to describe the adder with registered output is to instantiate 4 flip-flops at th
9、e output:ARCHITECTURE registered OF adder ISBEGIN sum sum(0), clock=clock, q=reg_sum(0) ); g2: ENTITY work.dff(correct) PORT MAP ( d=sum(1), clock=clock, q=reg_sum(1) ); g3: ENTITY work.dff(correct) PORT MAP ( d=sum(2), clock=clock, q=reg_sum(2) ); g4: ENTITY work.dff(correct) PORT MAP ( d=sum(3), c
10、lock=clock, q=reg_sum(3) );END ARCHITECTURE registered;10 12.2 Register Transfer Level Coding2. Register Transfer Level VHDLIf we want a reset signal, that can asynchronously reset the adder output to zero, the code should be:ARCHITECTURE rtl2 OF adder IS BEGIN PROCESS (clock, reset) BEGIN IF ( rese
11、t=1 ) THEN reg_sum 0); ELSIF ( rising_edge(clock) ) THEN reg_sum = a + b; end if; END PROCESS; END ARCHITECTURE rtl2;11 12.2 Register Transfer Level CodingThis style of coding is called register transfer level coding. We are using assignments to signals, but wrapping them up in processes triggered b
12、y the clock (and reset signal) in order to make it clear on what clock cycle the outputs should assume their values. 12 12.2 Register Transfer Level Coding3. VHDL variables A VHDL variable can only exist inside a process, and will assume its new value immediately whenever an assignment occurs. Like
13、c and f in the following circuit. 13 12.2 Register Transfer Level CodingARCHITECTURE fig12-10 OF adder ISBEGIN PROCESS (clock) VARIABLE e, f: SIGNED ( 31 DOWNTO 0 ); BEGIN IF ( rising_edge(clock) ) THEN c := a + b; f := d + e; sum = c + f; END IF; END PROCESS;END ARCHITECTURE fig12-10;Code listing using variables 14 12.3 Sequential logic 000001010011100101110111A Binar
溫馨提示
- 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ū)稅務(wù)局飲用水安全風(fēng)險(xiǎn)評(píng)估與整改服務(wù)協(xié)議4篇
- 2025版鋁材行業(yè)培訓(xùn)與咨詢服務(wù)合同范本
- 2025年度高新技術(shù)企業(yè)研發(fā)項(xiàng)目成果轉(zhuǎn)化與技術(shù)支持協(xié)議下載2篇
- 2025年度內(nèi)部控制合同管理內(nèi)部控制手冊(cè)3篇
- 二零二五版羅絲與吳磊的離婚協(xié)議及子女撫養(yǎng)權(quán)轉(zhuǎn)讓協(xié)議4篇
- 二零二五年度廚師技能競(jìng)賽與評(píng)選活動(dòng)合同4篇
- 二零二五版特色小鎮(zhèn)物業(yè)合同財(cái)務(wù)管理與文化旅游融合協(xié)議3篇
- 二零二五版汽車維修店面使用權(quán)轉(zhuǎn)讓合同模板3篇
- 2025年度新能源產(chǎn)業(yè)合作推廣戰(zhàn)略框架協(xié)議書
- 二零二五年度LED燈具音響設(shè)備研發(fā)生產(chǎn)合作協(xié)議4篇
- 華為HCIA-Storage H13-629考試練習(xí)題
- Q∕GDW 516-2010 500kV~1000kV 輸電線路劣化懸式絕緣子檢測(cè)規(guī)程
- 遼寧省撫順五十中學(xué)2024屆中考化學(xué)全真模擬試卷含解析
- 2024年湖南汽車工程職業(yè)學(xué)院?jiǎn)握新殬I(yè)技能測(cè)試題庫(kù)及答案解析
- 家長(zhǎng)心理健康教育知識(shí)講座
- GB/T 292-2023滾動(dòng)軸承角接觸球軸承外形尺寸
- 2024年九省聯(lián)考高考數(shù)學(xué)卷試題真題答案詳解(精校打?。?/a>
- 軍人結(jié)婚函調(diào)報(bào)告表
- 民用無(wú)人駕駛航空器實(shí)名制登記管理規(guī)定
- 北京地鐵6號(hào)線
- 航空油料計(jì)量統(tǒng)計(jì)員(初級(jí))理論考試復(fù)習(xí)題庫(kù)大全-上(單選題匯總)
評(píng)論
0/150
提交評(píng)論