The code takes in two 4-bit inputs, and multiplies them, outputting the 8-bit result. The way this is done is by utilizing multiple layers of full adders, with each layer of full adders acting as a multiplication. Four layers indicate the four multiplications, each bit of the second input being multiplied by the first input. Each layer is additionally offset, to correct for bit placement.
Put inputs in test.py, with input 1 being the left 4 bits of dut.ui_in.value, and input 2 being the right 4 bits of dut.ui_in.value. The corresponding output is compared with dut.uo_out.value, which should be the correct result of the multiplication.
N/A
# | Input | Output | Bidirectional |
---|---|---|---|
0 | ui_in[0] | uo_out[0] | 1b'0 |
1 | ui_in[1] | uo_out[1] | 1b'0 |
2 | ui_in[2] | uo_out[2] | 1b'0 |
3 | ui_in[3] | uo_out[3] | 1b'0 |
4 | ui_in[4] | uo_out[4] | 1b'0 |
5 | ui_in[5] | uo_out[5] | 1b'0 |
6 | ui_in[6] | uo_out[6] | 1b'0 |
7 | ui_in[7] | uo_out[7] | 1b'0 |