tferguson
Newbie level 3
Hello - I am trying to create a counter that will increment and decrement based on the direction the switch is turned. The counter is easy, but how do I read the input?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hi,
Can you brief abt it??
Best Regards,
Satya
process(clk)
begin
if rising_edge(clk) then
--------------------
--Increment
--------------------
if switch = '1' then
counter <= counter + 1;
else
counter <= counter - 1;
end if;
end if;
end process;
something like this?
Code:process(clk) begin if rising_edge(clk) then -------------------- --Increment -------------------- if switch = '1' then counter <= counter + 1; else counter <= counter - 1; end if; end if; end process;
That sort of makes sense. The switch isn't part of the FPGA, so I need to assign an input (button or switch) that is on the board, to an input on the FPGA?