The module will have the following input data:
a - 8 bits
b - 32 bits
compare - 1 bit
change - 3 bits
The module will have the following output data:
compare_out - 2 bits
return_out - 16 bits
select_out - x bits, where x represents the minimum number of bits needed to calculate the sum of positions containing 0 bits from a
Initially, the compare_out and return_out outputs will have all bits set to "1".
The select_out output will be independent of module stimuli and will calculate the sum of positions containing 0 bits from a.
The module reacts only to inputs a, b, and return.
The compare_out output changes only when compare is 1'b1; otherwise, it will remain at its previous value (for this subpoint, the use of the decision operator is desired).
If compare is 1, the compare_out output:
Will be 10 if the most significant 8 bits of b are less than a
Will be 00 if the most significant 8 bits of b are greater than a
Will be 01 if the most significant 8 bits of b are equal to bus a
The return_out output will only be modified when change has a value different from 3'b111.
If change is equal to 3'b100, then the return_out output will be equal to the bus formed by the least significant bits of a and b.
If change is equal to 3'b001, then the return_out output will be equal to the bus formed by the most significant bits of a and b.
If change is equal to 3'b101, then the return_out output will be equal to the bus formed by a and the least significant bits of b.
If change is equal to 3'b011, then the return_out output will be equal to the bus formed by a and the most significant bits of b.
If change is equal to 3'b000, then the return_out output will be equal to the bus formed by a and a.
If change is equal to 3'b010, then the return_out output will be equal to the bus formed by the least significant bits of b and the most significant bits of b.
For any other value of the change input, the return_out output will have a value equal to the bus formed by the least significant 16 bits of b negated.
- Create the corresponding testbench for the module from exercise 2 using the decision table test technique, and explain the chosen cases.