Very new to Verilog and FPGA. I can't wrap my head around the processes behind outputting to a Spartan-6 board and could do with a written explanation.
All I'm doing is a simple AND gate which outputs to an LED.
module andgate(
input a, b,
output q
);
assign q = a&b;
endmodule
Input switches are SW1 and SW2 (both set to pull-up), output LED is D1.
The program file runs on the board just fine, except the output is inverted - when no switches are pressed, the LED is on. I understand this is due to the need for pull-up resistors, but I only want the LED to illuminate when both switches are pressed.
How do I re-write my code or reconfigure the board so the desired output is displayed?
I've found that writing
assign q = ~a&~b
gives the result I want, but is there a better way?