Question: 1 :Multiplier Test 1 1 / 1 At 2 ns: F is 0 0 0 0 0 0 0 0 ( Passed ) with A

1:Multiplier Test 1
1/1
At 2ns: F is
00000000(Passed)
with A =0, B =0
2:Multiplier Test 2
0/1
At 2ns
Inputs
A =6, B =10
Tested signal: F
Your value: 00000000
Expected value: 00111100(Failed)
3:Multiplier Test 3
0/1
At 2ns
Inputs
A =2, B =13
Tested signal: F
Your value: 00000000
Expected value: 00011010(Failed)
4:Multiplier Test 4
0/1
At 2ns
Inputs
A =8, B =11
Tested signal: F
Your value: 00000000
Expected value: 01011000(Failed)
5:Multiplier Test 5
0/1
At 2ns
Inputs
A =11, B =11
Tested signal: F
Your value: 00000000
Expected value: 01111001(Failed)
Can you help me trouble shoot why all i get is Zeros
Description
In Verilog create a 4-bit array-style multiplier. The multiplier will take in two four bit numbers and outputs a 8-bit product.
Signals
Inputs: [3:0] A, and B;
Outputs: [7:0] F
module multiplier(A, B, F);
input [3:0] A;
input [3:0] B;
output [7:0] F;
wire [7:0] partial_products [3:0];
wire [7:0] p0, p1, p2, p3;
assign p0={4'b0, B[0]} & {4'b0, A};
assign p1={4'b0, B[1]} & {3'b0, A,1'b0};
assign p2={4'b0, B[2]} & {2'b0, A,2'b0};
assign p3={4'b0, B[3]} & {1'b0, A,3'b0};
full_adder fa0(.A(p0[0]),.B(p1[0]),.C(p2[0]),.S(p3[0]),.Cout(F[0]));
full_adder fa1(.A(p0[1]),.B(p1[1]),.C(p2[1]),.S(p3[1]),.Cout(F[1]));
full_adder fa2(.A(p0[2]),.B(p1[2]),.C(p2[2]),.S(p3[2]),.Cout(F[2]));
full_adder fa3(.A(p0[3]),.B(p1[3]),.C(p2[3]),.S(p3[3]),.Cout(F[3]));
full_adder fa4(.A(p0[4]),.B(p1[4]),.C(p2[4]),.S(p3[4]),.Cout(F[4]));
full_adder fa5(.A(p0[5]),.B(p1[5]),.C(p2[5]),.S(p3[5]),.Cout(F[5]));
full_adder fa6(.A(p0[6]),.B(p1[6]),.C(p2[6]),.S(p3[6]),.Cout(F[6]));
full_adder fa7(.A(p0[7]),.B(p1[7]),.C(p2[7]),.S(p3[7]),.Cout(F[7]));
endmodule
module full_adder(A, B, C, S, Cout);
input A, B, C;
output S, Cout;
assign Cout =(B & C)|(A & C)|(A & B);
assign S = A ^ B ^ C;
endmodule
module top(A, B, F);
input [3:0] A, B;
output [7:0] F;
multiplier mul(.A(A),.B(B),.F(F));
endmodule

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!