Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a Verilog module that can multiply an eight-bit signed number, A , by 1,

ID: 1716733 • Letter: C

Question

Create a Verilog module that can multiply an eight-bit signed number, A, by 1, 2, 3, or 4 and produce the results A, 2A, 3A or 4A, respectively (resulting in a 10-bit signed number). You cannot use the multiply (*) operator. The module interface must be:

Note: Test bench should apply all possible inputs and must also check the result of all of the multiplies and keep and display (at the end of the simulation in the console window) the count of correct multiplies versus the count of bad multiplies (which should be zero). The test bench can use the multiply (*) operator for checking the results of the multiplies.

module Mult1to4 input wire [ 7:0 ] A, input wire [ 1:0 multiplier, // Multiply by (multiplier 1) // Eight-bit signed input number output wire [ 9:0] Z output wire 9 : 0 // 10-bit signed output

Explanation / Answer

module mult(in1, in2, out, mult_start); // multiplication module input signed [32-1:0] in1, in2; input mult_start; output signed [64-1:0] out; reg signed [64-1:0] out; always @(in1 or in2 or mult_start) begin if (mult_start) begin out