magnanimus
Newbie level 3
- Joined
- Apr 27, 2010
- Messages
- 3
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- uttarpradesh
- Activity points
- 1,312
hey
I am a student of B-tech . I am doing a project in which i have to use a parallel multiplier. I have to multiply two matrices of 8x8 size and each element is a 16 bit fractional number represented in binary format. I wrote a code in matlab and verilog both but when I matched the result of verilog with matlab, I found big difference between the two results.
Can someone help me getting precision in multiplication in verilog ?????
:?: :?:
this is the module that i am using in verilog code for multiplying a row and a column of two matrices ..........
module multiply(p,d0,d1,d2,d3,d4,d5,d6,d7,b0,b1,b2,b3,b4,b5,b6,b7);
output reg [31:0] p=0;
input [15:0] d0,d1,d2,d3,d4,d5,d6,d7;
input [15:0] b0,b1,b2,b3,b4,b5,b6,b7;
always @(d0,d1,d2,d3,d4,d5,d6,d7,b0,b1,b2,b3,b4,b5,b6,b7)
begin
p=d0* b0 + d1* b1 + d2* b2 + d3* b3 + d4* b4 + d5* b5 + d6* b6 + d7* b7;
end
endmodule
I have a separate top module for instantiating this module
As the numbers are fractional so i am having trouble in handling that.
If anyone knows anything about fractional number multiplication in matlab then please give your wise suggestion to me.....
I am a student of B-tech . I am doing a project in which i have to use a parallel multiplier. I have to multiply two matrices of 8x8 size and each element is a 16 bit fractional number represented in binary format. I wrote a code in matlab and verilog both but when I matched the result of verilog with matlab, I found big difference between the two results.
Can someone help me getting precision in multiplication in verilog ?????
:?: :?:
this is the module that i am using in verilog code for multiplying a row and a column of two matrices ..........
module multiply(p,d0,d1,d2,d3,d4,d5,d6,d7,b0,b1,b2,b3,b4,b5,b6,b7);
output reg [31:0] p=0;
input [15:0] d0,d1,d2,d3,d4,d5,d6,d7;
input [15:0] b0,b1,b2,b3,b4,b5,b6,b7;
always @(d0,d1,d2,d3,d4,d5,d6,d7,b0,b1,b2,b3,b4,b5,b6,b7)
begin
p=d0* b0 + d1* b1 + d2* b2 + d3* b3 + d4* b4 + d5* b5 + d6* b6 + d7* b7;
end
endmodule
I have a separate top module for instantiating this module
As the numbers are fractional so i am having trouble in handling that.
If anyone knows anything about fractional number multiplication in matlab then please give your wise suggestion to me.....