可編程邏輯器件及EDA技術(shù)實(shí)驗(yàn)報(bào)告.doc_第1頁(yè)
可編程邏輯器件及EDA技術(shù)實(shí)驗(yàn)報(bào)告.doc_第2頁(yè)
可編程邏輯器件及EDA技術(shù)實(shí)驗(yàn)報(bào)告.doc_第3頁(yè)
可編程邏輯器件及EDA技術(shù)實(shí)驗(yàn)報(bào)告.doc_第4頁(yè)
可編程邏輯器件及EDA技術(shù)實(shí)驗(yàn)報(bào)告.doc_第5頁(yè)
已閱讀5頁(yè),還剩20頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

可編程邏輯器件及EDA技術(shù)實(shí)驗(yàn)報(bào)告一、組合邏輯電路設(shè)計(jì) 數(shù)字邏輯電路按照邏輯功能的特點(diǎn)分為兩類(lèi),一類(lèi)是組合邏輯電路,簡(jiǎn)稱(chēng)為組合電路;另一類(lèi)是時(shí)序邏輯電路,簡(jiǎn)稱(chēng)為時(shí)序電路。組合電路的特點(diǎn)是電路任意時(shí)刻輸出狀態(tài)只取決該時(shí)刻的輸入狀態(tài),而與該時(shí)刻錢(qián)的電路狀態(tài)無(wú)關(guān)。1、邏輯門(mén)電路設(shè)計(jì)實(shí)驗(yàn)原理:邏輯門(mén)電路包括基本邏輯門(mén)電路和符合邏輯門(mén)電路。VHDL語(yǔ)言可以直接支持的邏輯運(yùn)算符共有七種邏輯運(yùn)算,它們是: NOT 邏輯非 AND 邏輯與 NAND 邏輯與非 OR 邏輯或 NOR 或非 XOR 異或 XNOR 異或非實(shí)驗(yàn)內(nèi)容:例3-2的參考程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee. std_logic_unsigned.all;entity example3_2 is port(a,b,c,d:in std_logic; f:out std_logic_vector(3 downto 0);end example3_2;architecture behavioral of example3_2 isbeginf(0)=(a and b)or(b and c)or(not b and not c);f(1)=(a and b and c)or not(not a or not b or not c);f(2)=(a xor b xor c)or(not(d)and(a or c);f(3)=not (a and b)xor (c and d)or(a and b and d)xor(b and c and d);end behavioral;實(shí)驗(yàn)分析:用邏輯運(yùn)算符是實(shí)現(xiàn)了相對(duì)較為復(fù)雜的邏輯運(yùn)算。參考程序中使用括號(hào)來(lái)強(qiáng)制控制邏輯運(yùn)算的優(yōu)先級(jí),對(duì)于用VHDL設(shè)計(jì),這種寫(xiě)法是必修的。用這種方法可以簡(jiǎn)單、快捷地完成邏輯電路設(shè)計(jì)。電路結(jié)構(gòu)圖:實(shí)驗(yàn)波形仿真如下圖:2、常用編碼器設(shè)計(jì)編碼是指用文字、符號(hào)和數(shù)碼等來(lái)表示某種信息的過(guò)程。在數(shù)字系統(tǒng)中,由于采用二進(jìn)制運(yùn)算來(lái)處理數(shù)據(jù),因此通常是將信息編成若干位二進(jìn)制代碼,而在邏輯電路中,信號(hào)都是以高、低電平的形式給出的。實(shí)現(xiàn)編碼的數(shù)字電路稱(chēng)作編碼器(encoder),編碼器的邏輯功能就是把輸入的每一個(gè)高低電平信號(hào)編成一組對(duì)應(yīng)的二進(jìn)制代碼。實(shí)驗(yàn)原理:根據(jù)8線(xiàn)-3線(xiàn)優(yōu)先編碼器的真值表可得,優(yōu)先編碼器的編碼輸入、編碼輸出均為低電平有效,且有使能輸入和使能輸出功能。實(shí)驗(yàn)內(nèi)容:例3.4試用VHDL設(shè)計(jì)一個(gè)8線(xiàn)-3線(xiàn)優(yōu)先編碼器,編碼器輸出為反碼輸出。它的程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity example3_4 is port(sin:in std_logic; i:in std_logic_vector(7 downto 0); a:out std_logic_vector(2 downto 0); e,s:out std_logic);end example3_4;architecture behavioral of example3_4 isbegin process(sin,i) begin if sin=1 then a=111;e=1;s=1; else if i(7)=0 then a=000;e=0;s=1; elsif i(6)=0 then a=001;e=0;s=1; elsif i(5)=0 then a=010;e=0;s=1; elsif i(4)=0 then a=011;e=0;s=1; elsif i(3)=0 then a=100;e=0;s=1; elsif i(2)=0 then a=101;e=0;s=1; elsif i(1)=0 then a=110;e=0;s=1; elsif i(0)=0 then a=111;e=0;s=1; else a=111;e=1;s segment segment segment segment segment segment segment segment segment segment segment segment segment segment segment segment NULL ; END CASE ; END PROCESS ; END ;實(shí)驗(yàn)分析:當(dāng)共陰極數(shù)碼管的某一陽(yáng)極接高電平時(shí),相應(yīng)的二極管發(fā)光,若要顯示某字形,則使相應(yīng)幾段的二極管發(fā)光即可,所以共陰極數(shù)碼管需要有輸出高電平有效的譯碼器去驅(qū)動(dòng),而共陰極數(shù)碼管則需要輸出低電平有效的譯碼器去驅(qū)動(dòng)。上面程序是一個(gè)能驅(qū)動(dòng)共陽(yáng)極數(shù)碼管的7段譯碼器的VHDL程序。實(shí)驗(yàn)波形仿真如下:4、數(shù)據(jù)選擇器設(shè)計(jì) 數(shù)據(jù)選擇器(multiplexer)是在地址選擇信號(hào)的控制下,從多路輸入數(shù)據(jù)中選擇一路作為輸出的邏輯電路,叫做多路開(kāi)關(guān),簡(jiǎn)稱(chēng)MUX。實(shí)驗(yàn)原理:在可編程邏輯器件的設(shè)計(jì)中經(jīng)常用數(shù)據(jù)選擇器來(lái)實(shí)現(xiàn)課編程邏輯器件內(nèi)部數(shù)據(jù)總線(xiàn)的連接。實(shí)驗(yàn)內(nèi)容:例3.7試用VHDL設(shè)計(jì)4選1數(shù)據(jù)選擇器。參考程序:Library ieee;Use ieee.std_logic_1164.all;Use ieee.std_logic_arith.all;Use ieee.std_logic_unsigned.all;Entity example3_7 is Port(d:in std_logic_vector(3 downto 0); a:in std_logic_vector(1 downto 0); e:in std_logic; f:out std_logic);end example3_7;architecture behavioral of example3_7 isbegin process(e,a,d) begin if e=0then case a is when 00 =ffff=d(3); end case; end if;end process;end behavioral;實(shí)驗(yàn)分析:一個(gè)4選1數(shù)據(jù)選擇器,D3D0為4個(gè)數(shù)據(jù)輸入,F(xiàn)為數(shù)據(jù)輸出,A1、A0是地址選擇輸入。當(dāng)A1、A0為不同代碼時(shí),D3D0中不同輸入通道數(shù)據(jù)送至輸出端F。E為使能端,當(dāng)E=0時(shí),數(shù)據(jù)選擇器正常工作,否則禁止工作。實(shí)驗(yàn)波形仿真:5、數(shù)據(jù)分配器設(shè)計(jì) 在數(shù)字信號(hào)的傳輸過(guò)程中,常常需要將一路數(shù)據(jù)分配到多路通道中去。實(shí)現(xiàn)這種功能的邏輯電路,叫做數(shù)據(jù)分配器(Demultiplexer),簡(jiǎn)稱(chēng)DEMUX,其電路為單輸入、多輸出形式。實(shí)驗(yàn)內(nèi)容:例3.10試用VHDL設(shè)計(jì)兩總線(xiàn)數(shù)據(jù)分配器。它的參考程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity example3_10 is port(sel:in std_logic; a,b:in std_logic_vector(7 downto 0); mux_out: out std_logic_vector(7 downto 0);end example3_10;architecture behavioral of example3_10 isbegin process(sel,a,b) begin if sel=1 then mux_out=a; else mux_out=b; end if; end process;end behavioral;實(shí)驗(yàn)分析:D為被傳輸?shù)臄?shù)據(jù)輸入,A、B是(地址)選擇輸入,Q0Q3為數(shù)據(jù)輸出。電路結(jié)構(gòu)圖:實(shí)驗(yàn)波形仿真圖:6、數(shù)值比較器設(shè)計(jì)數(shù)值比較器是用來(lái)比較兩個(gè)數(shù)據(jù)之間市值關(guān)系的電路。按照比較的數(shù)據(jù)類(lèi)型劃分,數(shù)值比較器可分為無(wú)符號(hào)數(shù)二進(jìn)制比較器和有符號(hào)數(shù)二進(jìn)制比較器。實(shí)驗(yàn)內(nèi)容:例3.12試用VHDL設(shè)計(jì)兩個(gè)8位有符號(hào)數(shù)的數(shù)值比較器,比較分別輸出大于、小于和相等的結(jié)果。它的程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity example3_12 is port(a,b:in std_logic_vector(7 downto 0); gt,eq,lt:out std_logic);end example3_12;architecture behavioral of example3_12 issignal sab:std_logic_vector(1 downto 0);begin sab if a(6 downto 0)b(6 downto 0) then gt=1;eq=0;lt=0; elsif a(6 downto 0)=b(6 downto 0)then gt=0;eq=1;lt=0; else gt=0;eq=0;lt gt=1;eq=0;lt gt=1;eq=0;lt if a(6 downto 0)b(6 downto 0) then gt=0;eq=0;lt=1; elsif a(6 downto 0)=b(6 downto 0)then gt=0;eq=1;lt=0; else gt=1;eq=0;lt gt=0;eq=1;lt=0; end case; end process; end behavioral;實(shí)驗(yàn)分析:從程序可以看到,利用并置的方法從輸入數(shù)據(jù)中分離出符號(hào)位,然后用case語(yǔ)句將符號(hào)位的四種組態(tài)分開(kāi),分別處理。實(shí)驗(yàn)波形仿真圖: 7、算術(shù)運(yùn)算單元電路設(shè)計(jì)實(shí)驗(yàn)原理:算術(shù)運(yùn)算單元電路是構(gòu)成處理器CPU的算術(shù)邏輯單元(ALU)的一個(gè)重要組成部分。實(shí)驗(yàn)內(nèi)容:例3.13試用VHDL設(shè)計(jì)一個(gè)8位二進(jìn)制數(shù)的加法器。它的程序如下: library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity fulladder is port(ai,bi,cin:in std_logic; si,cio:out std_logic);end fulladder;architecture behavioral of fulladder isbeginsi=(ai xor bi)xor cin;cio=(ai and bi)or(cin and ai)or(cin and bi);end behavioral;library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity example3_13 is port(a,b:in std_logic_vector(7 downto 0); ci:in std_logic; co:out std_logic; s:out std_logic_vector(7 downto 0);end example3_13;architecture behavioral of example3_13 is component fulladderport(ai,bi,cin:in std_logic; si,cio:out std_logic);end component;signal carry:std_logic_vector(8 downto 0);begincarry(0)=ci;coa(i), bi=b(i), cin=carry(i), si=s(i), cio=carry(i+1);end generate gen;end behavioral;實(shí)驗(yàn)分析:8位二進(jìn)制加法器可以由8個(gè)全加器通過(guò)級(jí)聯(lián)的方式構(gòu)成。實(shí)驗(yàn)波形仿真圖如下:二、時(shí)序邏輯電路設(shè)計(jì)根據(jù)邏輯電路功能,邏輯電路可分為組合邏輯電路和時(shí)序邏輯電路兩大類(lèi)。其特點(diǎn)是電路任意時(shí)刻的穩(wěn)態(tài)輸出僅取決于該時(shí)刻的輸入信號(hào),而與電路原來(lái)的狀態(tài)無(wú)關(guān)。1、 常用觸發(fā)器設(shè)計(jì)實(shí)驗(yàn)原理:觸發(fā)器(flip-flop)是能存儲(chǔ)一位二進(jìn)制數(shù)的邏輯電路,是時(shí)序邏輯電路的基本單元電路。觸發(fā)器具有兩個(gè)穩(wěn)定狀態(tài),用來(lái)表示邏輯狀態(tài)或二進(jìn)制數(shù)的0和1。實(shí)驗(yàn)內(nèi)容:例3.14試用VHDL設(shè)計(jì)一個(gè)D觸發(fā)器。它參考程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all; ENTITY example3_14 IS PORT (CLK : IN STD_LOGIC ; D : IN STD_LOGIC ; Q : OUT STD_LOGIC ); END ; ARCHITECTURE behavioral OF example3_14 IS BEGIN PROCESS (CLK) BEGIN IF CLKEVENT AND CLK = 1 THEN Q = D ; END IF; END PROCESS ; END;電路結(jié)構(gòu)圖:實(shí)驗(yàn)波形仿真圖:實(shí)驗(yàn)原理:對(duì)于時(shí)序電路的控制,通??梢詣澐譃橥椒绞胶彤惒椒绞健M椒绞绞侵缚刂菩盘?hào)只有在時(shí)鐘有效時(shí)才起作用,簡(jiǎn)稱(chēng)同步控制;異步方式是指控制系統(tǒng)起作用不需要時(shí)鐘信號(hào)有效,簡(jiǎn)稱(chēng)異步控制。實(shí)驗(yàn)內(nèi)容:例3.15試用VHDL設(shè)計(jì)一個(gè)具有異步復(fù)位和同步置位的D觸發(fā)器。它的參考程序:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity example3_15 is port(d: in std_logic; clk: in std_logic; clr,set: in std_logic; q: out std_logic);end example3_15;architecture behavioral of example3_15 isbegin process(clk,clr,set) begin if clr=1 then q=0; elsif rising_edge(clk) then if set=1 then q=1; else q=d; end if; end if; end process;end behavioral;電路結(jié)構(gòu)圖:實(shí)驗(yàn)波形仿真圖:2、常用數(shù)碼寄存器設(shè)計(jì) 數(shù)碼寄存器用于寄存數(shù)據(jù),不能進(jìn)行數(shù)據(jù)移位。它被廣泛地應(yīng)用于各類(lèi)數(shù)字計(jì)算機(jī)和數(shù)字系統(tǒng)中。一般來(lái)說(shuō),寄存器是借助時(shí)鐘脈沖的作用把數(shù)據(jù)寄存在觸發(fā)器內(nèi),寄存數(shù)據(jù)的位數(shù)和所用觸發(fā)器的個(gè)數(shù)是相等的,因?yàn)橐粋€(gè)觸發(fā)器能儲(chǔ)存1位二進(jìn)制碼,所以用N觸發(fā)器組成的寄存器能儲(chǔ)存一組N二進(jìn)制碼。按照數(shù)碼寄存器的功能,可以把數(shù)碼寄存器的功能劃分為寄存器、鎖存器和移位寄存器等。實(shí)驗(yàn)內(nèi)容:例3.17試用VHDL設(shè)計(jì)一個(gè)8位鎖存器。它的參考程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity example3_17 is port(d: in std_logic_vector(7 downto 0); le: in std_logic; q: out std_logic_vector(7 downto 0);end example3_17;architecture behavioral of example3_17 issignal qin: std_logic_vector(7 downto 0);begin p1: process(d) begin if le=1then qin=d; end if; end process p1; p2: process(le) begin if falling_edge(le) then q= qin; end if; end process p2;end behavioral;實(shí)驗(yàn)波形仿真圖:3、常用計(jì)數(shù)器設(shè)計(jì) 計(jì)數(shù)的功能就是累計(jì)輸入脈沖的個(gè)數(shù)。實(shí)現(xiàn)計(jì)數(shù)功能的數(shù)字電路就稱(chēng)為計(jì)數(shù)器(counter)。被計(jì)數(shù)的脈沖(簡(jiǎn)稱(chēng)計(jì)數(shù)脈沖)可以是周期性脈沖,也可以是非周期性脈沖,它通常加載計(jì)數(shù)器的時(shí)鐘輸入端,作為計(jì)數(shù)器的時(shí)鐘脈沖。 計(jì)數(shù)器在循環(huán)中的狀態(tài)個(gè)數(shù)叫做計(jì)數(shù)器的模(modulus)。在循環(huán)中有m個(gè)狀態(tài)的計(jì)數(shù)器稱(chēng)為模m計(jì)數(shù)器,或稱(chēng)m分頻計(jì)數(shù)器。 實(shí)驗(yàn)內(nèi)容:例3.21試用VHDL設(shè)計(jì)一個(gè)十進(jìn)制計(jì)數(shù)器。它的參考程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity example3_21 is port(en,clk: in std_logic; q: out std_logic_vector(3 downto 0); qcc: out std_logic);end example3_21;architecture behavioral of example3_21 issignal qtemp: std_logic_vector(3 downto 0);begin process(clk,en) begin if clkevent and clk=1then if en=1then if qtemp=1001then qtemp=0000; else qtemp=qtemp+1; end if; end if; end if; end process;q=qtemp;qcc=qtemp(3) and qtemp(2) and qtemp(0) and qtemp(0);end behavioral;電路結(jié)構(gòu)圖:實(shí)驗(yàn)波形仿真圖:三、有限狀態(tài)機(jī)(finite state machine)是由寄存器和組合邏輯構(gòu)成的硬件時(shí)序電路。同步有限狀態(tài)機(jī)的狀態(tài)只能在同一時(shí)鐘跳變沿的情況下才能從一個(gè)狀態(tài)轉(zhuǎn)向另一個(gè)狀態(tài)。有限狀態(tài)機(jī)按照結(jié)構(gòu)劃分為mealy型和moore型。1、 Mealy型狀態(tài)機(jī)設(shè)計(jì)實(shí)驗(yàn)原理:Mealy型狀態(tài)機(jī)的輸出信號(hào)是當(dāng)前狀態(tài)和所有輸入信號(hào)的函數(shù)。Mealy型狀態(tài)機(jī)的輸出是在輸入變化后立即發(fā)生變化,且輸入變化可能出現(xiàn)在時(shí)鐘周期內(nèi)的任何時(shí)候,因而mealy型狀態(tài)機(jī)隊(duì)輸入的響應(yīng)比Moore型狀態(tài)機(jī)對(duì)輸入的響應(yīng)早一個(gè)時(shí)鐘周期。實(shí)驗(yàn)內(nèi)容:例3.23試用VHDL設(shè)計(jì)實(shí)現(xiàn)交通燈控制器的mealy型狀態(tài)機(jī),其中T1,T2,T3分別代表三個(gè)定時(shí)器的溢出信號(hào),三個(gè)定時(shí)器代表紅燈、綠燈和黃燈點(diǎn)亮?xí)r間;reset信號(hào)代表復(fù)位信號(hào)。它的參考程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity example3_23 is port (reset,clk: in std_logic; t1,t2,t3: in std_logic; r,g,y: out std_logic);end example3_23;architecture behavioral of example3_23 is type state_type is (red,green,yellow); signal state,next_state:state_type;beginsync_ptoc: process(clk) begin if (clkevent and clk =1)then if(reset =1)then state = red; else state = next_state; end if; end if;end process;-mealy state machine-outputs based on state and inputsoutput_decode: process(state,t1,t2,t3)begin if(state =red and t1 =0)then r=1; g=0; y=0; elsif (state = green and t2 = 0)then r=0; g=1; y=0; elsif (state = yellow and t3 = 0)then r=0; g=0; y=1; end if;end process;next_state_decode: process(state,t1,t2,t3)begin next_state if t1 =1 then next_state if t2 =1 then next_state next_state next_state= red; end case; end process;end behavioral;實(shí)驗(yàn)波形仿真圖:2、 Moore型狀態(tài)機(jī)設(shè)計(jì)實(shí)驗(yàn)原理:Moore型狀態(tài)機(jī)的輸出只與當(dāng)前狀態(tài)有關(guān),而與當(dāng)前輸入無(wú)關(guān)。Moore型狀態(tài)機(jī)在時(shí)鐘跳變后的有限個(gè)門(mén)延遲之后,輸出達(dá)到穩(wěn)定值。輸出會(huì)在一個(gè)完整的時(shí)鐘周期內(nèi)保持穩(wěn)定,即使在該時(shí)鐘周期內(nèi)輸入信號(hào)有變化,輸出也不會(huì)變化。輸入對(duì)輸出的影響要到下一個(gè)時(shí)鐘周期才能反映出來(lái)。把輸入和輸出隔離開(kāi)來(lái)是Moore型狀態(tài)機(jī)的一個(gè)重要特點(diǎn)。 實(shí)驗(yàn)內(nèi)容:例3.24試用VHDL設(shè)計(jì)如實(shí)現(xiàn)空調(diào)系統(tǒng)的控制器的Moore型狀態(tài)機(jī),其中high和low信號(hào)是來(lái)自室內(nèi)溫度傳感器的輸出信號(hào),分別表示室內(nèi)溫度過(guò)高和過(guò)低,當(dāng)兩者輸出均無(wú)效時(shí)代表室內(nèi)溫度適中。如果溫度過(guò)高或者過(guò)低,則制冷控制信號(hào)cold或者制冷控制信號(hào)heat輸出有效。它的程序如下:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity example3_24 is port (reset,clk: in std_logic; high,low: in std_logic; cold,heat: out std_logic);end example3_24;architecture behavioral of example3_24 istype state_type is(too_high, too_low,well_situated);signal state, next_state: state_type;beginsync_proc:process(clk) begin if(clkevent and clk=1)then if(reset=1)then state= well_situated; else state= next_state; end if; end if; end process;-moore state machineoutput_decode: process(state) begin if state = too_high then cold=1; heat=0; elsif state = too_low then cold=0; heat=1; elsif state = well_situated then cold=0; heat=0; end if ; end process;next_state_decode: process(state,high,low) begin next_state if high=1then next_state = too_high; end if; if low=1then next_state if high=1then next_state= too_high; else next_state if low=1then next_state = too_low; else next_state next_state = well_situated; end case; end process;end behavioral;電路結(jié)構(gòu)圖:實(shí)驗(yàn)波形仿真圖:四、存儲(chǔ)器設(shè)計(jì) 存儲(chǔ)器按其類(lèi)型可分為只讀存儲(chǔ)器、隨機(jī)存儲(chǔ)器和順序存儲(chǔ)器。用可編程邏輯器件的邏輯資源和其內(nèi)部的嵌入式存儲(chǔ)器資源可以設(shè)計(jì)實(shí)現(xiàn)各種類(lèi)型的存儲(chǔ)器。1、 只讀存儲(chǔ)器(ROM)的設(shè)計(jì)實(shí)驗(yàn)原理:只讀存儲(chǔ)器(ROM)是一個(gè)非易失的存儲(chǔ)器。在FPGA中嵌入式存儲(chǔ)模塊的隨機(jī)存儲(chǔ)器(RAM)結(jié)構(gòu),用RAM結(jié)構(gòu)實(shí)現(xiàn)ROM是通過(guò)FPGA的配置過(guò)程實(shí)現(xiàn)的。FPGA的綜合系統(tǒng)設(shè)計(jì)的ROM中數(shù)據(jù)文件直接綜合到配置數(shù)據(jù)文件中,每次FPGA在唄重新配置的同時(shí)也對(duì)FPGA內(nèi)部編程為ROM的存儲(chǔ)器資源進(jìn)行初始化,這樣就形成了實(shí)際意義上的ROM。實(shí)驗(yàn)內(nèi)容:例3.25試用VHDL設(shè)計(jì)一個(gè)8*8的ROM。library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;use std.textio.all;entity example3_25 is port(clk: in std_logic; rd: in std_logic; data: out std_logic_vector(7 downto 0); address: in std_logic_vector(3 downto 0);end example3_25;architecture behavioral of example3_25 is type romtype is array(0 to 15)of bit_vector(7 downto 0); impure function rom_function_name(rom_file_name: in string) return romtype is file rom_file: text is in rom_file_name; variable line_name: line; variable rom_name: romtype; begin for i in romtyperange loop readline (rom_file, line_name); read (line_name, rom_name(i); end loop; return rom_name; end function;signal rom_name: romtype:=rom_function_name(file_name.men)

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 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ì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論