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

2\'s complement multiplier, design. Design a multiplier for 2\'s complement bina

ID: 3788456 • Letter: 2

Question

2's complement multiplier, design. Design a multiplier for 2's complement binary numbers. Consider two approaches: Sign extend the partial products to deal with input a being negative and add a "complementer" to negate the last set of partial products if b is negative. Convert the two inputs to sign-magnitude notation, multiply unsigned numbers, and convert the result back to 2's complement. Compare the cost and performance (delay) of the two approaches. Select the approach that gives the lowest cost and show its design in terms of basic components (gates, adders, etc.) 2's complement multiplier, implementation. Write Verilog code for your 2's complement multiplier from Exercise 10.50 and demonstrate its correct operation by simulating it on representative test cases.

Explanation / Answer

Verilog code for 2's complement multiplier.

module tb();

// decaring multiplicand and multiplier

     reg signed [7:0] mulcan;

     reg signed [7:0]   mulplier;

     wire signed   [15:0] result;

// 2's complement

   initial

         begin

               // -80 x -32

               mulcan = 8'b10110000;

               mulplier = 8'b11100000;

               // 80 x -32

               #100000

               mulcan = 8'b01010000;

               mulplier = 8'b11100000;

               // -80 x 32

               #100000

               mulcan = 8'b10110000;

               mulplier = 8'b00100000

               // 80 x 32

               #100000

              mulcan = 8'b01010000;

              mulplier = 8'b00100000;

              #100000

              mulcan = 8'b00000000;

              mulplier = 8'b00000000;

end

// Multiplication of multiplicand and multiplier

assign result = mulcand * mulplier;

endmodule

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote