0
\$\begingroup\$

If a person is creating a system using fixed point numbers a decimal point is implied. In this case, if one is going to use the wave window to see the result, it will be beneficial to see the actual value of the fixed point number in radix 10 e.g for unsigned 11.10 it will be 3.5 rather than 14.

I can see that the VHDL has a type called "real" which is part of the language and goes back very far in time. It can be used to contain floating point numbers though I am not sure what its mantissa and exponent ranges are.

In any case, how do I tell ModelSim that a quantity is a fixed point number e.g by telling it about the Qm.n format or otherwise and have it interpreted as such in the wave window?

\$\endgroup\$
  • \$\begingroup\$ I don't know how to do exactly what you want. But how about using combine signals on the two sets of bits to get two separate signals, one for the integer part and another for the factional part. \$\endgroup\$ – rioraxe Nov 25 '16 at 6:10
2
\$\begingroup\$

Define a set of real signals on your design, one for each fixed point number you want to show (or use an array), then create the code on your testbench to convert your fixed point numbers to real format and show them in Modelsim.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.