Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as VHDL by jpa ( 14 years ago )
-- Count number of cars total
process ( reset, clk )
  variable count : signed(7 downto 0) := "00000000";
begin
  if reset = '1' then
     count := 0;
  elsif rising_edge(clk) then
    if (enter_c = '1') then
     count := count + 1;
    elsif (exit_c = '1') then
     count := count - 1;
    end if;
    LED <= std_logic_vector(count(7 downto 0));
  end if;
end process;

 

Revise this Paste

Parent: 58373
Your Name: Code Language: