Download presentation
Presentation is loading. Please wait.
1
1 4. Computer Maths and Logic 4.1 Number Systems
2
4.1.1 Calculation
3
3 Addition In binary, 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 carry 1, or 10 2 Note that these are the same rules as in decimal.
4
4 Addition In decimal, 7 + 5 = 2 carry 1, or 12 When doing addition, you always “carry” the overflow left i.e. add 1 into the column on the left.
5
5 Addition Remember hexadecimal uses 0 1 2 3 4 5 6 7 8 9 A B C D E F before overflowing In hexadecimal, 7 + 5 = C (no need to carry) 9 + A = 3 carry 1, or 13 16 C + E = A carry 1, or 1A 16
6
6 Subtraction Subtraction involves “borrowing” from the left column. If nothing is available, the answer is negative. In decimal, 13 - 9 = -6, with a borrow of 10 = -6 + 10 = 4
7
7 Subtraction In binary, 0 - 0 = 0 1 - 1 = 0 1 - 0 = 1 10 - 1 = -1 borrow 10, or 1 Of course if the last example were 0 – 1, the answer would be -1.
8
8 Subtraction In hexadecimal, 9 - 3 = 6 D - 5 = 8 14 16 - 8 = -4 borrow 10 16, = C 10 16 - B = 5
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.