cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
uzmeed
Explorer
Explorer
480 Views
Registered: ‎07-27-2010

reading fixed point fractional number

 Hi

I have made an IP that has some register with values in  Q(m.n) format

while debugging I want to read the decimal number but I am unable to convert it successfully to correct number

Please help to find the way that can translate the number correctly in decimal format or any way that I can make two different registers in verilog one for m and other for n

Best Regards

uzmeed

 

 

 

0 Kudos
4 Replies
nathanx
Moderator
Moderator
384 Views
Registered: ‎08-01-2007

Is the "m" here all the bits of one data or just the integer bits? Is the “n” fractional bits of the data?

0 Kudos
uzmeed
Explorer
Explorer
370 Views
Registered: ‎07-27-2010

Hi @nathanx 

Yes

0 Kudos
joancab
Teacher
Teacher
369 Views
Registered: ‎05-11-2015

Read your Qm.n as integer, cast it to float and divide it by 2^n

0 Kudos
nathanx
Moderator
Moderator
269 Views
Registered: ‎08-01-2007

@uzmeed , does @joancab's reply answer your question? If it does, please accept it as solution?

0 Kudos