Integer to real conversion function

ErikAndren picture ErikAndren · May 2, 2012 · Viewed 22.3k times · Source

Is there a common conversion function to convert a integer type object to a real type in VHDL? This is for a testbench so synthesizability is a non-issue.

Answer

Peter Bennett picture Peter Bennett · May 2, 2012

You can convert integer to real as follows:

signal i: integer;
signal R: Real;

...

R <= Real(i);