Код
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity lab4 is
Port ( CLK : in STD_LOGIC;
CE, SRST : in STD_LOGIC;
Q: out STD_LOGIC_VECTOR(4 downto 0));
end lab4;
architecture rtl of lab4 is
signal N: STD_LOGIC_VECTOR(4 downto 0);
begin
process(CLK) begin
if rising_edge(CLK) then
if SRST = '1' then
N <= (others => '0');
elsif CE = '1' then
if N = "11001" then
N <= (others => '0');
else
N(0) <= '1';
N <= N(4 downto 1)& N(0);
end if;
end if;
end if;
Q <= N;
end process;
end rtl;
- Вложения
-
- mdDafpLqNjE.jpg
- (127.55 КБ) 488 скачиваний


