
#INPUTS From the input wire ui_in, the first two bits will be used to determine the mode the chip will work:
#MODE 1 --> 7-segment display decoder This mode will work based on the work of the Verilog Code for Common Cathode of this website: https://www.luisllamas.es/en/verilog-7-segment-decoder/
Remember the two first inputs of wire ui_in are reserved for mode selection. The input wire number mentioned in the Verilog Code for Common Cathode should be configured from the third to the sixth input of wire ui_in.
#MODE 2 --> 16-segment display decoder Based this mode on MODE 1 with the difference that output should be configured to a 16-segment display. For the output to the 16-segment display use wire ou_out as the first 8 segments and complete the other 8 segments using the wire uio_out. Be sure for this last 8 outputs to activate wire uio_oe to "1" to enable path as output.
Remember the two first inputs of wire ui_in are reserved for mode selection. The input wire for the hex number to be display should be configured from the third to the sixth input of wire ui_in.
#MODE 3 --> 2-BIT FULL ADDER
Remember the two first inputs of wire ui_in are reserved for mode selection. The input for this 2-bit full adder shoud be configured starting from the third input of wire ui_in.
Configure the functionalty as a 2-bit Full Adder using the next configuration:
You can use the tb-verilog.v to test the code in Easy Eda.
You will need a 7-segmend display and 16-segment display common anode components and resistors for Mode 1 and 2. For Mode 3 you will need 5 leds and resistors.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | bitMode0 | output0 | output8 |
| 1 | bitMode1 | output1 | output9 |
| 2 | inputBit0 | output2 | output10 |
| 3 | inputBit1 | output3 | output11 |
| 4 | inputBit2 | output4 | output12 |
| 5 | inputBit3 | output5 | output13 |
| 6 | inputBit4 | output6 | output14 |
| 7 | inputBit5 | output7 | output15 |