图 1.5 时钟脉冲计数器模块CN8
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity cn8 is
port(clk:in std_logic;
coutut std_logic_vector(2 downto 0));
end cn8;
architecture rtl of cn8 is
signal q: std_logic_vector(2 downto 0);
begin
process(clk)
begin
if (clk'event and clk='1' ) then
if (q=7) then
qqqqqqqqqcout:=a;
when "001"=>cout:=b;
when "010"=>cout:=c;
when "011"=>cout:=d;
when "100"=>cout:=e;
when "101"=>cout:=f;
when "110"=>cout:=g;
when others=>cout:=h;
end case;
qqqqqqqqqqq<="1101111";
end case;
end process;
end rtl;