该【2025年vhdl-BCD码减法计数器 】是由【业精于勤】上传分享,文档一共【2】页,该文档可以免费在线阅读,需要了解更多关于【2025年vhdl-BCD码减法计数器 】的内容,可以使用淘豆网的站内搜索功能,选择自己适合的文档,以下文字是截取该文章内的部分文字,如需要获得完整电子版,请下载此文档到您的设备,方便您编辑和打印。LIBRARY IEEE;
USE ;
USE ;
ENTITY jianfa IS
PORT(clk: IN STD_LOGIC;
q: out std_logic);
END jianfa;
ARCHITECTURE a OF jianfa IS
signal tmph,tmpl:std_logic_vector(3 downto 0);
signal h:std_logic;
begin
process(clk)
begin
if(clk'event and clk='1')then
if(tmpl="0000")then
tmpl<="1001";
tmph<=tmph-'1';
if(tmph="0000")then
tmph<="0011"; --十位
if(tmpl="0000")then
tmpl<="0100"; --个位
q<='1';
h<=not h;
end if;
end if;
elsif(tmpl<"1001"or tmpl="1001")then
tmpl<=tmpl-'1';
end if;
end if;
end process;
process(h)
begin
if(h'event and h='1')then
if(tmpl="0000")then
tmpl<="1001";
tmph<=tmph-'1';
if(tmph="0000")then
tmph<="0000"; --十位
if(tmpl="0000")then
tmpl<="0100"; --个位
q<='1';
h<=not h;
end if;
end if;
elsif(tmpl<"1001"or tmpl="1001")then
tmpl<=tmpl-'1';
end if;
end if;
end process;
end a;
2025年vhdl-BCD码减法计数器 来自淘豆网m.daumloan.com转载请标明出处.