Hey this is my vhdl program for a 3 bit counter with reset.. now i need to know how i can use another 3 bit counter simultaneously in such a way that while the 1st counter is resetting the 2nd counter counts and while the 2nd counter is resetting the 1st counter counts. This is done in such a manner that any bits received even during the reset time is counted by either of the counters.. without leaving out any bits.
entity BinCount3bit is
port(
clk : in std_logic;
reset : in std_logic;
sel : in std_logic;
q : out std_logic_vector(2 downto 0)
end BinCount3bit;
architecture behavioral of BinCount3bit is
begin
process(clk,reset)
begin
if reset = '1' then
q <= (others => '0');
elsif(rising_edge(clk))then
if sel = '0' then
q <= q+1;
else
q <= q+2;
end if;
end if;
end process;
end behavioral;