Forum Discussion
Altera_Forum
Honored Contributor
15 years agoproblem in floating point multiplication
sir i want to multiply 5.75 * 6.5.for that i use fixed_pkg,but in simulation it takes 5.75 as 6 and 6.5 as 7 and gives 42. ihave attched program with simulation result.plz fix he problem sir.:cry:
2 Replies
- Altera_Forum
Honored Contributor
Also, why are you mixing verilog (for your testbench) and VHDL for your entity?
- Altera_Forum
Honored Contributor
You don't yet understand the concepts of the fixed_pkg. You can't assign values like a = 5.75; The user manual instructs you to use to_sfixed respectively to to_ufixed for float to fixed point conversions.