Guest
Hello
I am fairly new to VHDL and have hit a wall in my code.
Basically, I am wanting to convert a 50% duty cycle frequency signal into a period with microsecond units. In VHDL, I perform a 1/frequency operation in order to get the period and then convert it to seconds. I declared the period as a real type. The problem I have is when I end up with a frequency that creates an infinite decimal for the period calculation (Example: 1/3 = 0.333333..... )My simulator cannot handle the infinite decimal.
Is there a way to limit the precision of a REAL type number in VHDL? Should I use a floating point? I appreciate the help!
I am fairly new to VHDL and have hit a wall in my code.
Basically, I am wanting to convert a 50% duty cycle frequency signal into a period with microsecond units. In VHDL, I perform a 1/frequency operation in order to get the period and then convert it to seconds. I declared the period as a real type. The problem I have is when I end up with a frequency that creates an infinite decimal for the period calculation (Example: 1/3 = 0.333333..... )My simulator cannot handle the infinite decimal.
Is there a way to limit the precision of a REAL type number in VHDL? Should I use a floating point? I appreciate the help!