求EDA用VHDL语言的程序设计,急急急!给高分!(要求完成一个具有异步复位和同步使能功能的10进制计数器)
要求在QuartusⅡ软件中采用VHDL语言完成一个具有异步复位和同步使能功能的10进制计数器的设计。要求如下:
1、通过3个按键分别控制时钟信号、使能信号和复位信号;
2、计数器的计数值通过1个数码管实时显示、进位输出通过一个发光二极管的亮来表示;
3、时钟脉冲的控制首先通过单个按键引入,然后通过实验箱上的Clock0引脚引入连续脉冲;
4、对实验结果进行测试时,使用QuartusⅡ软件中的嵌入式逻辑分析仪Signal TapⅡ实时测试,并观察计数器的相关端口信号的变化。
有谁会解答,速度回答,谢谢啦!采纳后再加分! 展开
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity shicount is
port(clk,reset,enable: in std_logic;
a,b,c,d,e,f,g: out std_logic;
tp : out std_logic_vector(0 to 3);
xian: out std_logic_vector(0 to 6);
count :out std_logic);
end shicount;
architecture xu of shicount is
signal temp :std_logic_vector(0 to 3);
signal xianshi:std_logic_vector(0 to 6);
begin
process(clk,reset,enable)
begin
if (reset='1')then temp<="0000";
elsif (enable='1') then
if (clk' event and clk='1')
then if (temp<="1000") then temp<=temp+1;
else temp<="0000";
end if;
end if;
end if;
end process;
process(temp)
begin
case temp is
when "0000"=> xianshi<="0000001";count<='0';
when "0001"=> xianshi<="0110000";count<='0';
when "0010"=> xianshi<="1101101";count<='0';
when "0011"=> xianshi<="1111001";count<='0';
when "0100"=> xianshi<="0110011";count<='0';
when "0101"=> xianshi<="1011011";count<='0';
when "0110"=> xianshi<="0011111";count<='0';
when "0111"=> xianshi<="1110000";count<='0';
when "1000"=> xianshi<="1111111";count<='0';
when "1001"=> xianshi<="1110011";count<='1';
when others=> xianshi<="0000000";count<='0';
end case;
end process;
a<=xianshi(6); b<=xianshi(5); c<=xianshi(4); d<=xianshi(3);
e<=xianshi(2);f<=xianshi(1); g<=xianshi(0); tp<=temp;
xian<=xianshi;
end xu;