Chapter 6 Digital Arithmetic: Operations and Circuits
Chapter 6 Digital Arithmetic: Operations and Circuits
Chapter 6 Digital Arithmetic: Operations and Circuits
00 0
1 0 1
1 1 10 0 carry of 1 into next position
1 1 1 11 1 carry of 1 into next position
ex: 5 + (-5) = 0
0 0 0 0 0 1 0 1 ( 5)
+ 1 0 0 0 0 1 0 1 (-5)
_____________________
1 0 0 0 1 0 1 0 (-10)
1’s complement system
1 0 1 1 0 1 (45)
+ 0 1 0 0 1 0 (-45)
____________________
1 1 1 1 1 1
+9 0 1001 (augend)
+4 0 0100 (addend)
0 1101 (sum = +13)
Sign bits
Addition, cont.
+9 0 1001 (augend)
-4 1 1100 (addend)
1 0 0101
Sign bits
-9 10111
+4 00100
11011 (sum = -5)
-9 10111
-4 11100
1 10011
Sign bit
-9 10111
+9 01001
0 100000
0010 0010.1
11
1001 100 1010.0
011 100
0011 100
11 100
0 0
• Hex Addition
– Add the two hex digits in decimal, mentally
inserting the decimal equivalent for those digits
larger than 9.
– If the sum is 15 or less, it can be directly
expressed as a hex digit.
– If the sum is greater than or equal to 16,
subtract 16 and carry a 1 to the next digit
position.
• Examples
– Add the hex numbers 58 and 24
– Add the hex numbers 58 and 4B
– Add 3AF and 23C
Hex subtraction
• How to get the 2’s-complement of a hex number?
• Convert to binary, take the 2’s complement of the binary equivalent,
and then convert back to hex.
73A
8C6
• A quicker procedure: subtract each hex digit from F;
then add 1.
F F F
-7
8
-3
C
-A
5
} Subtract each digit from F
+1 Add 1
• Add 67F+2A4
• Subtract 67F-2A4
• Which of the following hex numbers represent
positive values: 2F, 77EC, C000, 6D, FFFF?
6-9 Arithmetic Circuits
6-10 Parallel binary adder
Parallel adder
Review Questions
• [A]=0000
• [M]-> [B]
• [S]*->[A]
• [M]->[B]
• [S]->[A]
Review Questions
X=S4+S3(S2+S1)
A BCD adder
Example
• CLEAR
• ADD
• SUBTRACT
• XOR
• OR
• AND
• PRESET
Example