design error

Joined
Nov 5, 2007
Messages
5
Reaction score
0
i am designing a 5 bit counter
when the input INC = 1 , it increments 1 to the value in the counter away from the clock

Code:
ENTITY Project_SQ_generator IS
  port ( inc, arst : in std_logic;
         cnt       : out std_logic_vector(4 downto 0) );
END ENTITY Project_SQ_generator;

--
ARCHITECTURE RTL OF Project_SQ_generator IS

signal cnt_temp : unsigned(4 downto 0);

BEGIN

  process (inc,arst)
  begin
      if arst = '1' then cnt_temp <="00000";
      elsif inc = '1' then
        cnt_temp <= cnt_temp +1;
      end if;
  end process;

cnt <= std_logic_vector(cnt_temp);
        
END ARCHITECTURE RTL;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,169
Messages
2,570,919
Members
47,460
Latest member
eibafima

Latest Threads

Top