Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

problem 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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Also, why are you mixing verilog (for your testbench) and VHDL for your entity?