jalal.baba
Junior Member level 1
Hi
I am facing problem with floating point 5.0v core generator.
I want convert float to fix and my configuration is:
floating-point precision : single (32bit)
fix-point precision :int32(32bit)
my code is:
INPUT: 0.9
actual(sim) result:0100000000000000000000000000
expectative result:00111111011001100110011001100110
I am facing problem with floating point 5.0v core generator.
I want convert float to fix and my configuration is:
floating-point precision : single (32bit)
fix-point precision :int32(32bit)
my code is:
HTML:
module top(x);
reg clk;
output [31:0] x;
real a;
initial
begin
clk=1'b0;
forever #30 clk=~clk;
#600 $stop;
end
initial
begin
a=0.9
end
float f2 (
.a(a), // input [31 : 0] a
.clk(clk), // input clk
.result(x) // output [31 : 0] result
);
endmodule
INPUT: 0.9
actual(sim) result:0100000000000000000000000000
expectative result:00111111011001100110011001100110