Review of the 2s compl code before discussing the Excess 128 code

The mapping of the 8 bits 2s complement code on a circle was as follows:

The value 0 ("origin") is represented by the code 00000000
There are 2 other logical origins possible !!!

The Excess 128 code

The Excess 128 (= 28−1) code uses 10000000 (= 28−1) to represent the value 0:

How to read a code in the Excess 128 encoding

The code 10000001 is 1 more (excess) than the 10000000

Therefore, code 10000001 represents the value 1 (positive 1)

How to read a code in the Excess 128 encoding

The code 01111111 is 1 less (deficient) than the 10000000

Therefore, code 01111111 represents the value −1 (negative 1)

How to detect sign of the number in the Excess 128 encoding

All codes starting with 1 represent positive values (10000000 = positive 0)

All codes starting with 0 represent negative values

The Excess 127 code

The Excess 127 (= 27−1) code uses 01111111 (= 27−1) to represent the value 0:

How to read a code in the Excess 127 encoding

The code 10000000 is 1 more (excess) than the 01111111

Therefore, code 10000000 represents the value 1 (positive 1)

How to read a code in the Excess 127 encoding

The code 01111110 is 1 less (deficient) than the 01111111

Therefore, code 01111110 represents the value −1 (negative 1)

How to detect sign of the number in the Excess 127 encoding

All codes starting with 0 represent negative values (01111111 = negative 0 !)

All codes starting with 1 represent positive values

A future use of the Excess 127 code

Notice that in Excess 127, the code 00000000 represents the value −127:

This is the largest negative value in the (8 bits) Excess 127 code

You will learn later that the exponent in the floating point repr uses the Excess 127 code