多用電路的設計與開發實驗?實驗2 組合邏輯電路的設計一、試驗目的,接下來我們就來聊聊關于多用電路的設計與開發實驗?以下内容大家不妨參考一二希望能幫到您!
實驗2 組合邏輯電路的設計
一、試驗目的
1、掌握組合邏輯電路的設計方法。
2、掌握組合邏輯電路的靜态測試方法。
3、熟悉CPLD設計的過程,比較原理圖輸入和文本輸入的優劣。
二、實驗的硬件要求
1、輸入:按鍵開關(常高)4個;撥碼開關4位。
2、輸出:LED燈。
3、主芯片:Altera EPM7128SLC84-15。
三、實驗内容
1、設計一個四舍五入判别電路,其輸入為8421BCD碼,要求當輸入大于或等于5時,判别電路輸出為1,反之為0。
2、設計四個開關控制一盞燈的邏輯電路,要求改變任意開關的狀态能夠引起燈亮滅狀态的改變。(即任一開關的合斷改變原來燈亮滅的狀态)
3、設計一個優先排隊電路,其框圖如下:
排隊順序:
A=1 最高優先級
B=1 次高優先級
C=1 最低優先級
要求輸出端最多隻能有一端為“1”,即隻能是優先級較高的輸入端所對應的輸出端為“1”。
四、實驗連線
1、四位撥碼開關連D3、D2、D1、D0信号對應的管腳。
OUT輸出信号管腳接LED燈。
2、四位按鍵開關分别連K1、K2、K3、K4信号對應的管腳。
OUT輸出信号管腳接LED燈。
3、A、B、C信号對應管腳分别連三個按鍵開關。輸出A_Out、B_Out、C_Out信号對應的管腳分别連三個LED燈。
(具體管腳參數由底層管腳編輯決定)
五、參考原理圖
1、①原理圖,如圖2-1所示:
②VHDL硬件描述語言輸入:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_signed.all;
entity bcd_pjq is
port(din:in integer range 15 downto 0;
dout:out std_logic);
end;
architecture a of bcd_pjq is
begin
p1:process
begin
if din<5 then
dout<='0';
else
dout<='1';
end if;
end process p1;
end;
2、①原理圖,如圖2-2所示:
②VHDL硬件描述語言輸入:
library ieee;
use ieee.std_logic_1164.all;
entity led_control is
port(k0,k1,k2,k3:in std_logic;
y:out std_logic);
end ;
architecture one of led_control is
signal dz:std_logic_vector(3 downto 0);
begin
dz<=k3&k2&k1&k0;
p1:process(dz)
begin
case dz is
when "0000"=>y<='0';
when "0001"=>y<='1';
when "0011"=>y<='0';
when "0010"=>y<='1';
when "0110"=>y<='0';
when "0111"=>y<='1';
when "0101"=>y<='0';
when "0100"=>y<='1';
when "1100"=>y<='0';
when "1101"=>y<='1';
when "1111"=>y<='0';
when "1110"=>y<='1';
when "1010"=>y<='0';
when "1011"=>y<='1';
when "1001"=>y<='0';
when "1000"=>y<='1';
when others=>y<='X';
end case;
end process p1;
end one;
3、①原理圖,如圖2-3所示:
②VHDL硬件描述語言輸入:
library ieee;
use ieee.std_logic_1164.all;
entity queue_prior is
port(a,b,c:in std_logic;
aout,bout,cout:out std_logic);
end ;
architecture one of queue_prior is
begin
p1:process
begin
if a='1' then
aout<='1';
bout<='0';
cout<='0';
elsif b='1' then
aout<='0';
bout<='1';
cout<='0';
elsif c='1' then
aout<='0';
bout<='0';
cout<='1';
else
aout<='0';
bout<='0';
cout<='0';
end if;
end process p1;
end one;
六、實驗報告要求
1、對于原理圖設計要求有設計過程。
2、詳細論述實驗步驟。
3、寫一些對比兩種硬件設計輸入法的優劣的心得。
,更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!