You are on page 1of 1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42

--NAME: D VINOD --DATE: 12/2/14 --CLASS:3RD ECE-G --PROGRAM 7 --UP/DOWN COUNTER WITHOUT FLIPLOP library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity updowncounter is port(clk,rst,control:in std_logic; ! x:inout std_logic_vector(3 downto 0)); end updowncounter;

architecture count1 of updowncounter is begin process (clk,rst,x,control) begin ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! end if rst='1' x<="0000"; then

elsif control='1' and rising_edge(clk) then ! ! ! ! x<=x+'1'; ! elsif control='0' and rising_edge{clk) then ! ! ! x<=x-'1'; !

if;

end process; end count1;

You might also like