executing optical sensors with vhdl

Guest #4814315
Hello everybody, and thank you for having me here with you.
i'm having troubles executing this optical sensor module that i created 
physically using VHDL in collaboration with DE-2/115
the pic i added should explain what i am trying to do... i want to be 
able to make this work by pressing one of the buttons on my board which 
cause a LED to light
this is the code i've written so far:
and for some reason it's not working :/

LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
entity mouse_lab IS
port(reset,clock_in: in STD_LOGIC;
IF2: IN STD_LOGIC;
LED1: OUT STD_LOGIC);
END mouse_lab;
architecture behave OF mouse_lab IS
BEGIN
PROCESS (clock_in,IF2)
BEGIN
if reset = '0' then
led1 <='1';
else
IF clock_in'event and clock_in = '1' then
if IF2 = '0' then
led1 <='0';
else
led1 <='1';
end if;
end if;
end if;
END process;
END behave;
Attached files:
Guest #4814771
The sensitivity List should have reset instead of IF2.
How is your Testbench working. Also people often wrongly apply clock to 
wrong Pin

Reply

A question of your own? This thread is over 9 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.