Digital Electronics and Computer Organization Digital Design
Digital Electronics and Computer Organization Digital Design
Digital Electronics and Computer Organization Digital Design
Digital Design
EEE F215/ECE F215/INSTR F215/CS F215
Number systems
For Base - r system (anan-1…. a1a0. a-1a-2..a-m)r
(B2.4)16
CKV
Number conversions
Other conversions
1110001010101
1 6 1 2 5
(1110001010101)2 (16125)8
CKV
Number conversions
Other conversions
6373
6 3 7 3
(6373)8 (110011111011)2
CKV
Number conversions
Other conversions
Binary to Hexadecimal Hexa: base 16 digits used 0-F
1110001010101
1 C 5 5
(1110001010101)2 (1C55)16
More conversions in detail in Saturdays Tutorial
CKV
Complements
Used to simplify Subtraction
Complements
Radix complement
Given a number N in base r having n digits r’s complement is defined as
(rn-N)
In case of decimal it is called 10’s complement
Complements
Addition 7+3
7 0111
3 0011
1 1 1
0 1 1 1
0 0 1 1
1 0 1 0
1010 (10)10
CKV
Complements
Subtraction using complement 7-3
7 0111 0111
3 0011 2’s complement 1101
1 1 1 1
0 1 1 1
1 1 0 1
0 1 0 0
Carry generated
0100 (4)10
CKV
Complements
Subtraction using complement 3-7
3 0011 0011
7 0111 2’s complement 1001
0 0 1 1
0 0 1 1
1 0 0 1
1 1 0 0
Carry not generated
1100 ?
CKV
Complements
If final Carry not generated 1100
Answer is = -(2’s complement of result)
-(2’s complement of 1100)
-(0100)
-(4)
Signed numbers
Need for notation to represent negative values
MSB 1 indicates negative
MSB 0 indicates positive
Signed numbers
4-bit numbers Signed Signed 1’s Signed 2’s
magnitude complement complement
0000 +0 +0 +0
0001 +1 +1 +1
0010 +2 +2 +2
0011 +3 +3 +3
0100 +4 +4 +4
0101 +5 +5 +5
0110 +6 +6 +6
0111 +7 +7 +7
If MSB 0 same value as binary
CKV
Signed numbers
4-bit numbers Signed
magnitude
1000 -0
1001 -1
1010 -2 The first bit indicates sign rest
3-bits indicates magnitude
1011 -3
1100 -4 Two representations for 0
1101 -5
1110 -6
1111 -7
CKV
Signed numbers
Take 1’s complement Signed 1’s
complement
1000 0111 -7
1001 0110 -6
1010 0101 -5
1011 0100 -4
1100 0011 -3
1101 0010 -2
1110 0001 -1
1111 0000 -0
Two representations for zero
CKV
Signed numbers
Take 2’s complement Signed 2’s
complement
1000 1000 -8
1001 0111 -7
1010 0110 -6
1011 0101 -5
1100 0100 -4
1101 0011 -3
1110 0010 -2
1111 0001 -1
CKV
Signed numbers
4-bit unsigned number has range 0 to 15
4+8 4 0100
8 1000
1100 Is this expected Result ?
Other codes
Other decimal codes: 2421 code, Excess-3 code, 84-2-1 code
Reading assignment
CKV
Next Class
Boolean Algebra