Forum Discussion
Altera_Forum
Honored Contributor
9 years agoup/down counter
Hello, can i get help for this program i am new to altera. i need help making a program that has an up and down counter from 15-0 using pushbuttons and 2 seven 7-segments display if its a...
Altera_Forum
Honored Contributor
9 years agolibrary ieee;
use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity counter is port ( clk : in std_logic; reset_bar : in std_logic; q : out std_logic_vector (2 downto 0)); end counter; architecture flow of counter is signal count_sig : unsigned ( 2 downto 0); begin process ( clk, reset_bar) begin if (reset_bar ='0' ) then count_sig <= "000"; elsif falling_edge (clk) then count_sig <= count_sig +1; end if; end process; q<= std_logic_vector (count_sig); end flow; i can only do a up counter but not both up and down and also how do i put up to 2 digits?