Forum Discussion
Gate functions dont work correctly on FPGA
Hello,i am new to the forum and to fpgas.I have recently bought a Cyclone FPGA from ebay with the ep1c3t144c8 chip on it,and have tried to do simple logic gate functions with the dip switches and the led's but they don't seem to operate correctly.For example,when I try to verify the and gate,it works like an or gate and vice versa.Other gates functions also dont work correctly.I also tried to simulate the project but there seems to be nothing wrong during simulation.Can it be a faulty fpga or am I doing something wrong?
6 Replies
- Altera_Forum
Honored Contributor
Most likely a coding error. If there was something wrong with the FPGA it would probably not power up at all.
How about posting the code or the project? - Altera_Forum
Honored Contributor
Here is the code in VHDL:
library ieee; use ieee.std_logic_1164.all; entity p1 is port( A, B : in std_logic; F : out std_logic); end p1; architecture func of p1 is begin F <= A and B; end func; - Altera_Forum
Honored Contributor
Maybe your inputs are active low : it is common with push buttons. Button pressed means input = 0.
maybe your LED is illuminating when output = 0. - Altera_Forum
Honored Contributor
The leds on most boards illuminate with a logic low output. Are you allowing for this?
- Altera_Forum
Honored Contributor
Thank you for your replies :).I think that's what's happening.Is there any way to change the active low of the push buttons and also make the led illuminate when the output is '1'?
- Altera_Forum
Honored Contributor
Put not gates on the inputs and outputs of your block.