I am new to verilog and working my way up on a small code for multiplying two fixed point complex numbers, and here is the top module and the testbench I have written for the same but the wave window shows all Z for my inputs, any help will be appreciated
module complex(a,b,c,d,
x,y,
z);
input signed [15:0] a,b,c,d;
output reg signed [31:0] x,y;
output reg signed [63:0]z; //the size is doubled as it will be concatenated
reg signed [31:0] ac,bd,ad,bc;
initial begin
ac=(a*c);
bd=(b*d);
ad=(a*d);
bc=(b*c);
x=ac-bd; //real part of the complex number, real is stored in x reg
y=ad+bc; // imaginary part of the complex number, imaginary is stored in y reg
z={x,y}; // concatenation of real and imaginary, first 32 bits here are for real, of which 16 bits represent fraction, same concept for imaginary part
end
endmodule
// TESTBENCH
module complextb();
reg signed [15:0] a,b,c,d;
wire signed [31:0]x,y;
wire signed [63:0] z; //the size is doubled as it will be concatenated
complex DUT (.a(a),
.b(b),
.c(c),
.d(d),
.x(x),
.y(y),
.z(z));
localparam SF= 2.0**-16.0;
initial begin
a=16'b01011000_01000000;
b=16'b00011001_01000000;
c=16'b01011000_01000000;
d=16'b00010100_01000000;
#10
$display("%f,%f", $itor(x*SF),$itor(y*SF));
end
endmodule