numeric

Definition

Offset Binary

Offset Binary is a method for signed number representation where a signed number n is represented by the bit pattern corresponding to the unsigned number , being the biasing value or offset.

1

Symmetry

There are two types of offset binary: symmetric and asymmetric offset.

Symmetric Offset

The Symmetric offset adds a single constant excess to all numbers:

The goal is to represent negative numbers as positive numbers. They don’t need to be stored as signed numbers. Thus, all numbers are representable by an excess if .

The excess is derived from the smallest representable negative number:

Example:

Actual ValueCalculationOffset Binary CodeBinary Representation
-4-4 + 4 = 00000
-3-3 + 4 = 11001
-2-2 + 4 = 22010
-1-1 + 4 = 33011
00 + 4 = 44100
11 + 4 = 55101
22 + 4 = 66110
33 + 4 = 77111

For an unsigned bit pattern of bit length , the excess is always:

Asymmetric Offset


Arithmetic

Addition

Let b the excess, and and , adding these two excess-numbers is equal to:

Wrong:

Correct:

Footnotes

  1. Offset binary - Wikipedia