中易网

你能采用异步预置,将模10计数器改成模6计数器?

答案:1  悬赏:0  
解决时间 2021-01-13 05:35
  • 提问者网友:听门外雪花风
  • 2021-01-13 00:49
你能采用异步预置,将模10计数器改成模6计数器?
最佳答案
  • 二级知识专家网友:西风乍起
  • 2021-01-13 00:55
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity cnt is
PORT (
rst:in std_logic;
clk: in std_logic;
d:out integer range 0 to 9
);
end cnt;
architecture ONE of cnt is
SIGNAL q:integer range 0 to 9:=0;
begin
process (rst,clk)
BEGIN
if rst='0' then
q<=0;
elsif clk'event and clk='1' then
if q=9 then
q<=0;
else
q<=q+1;
end if;
end if;
end process ;

d<=q;
end cnt;
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息!
大家都在看
推荐信息