4. Basic Unsigned Numeric Encoding


In order to represent and manipulate numeric values within the circuits of a computer system it is necessary to use some coding scheme whereby each number can be represented or "encoded" by the pattern of electrically on/off states in a collection of circuits. For a computer, the simplest and fastest scheme for encoding numeric values is the Unsigned Binary Encoding scheme.


Binary Encoding

Number of Circuits Required for Encoding



The Decimal Odometer Analogy

Unsigned Binary Encoding

pattern in word: off

(0)

on

(1)

off

(0)

off

(0)

on

(1)

on

(1)

off

(0)

off

(0)

weight 128 64 32 16 8 4 2 1

the value of this encoded word (01001100) would be 64 + 8 + 4 = 76

weight 128 64 32 16 8 4 2 1
pattern 1 0 0 0 1 0 0 1


Multi-Column Addition

3-Bit Addition: The 8 Possible Input Combinations and Their Outputs
bit values being added

 
(carry in from previous column)

0
0

0

0
0

1

0
1

0

0
1

1

1
0

0

1
0

1

1
1

0

1
1

1

column result 0 1 1 0 1 0 0 1
carry to next column 0 0 0 1 0 1 1 1

Examples:
(4-bit "words")



Multi-Column Subtraction

3-Bit Subtraction: The 8 Possible Input Combinations and Their Outputs
"Subtrahend"
minus "minuend"

minus borrow from previous

0
0

0

0
0

1

0
1

0

0
1

1

1
0

0

1
0

1

1
1

0

1
1

1

column result 0 1 1 0 1 0 0 1
borrow from next column 0 1 1 1 0 0 0 1

Examples:
(4-bit "words")


The "Carry" Flag



The "Zero" Flag



Multiplication - Double Word Result

Example:
(4-bit "words"
8-bit "double-word" result)



Division - 2 Results