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.
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