作业帮 > 综合 > 作业

设计一个同步22进制计数器,用VHDL语言,

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/04/30 19:57:44
设计一个同步22进制计数器,用VHDL语言,
计数时,个位为10进制计数,十位为2进制计数,宾且个位计满9向十位进位,当个位=1,十位=2时,计数器 复位
设计一个同步22进制计数器,用VHDL语言,
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity count_22 is
port(clk,reset:in std_logic;
ten_put:out std_logic_vector(1 downto 0);
one_put:out std_logic_vector(3 downto 0));
end entity;
architecture art of count_22 is
begin
process(clk,reset)
variable ten_data:std_logic_vector(1 downto 0);
variable one_data:std_logic_vector(3 downto 0);
begin
if reset='1' then
ten_data:="00";one_Data:="0000";
elsif clk'event and clk='1' then
if ten_data="10" then
if one_data="0010" then
ten_data:="00";
one_data:="0000";
else one_data:=one_data+'1';
end if;
elsif one_data="1001" then
ten_data:=ten_data+'1';
one_data:="0000";
else one_data:=one_data+'1';
end if;
end if;
end process;
end art;