After doing Exercise 5.40, write a Verilog test bench that tests the adder for a subset of the 232 possible pairs of 16-bit addends. The test bench should stop and display the actual and expected outputs if there is any mismatch. Try to come up with a strategy for generating the input pairs that catches likely coding enws while using less than a million input combinations.
Exercise 5.40
Using the entity that you defined in Exercise 5.37, write a structural Verilog program for a 16-bit ripple adder along the lines of Figure 6-84. Use a generate statement to create the 16 full adders and their signal connection.
Exercise 5.37
Write a dataflow-style Verilog module corresponding to the full-adder circuit in Figure 6-83.