一:实验要求:
(实验板上的数码管是共阳极的,低电平时点亮。)
输入:波动开关,从“0000”至“1111”变化;
输出:用数码管显示(0,1,…9,A,b,C,d,E,F)。
二: 实验仪器与器材
1.EDA 开发软件
2.微机
3.实验开发系统
4.打印机
5.其他器件与材料
三:实验内容
- 源文件:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity yimaguan is
port(a:in std_logic_vector(3 downto 0);
led:out std_logic_vector(6 downto 0));
end;
architecture info of yimaguan is
begin
process(a)
begin
case a is
when "0000"=>led<="1000000";
when "0001"=>led<="1111001";
when "0010"=>led<="0100100";
when "0011"=>led<="0110000";
when "0100"=>led<="0011001";
when "0101"=>led<="0010010";
when "0110"=>led<="0000010";
when "0111"=>led<="1111000";
when "1000"=>led<="0000000";
when "1001"=>led<="0010000";
when "1010"=>led<="0001000";
when "1011"=>led<="0000011";
when "1100"=>led<="1000110";
when "1101"=>led<="0100001";
when "1110"=>led<="0000110";
when "1111"=>led<="0001110";
end case;
end process;
end;
2.编译情况:
3.引脚配置
4.仿真波形图:
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容