Question

In: Electrical Engineering

please i need the code for an 8 bit by 8 bit multiplier in verilog ....

please i need the code for an 8 bit by 8 bit multiplier in verilog . ( pls the code should be clearly written and BOLD)

Solutions

Expert Solution

module multiplicat(a,b,result);
input [7:0] a;
input [7:0] b;
output [15:0] result;
wire [15:0] a1,a2,a3,a4,a5,a6,a7,a8;
assign a1=(b[0]==1’b1) ? {8’b00000000 , a } : 16’b0000000000000000;
assign a2=(b[1]==1’b1) ? {7’b0000000 , a , 1’b0} : 16’b0000000000000000;
assign a3=(b[2]==1’b1) ? {6’b000000 , a , 2’b00} : 16’b0000000000000000;
assign a4=(b[3]==1’b1) ? {5’b00000 , a , 3’b000} : 16’b0000000000000000;
assign a5=(b[4]==1’b1) ? {4’b0000 , a , 4’b0000} : 16’b0000000000000000;
assign a6=(b[5]==1’b1) ? {3’b000 , a , 5’b00000} : 16’b0000000000000000;
assign a7=(b[6]==1’b1) ? {2’b00 , a , 6’b000000} : 16’b0000000000000000;
assign a8=(b[7]==1’b1) ? {1’b0 , a , 7’b0000000} : 16’b0000000000000000;
assign result = a1+a2+a3+a4+a5+a6+a7+a8;
endmodule;

This can be done also by booths algorithm but this is general add and shift method to obtain the 8×8 multiplier

We have taken 2 inputs of 8 bit each and considered an intermediate signal with wire as described and then with the help of assign we just got the multiplied ones

Just shifted them and then added them


Related Solutions

Write in verilog, code to implement a 6 bit multiplier. Cascade a 1 bit multiplier to...
Write in verilog, code to implement a 6 bit multiplier. Cascade a 1 bit multiplier to implement this.
write a verilog code for a 4-bit multiplier by using 4 bit full adder
write a verilog code for a 4-bit multiplier by using 4 bit full adder
Design a 4-bit multiplier by using 4 bit full adder and write a verilog code.
Design a 4-bit multiplier by using 4 bit full adder and write a verilog code.
Design an 8-bit adder. Show Verilog code and testbench.
Design an 8-bit adder. Show Verilog code and testbench.
Write a verilog code for 5 to 8 multiplier using fourbit adder
Write a verilog code for 5 to 8 multiplier using fourbit adder
I am trying to create an 8-bit random number generator in verilog code using a mux,...
I am trying to create an 8-bit random number generator in verilog code using a mux, a d flip flop and a LFSR not sure what I am doing wrong but need some help with getting it working properly any help would be greatly appreciated. here is what I have so far: module RNG #(parameter size=8)(output [7:0]SO,output [7:0] RN,input clk,rst,input[size-1:0]seed,input L);    wire [7:0] Sin=SO[7]^SO[5]^SO[4]^SO[3];    ffw F1 (SO,clk,rst,Sin);    MUX M1 (Sin,seed,{SO[size-2:0],next},L);    xor X1 (next,SO[6],SO[7]);    assign RN=next;...
Design an 8-bit adder. Show the truth table, logic circuit, and Verilog code.
Design an 8-bit adder. Show the truth table, logic circuit, and Verilog code.
Design an 8-bit adder. Show the truth table, logic circuit, and Verilog code.
Design an 8-bit adder. Show the truth table, logic circuit, and Verilog code.
I need the full code. No hardcoding. Code a function to convert any 8-bit number from...
I need the full code. No hardcoding. Code a function to convert any 8-bit number from binary to hexadecimal. You are not allowed to use libraries that automate this process. a) Test your function with the following binary numbers. 11110000 and 00100010 The binary number will be provided by the user and you must read it using fgets. b) Draw a flowchart of your code. You can draw it by hand but it must be readable, and respect the flowchart...
Write a Verilog code to implement 16 bit LFSR
Write a Verilog code to implement 16 bit LFSR
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT