Excess Notation The other way to represent Integers

  • Slides: 18
Download presentation
Excess Notation The other way to represent Integers.

Excess Notation The other way to represent Integers.

Excess Notation (examples are in 8 bits to save space) n Fixed length notation

Excess Notation (examples are in 8 bits to save space) n Fixed length notation system. n Uses 0 to represent negative values. The The largest non-negative value: smallest non-negative value: largest negative value is: smallest negative value is: 1111 10000000 01111111 0000

Excess Notation Consider the 8 patterns in 3 bits: 111 110 101 100 011

Excess Notation Consider the 8 patterns in 3 bits: 111 110 101 100 011 010 001 000

Excess Notation Interpreted as Natural Numbers: 111 110 101 100 011 010 001 000

Excess Notation Interpreted as Natural Numbers: 111 110 101 100 011 010 001 000 7 6 5 4 3 2 1 0

Excess Notation Interpreted as Integers in 2’s Complement: 111 110 101 100 011 010

Excess Notation Interpreted as Integers in 2’s Complement: 111 110 101 100 011 010 001 000 -1 -2 -3 -4 3 2 1 0

Excess Notation Interpreted as Integers in Excess Notation: 111 110 101 100 011 010

Excess Notation Interpreted as Integers in Excess Notation: 111 110 101 100 011 010 001 000 3 2 1 0 -1 -2 -3 -4

Excess Notation Three different Interpretations: 111 110 101 100 011 010 001 000 7

Excess Notation Three different Interpretations: 111 110 101 100 011 010 001 000 7 6 5 4 3 2 1 0 -1 -2 -3 -4

Excess Notation (examples are in 8 bits to save space) To better understand how

Excess Notation (examples are in 8 bits to save space) To better understand how binary patterns unpack under the 3 notations, let’s look at an example. Consider the pattern 10111001 Show the value represented if the pattern is: q q q an unsigned integer an integer, in 2’s Complement Notation an integer, in Excess Notation

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) has

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) has 2 parts:

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) has

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) has 2 parts: 1. the MSB

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) has

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) has 2 parts: 1. the MSB 2. the rest

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) has

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) has 2 parts: 1. the MSB 2. the rest Let’s look at the “rest”: 0111001

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) has

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) has 2 parts: 1. the MSB 2. the rest 0111001 represents the Natural number 32 + 16 + 8 + 1 = 57

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) is,

Excess Notation (examples are in 8 bits to save space) The pattern (10111001) is, therefore, 57 greater than 10000000 – regardless of the meaning of the MSB.

Excess Notation (examples are in 8 bits to save space) As a Natural number,

Excess Notation (examples are in 8 bits to save space) As a Natural number, 10000000 is 128

Excess Notation (examples are in 8 bits to save space) As a Natural number,

Excess Notation (examples are in 8 bits to save space) As a Natural number, 10000000 is In 2’s Complement, 10000000 is the smallest, negative value… 128 -128

Excess Notation (examples are in 8 bits to save space) As a Natural number,

Excess Notation (examples are in 8 bits to save space) As a Natural number, 10000000 is In 2’s Complement, 10000000 is the smallest, negative value… In Excess Notation, 10000000 is the smallest, non-negative value… 128 -128 0

Excess Notation (examples are in 8 bits to save space) So the pattern 10111001

Excess Notation (examples are in 8 bits to save space) So the pattern 10111001 is 57 greater than: 128 if it’s natural (57+128=185) -128 if it’s 2’s Complement (57 -128=-71) 0 if it’s Excess (57+ 0= 57)