0
14kviews
Write VHDL code for 3 bit up counter
1 Answer
1
2.1kviews
-------- Up Counter --------
Library ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_signed.all;
-------------------------------------------------------
ENTITY Up Counter IS
GENERIC (bits: 3); 
PORT (a: IN BIT_VECTOR(bits-1 DOWNTO 0):
clk: IN BIT;
count: OUT BIT_VECTOR(bits-1 DOWNTO 0));
END Up Counter;
------------------------------------------------------
ARCHITECTURE behavioral OF Up Counter IS
BEGIN
count <= 3'b000;
a <= 3'b001;
PROCESS (clk)
BEGIN
count <= count + a;
END PROCESS;
END behavioral;
Please log in to add an answer.