Altera_Forum
Honored Contributor
7 years agoVhdl
I need help with the following task in the VHDL program: Based on the DE2 development board, design a 4-bit Johnson counter. The meter's status is to be displayed on 4 7-segment LED displays (eg 1110). The change in the meter's status is taking place run automatically, e.g. every 1s. Develop a test environment for the designed system.
I need to combine these two codes into one? 4-bit Johnson counter:library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Ring_counter is
Port( CLOCK: in STD_LOGIC;
RESET: in STD_LOGIC;
Q: out STD_LOGIC_VECTOR( 3 downto 0 ) );
end Ring_counter;
architecture Behavioral of Ring_counter is
signal q_tmp: std_logic_vector( 3 downto 0 ):= "0001";
begin
process( CLOCK, RESET )
begin
if RESET = '1' then
q_tmp <= "0001";
elsif Rising_edge( CLOCK ) then
q_tmp( 1 ) <= q_tmp( 0 );
q_tmp( 2 ) <= q_tmp( 1 );
q_tmp( 3 ) <= q_tmp( 2 );
q_tmp( 0 ) <= q_tmp( 3 );
end if;
end process;
Q <= q_tmp;
end Behavioral;