The project takes in two 4-bit numbers and performs multiplication to produce a product p. For each bit in the 4-bit inputs, the partial product was calculated by performing bitwise AND between the two inputs, resulting in 4 different partial products. Then the partial product would be shifted according to their multiplication process by shifting them in bits. Lastly, the partial products would be summed up to find the 8-bit product.
We tested the code by creating a test bench giving it different inputs and the product it should get for each set of inputs after multiplication. If the result after running the code is the same as what was entered in the test bench, then the code would pass the test.
None
# | Input | Output | Bidirectional |
---|---|---|---|
0 | a[0] | c[0] | |
1 | a[1] | c[1] | |
2 | a[2] | c[2] | |
3 | a[3] | c[3] | |
4 | b[0] | ||
5 | b[1] | ||
6 | b[2] | ||
7 | b[3] |