2.2 Add Sub
2.2 Add Sub
• The quantity and the representation are not the same thing.
• Base 2
• About the lowest we could get, while having a useful experience.
• Only two symbols: 0 and 1. Every binary digit is called bit.
• Example: 11012 = 1 ⋅ 20 + 0 ⋅ 21 + 1 ⋅ 22 + 1 ⋅ 23 = 1310
• Basic examples:
• 02 + 12 = 12
• 12 + 12 = 102
• 112 + 12 = 1002
• 11112 + 12 = 100002
Addition in base 2 (Cont.)
• Larger example: 101102 + 11102 =?
Subtraction in base 2
• Example: 11012 − 1002 =?
Subtraction in base 2 (Cont.)
• Example: 1002 − 12 =?
• Adding numbers.
• Subtracting numbers.
• Enjoy :)