Electrical – Is it possible to show fixed point numbers as base 10 in modelsim wave

binaryfixed-pointmodelsimvhdl

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?

Best Answer

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.