I've taken a project using verilog. We have two 4-bits number, a multiplexer(S0,S1) and four module(adder,substractor,and,xor). Output is 4 bit. I think it seems simple alu. I have written a verilog code that contains all of them as modules. I have assigned pins to DE0 board. As you can see, the output can be seen on leds. There is no problem about that. But, how the output can be displayed on Seven Segment Display instead of LEDs? However, the result should be hexadecimal instead of binary. I have also pins about seven segment display, so I think I will implement them like the leds. I'm new about verilog. It will be my first program.
- If S is 0 (00), adder result will be seen on LEDs.
- If S is 1 (01), subtraction result will be seen on LEDs.
- If S is 2 (10), AND operation result will be seen on LEDs.
- If S is 3 (11), XOR operation result will be seen on LEDs.