How to convert Real to Rational in VHDL

Status
Not open for further replies.
thanks tariq786..actually i try to convet real to rational i.e 0.390625 to 25/64 in VHDL.please give me some ideas.

Thanks in advandce.
 

i would say represent 0.390625 in binary

in binary it is 0.011001

Now look at the bits to the right of the point. It is 011001 which is 25 in decimal

Now look at the binary point and count the number of shifts that you need to make to go from 0.11001 to 011001.0. You need 6 right shifts which mean you divide by 64

So that is all.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…