Up-Down Counter VHDL Code
In digital design, a counter is a device which stores the number of times a particular event has occurred, often with respect to a clock signal. The most common type is a sequential digital logic circuit with an input line called the clock and multiple output lines representing the count. The values on the output lines represent a number in the binary or BCD number system. Each pulse applied to the clock input increments or decrements the number in the counter. VHDL Code: library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_unsigned.ALL; entity U_DCOUNTER is Port ( RESET : in STD_LOGIC; U_D : in STD_LOGIC; CLK : in STD_LOGIC; Cout : out STD_LOGIC_VECTOR (3 downto 0)); end U_DCOUNTER; architecture U_DCOUNTER of U_DCOUNTER is begin process(CLK,RESET) variable temp:STD_LOGIC_VECTOR (3 downto 0):="0000"; begin...