Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Biased Notation?

I have read: "Like an unsigned int, but offset by −(2^(n−1) − 1), where n is the number of bits in the numeral. Aside: Technically we could choose any bias we please, but the choice presented here is extraordinarily common." - http://inst.eecs.berkeley.edu/~cs61c/sp14/disc/00/Disc0.pdf

However, I don't get what the point is. Can someone explain this to me with examples? Also, when should I use it, given other options like one's compliment, sign and mag, and two's compliment?

like image 810
Jobs Avatar asked Mar 28 '26 05:03

Jobs


1 Answers

Biased notation is a way of storing a range of values that doesn't start with zero.

Put simply, you take an existing representation that goes from zero to N, and then add a bias B to each number so it now goes from B to N+B.

  • Floating-point exponents are stored with a bias to keep the dynamic range of the type "centered" on 1.
  • Excess-three encoding is a technique for simplifying decimal arithmetic using a bias of three.
  • Two's complement notation could be considered as biased notation with a bias of INT_MIN and the most-significant bit flipped.
like image 106
Potatoswatter Avatar answered Mar 29 '26 20:03

Potatoswatter