0

Why unsigned fixed point rational has the range 2^a - 2^-b? Where a represents integer bits, and b represents fractional bits of the given number.

How I can determine the max value, unsigned fixed point rational can give?

1 Answers1

0

The minimum distance representable is defined for the fractional part: 2^-b

The maximum number, will be how much times that minimum distance can be added, that will be 2^nbits-1 times (the amount of numbers that can be represented minus 1 because of 0)

Max range: (2^nbits-1)*2^-b

With some math mangling

nbits=a+b,

(2^nbits-1)*2^-b = 2^(a+b)-1*2^-b=2^a*2^b*2^-b+2^-b=2^a*2^-b

Example:

Q(2,30)

nbits=32

range 0 / 2^2 - 2^-30

minimum distance: 2^-30,

amount of numbers that can be represented: 2^32

xvan
  • 4,554
  • 1
  • 22
  • 37