eda_course_plan_18(3)
发布时间:2021-06-06
发布时间:2021-06-06
关于EDA实验的介绍
a,b,c,d,e,f,g:OUT std_logic); END;
ARCHITECTURE arc_bcd7 OF bcd7 IS
SIGNAL din: std_logic_vector(3 DOWNTO 0); SIGNAL dout: std_logic_vector(6 DOWNTO 0); BEGIN
din<=d3&d2&d1&d0; --&为并置运算符,形成位矢量din PROCESS(din) BEGIN
CASE din IS --abcdefg,输出的7段码,a为高位,g为最低位 WHEN "0000"=> dout<= "1111110"; --7EH (显示0) (7EH为7段码总线值) WHEN "0001"=> dout<= "0110000"; --30H(显示1) WHEN "0010"=> dout<= "1101101"; --6DH(显示2) WHEN "0011"=> dout<= "1111001"; --79H(显示3) WHEN "0100"=> dout<= "0110011"; --33H(显示4) WHEN "0101"=> dout<= "1011011"; --5BH(显示5) WHEN "0110"=> dout<= "1011111"; --5FH(显示6) WHEN "0111"=> dout<= "1110000"; --70H(显示7) WHEN "1000"=> dout<= "1111111"; --7FH(显示8) WHEN "1001"=> dout<= "1111011"; --7BH(显示9) WHEN "1010"=> dout<= "1110111"; --77H(显示A) WHEN "1011"=> dout<= "0011111"; --1FH(显示b) WHEN "1100"=> dout<= "1001110"; --4EH(显示c) WHEN "1101"=> dout<= "0111101"; --3DH(显示d) WHEN "1110"=> dout<= "1001111"; --4FH(显示E) WHEN "1111"=> dout<= "1000111"; --47H(显示F) WHEN OTHERS => dout<= "1000111"; --47H(显示F) END CASE; END PROCESS;
a<=dout(6); b<=dout(5); c<=dout(4); d<=dout(3); e<=dout(2); f<=dout(1); g<=dout(0); END arc_bcd7;
三、时序逻辑电路的设计
同步十进制可逆计数器
Library ieee;
USE ieee.std_logic_1164.ALL; USE ieee.std_logic_unsigned.ALL; entity count IS
PORT(clk,rst,load,plus_sub: IN std_logic; din: IN std_logic_vector(3 DOWNTO 0);
dout: BUFFER std_logic_vector(3 DOWNTO 0)); END count;