I am currently designing a fast fourier transform (FFT) chip. Meanwhile, I have across with decimal value while doing the calculation on FFT. Example :
x(1) = a - 0.707c + 0.707d
How can i represent the value 0.707 in verilog coding?
real delta;//define a real variable
initial
begin
delta=707e-3; //delta assigned in scientific notation.
delta=0.707; //delat assigned a value 0.707
end
i think you should transfer the decimal to binary.
x(1) = a - 0.707c + 0.707d
example if your define a reg [15:0] para to keep 0.707
0.707 =>65536*0.707 =46333.952=46334.
when you finished your compute , you can right shift 16 bit
But this coding below is non-synthesizeable. I think this coding is used for testbench.
Correct me if im wrong.
real delta;//define a real variable
initial
begin
delta=707e-3; //delta assigned in scientific notation.
delta=0.707; //delat assigned a value 0.707
end