You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.
This is required to support fixed point formats with value ranges like [-0.5, 0.5), e.g.
Q-1.16 on 16 bits:
0x8000 -> -0.5 (32768/2^17)
0x7FFF -> 0.499984
"For a given Qm.n format, using an m+n bit signed integer container with n fractional bits..."
m can also be negative if one want to represents small numbers. In my examples I did not include the sign bit in the m value, after adjusting to match the wikipedia samples it would be:
Q0.16: m = 0; n = 16 ; container m+n (0 + 16) -> 16bit; range [-(2^(0-1), 2^(0-1)- 2^-16]; resolution 2^-16
Q-1.17: m = -1; n = 17 ; container m+n (-1 + 17) -> 16bit; range [-(2^(0-2), 2^(0-2)- 2^-17]; resolution 2^-17
Similar examples can be created for 32 bit containers. The issue is about support for fixed point parameters where the resolution is being increased by limiting the range of representable values.
For example, using 16bit containers for brevity:
Q16.0, range [-32768, 32767), resolution 1 (degenerative case)
...
Q2.14, range [ -2, 2), resolution 2^-14
Q1.15, range [ -1, 1), resolution 2^-15
Q0.16, range [-0.5, 0.5), resolution 2^-16
Q-1.17, range [-0.25, 0.25), resolution 2^-17
Q-2.18, range [-0.125, 0.125), resolution 2^-18
...
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This is required to support fixed point formats with value ranges like [-0.5, 0.5), e.g.
Q-1.16 on 16 bits:
0x8000 -> -0.5 (32768/2^17)
0x7FFF -> 0.499984
Q-2.17 on 16 bits:
0x8000 -> -0.25 (32768/2^17)
0x7FFF -> 0.249992
For those formats number of integer bits needs to be set to negative value.
The text was updated successfully, but these errors were encountered: