D
Davy
Guest
Hi all,
How can I multiply a signed operand with a unsigned operand?
Code:
input [7:0] a;
input signed [7:0] b;
output signed [15:0] z;
Code:
assign z = $signed({1'b0,a}) * b;
or
Code:
assign z = $signed(a) * b;
And why?
Thanks!
Davy
How can I multiply a signed operand with a unsigned operand?
Code:
input [7:0] a;
input signed [7:0] b;
output signed [15:0] z;
Code:
assign z = $signed({1'b0,a}) * b;
or
Code:
assign z = $signed(a) * b;
And why?
Thanks!
Davy