Ahmad
Ahmad

Reputation: 1

How to represent Real Numbers in Binary in VHDL

I want to know how I can represent real numbers (including floating points) in binary format in VHDL.

For example: represent +0.5 or -0.013 in binary

I want to program a function in VHDL that can take an input (for eg. 0.5) and increment it by 0.15 until it reaches 10. All the numbers need to be represented in binary form.

I also need to know how to convert the binary numbers back into their real equivalent (decimal)

Upvotes: 0

Views: 3157

Answers (1)

user1818839
user1818839

Reputation:

Floating point packages for VHDL are here - http://www.vhdl.org/fphdl/

But the resolution and range you have decided on with your 12-bit FP format could be accommodated (more simply and with greater accuracy) in a 17-bit fixed point number (scaled integer) so I would suggest that instead.

Upvotes: 1

Related Questions