|
Recall: there are 2 types of codes:
|
The 10s complement code is a Mathematical code
|
Overview:
|
|
The 3 digits 10s complement code is a mapping between any 3 digits number and a signed value:
All possible Corresponding 3 digit number Signed value -------------- -------------- 000 <---> ... 001 <---> ... ... ... ... ... 999 <---> ... |
Warning: this mapping will not be a mapping you are "used to"...
This mapping will provide some desirable computational properties !!
I will explain how to obtain the mapping using a "special" odometer - discussed next
Imagine that the odometer of a car operates in the following manner:
|
Question:
|
Question:
|
Answer: 999 + 1 = 000 (because the odometer has 3 digits)
|
Note: the carry is lost because the odometer only has 3 digits !
Question:
|
Question:
|
Answer: 000 − 1 = 999 !!!
|
We will use this property to map the negative values !!!
The 3 digit 10s complement code is a (Mathematical) mapping between all 3 digit number and some set of signed value:
3 digits 10s complement code
3 digit number Signed value
-------------- --------------
000 <---> ...
001 <---> ...
(A subset of signed values)
999 <---> ...
|
This mapping provides a very attractive property
In the next set of slides, we will define this mapping in a piece meal fashion by driving the car and observing the odometer reading
After that, I'll show you the "atractive property" of using the 10s complement code in arithmetic operations