Computer Science LESSON ON Number Base Subtraction and
Computer Science LESSON ON Number Base Subtraction and Simple Equations John Owen, Rockport Fulton HS 1
Objective In this lesson you’ll learn how to do subtraction and how to solve simple equations involving Base 2, 8, and 16. n Again, it is essentially the same concept as Base 10, just in a different base! n John Owen, Rockport Fulton HS 2
Review Base Ten Subtraction In Base 10 subtraction, you use a very simple process. n Look at this problem: 48 -37 = 11 n John Owen, Rockport Fulton HS 3
Review Base Ten Subtraction 48 -37 = 11 n Each column is subtracted to get an answer of 11…pretty easy, huh? John Owen, Rockport Fulton HS 4
Subtraction, Base 10 n n Now look at this problem: 63 -37 In this problem, you need to borrow. John Owen, Rockport Fulton HS 5
Subtraction, Base 10 513 63 -37 n Borrowing means taking a value from the next column and adding it to the column you need. John Owen, Rockport Fulton HS 6
Subtraction, Base 10 513 63 -37 n In this case, borrow from the 6, which becomes five, and add 10 to the 3, making 13. John Owen, Rockport Fulton HS 7
Subtraction, Base 10 513 63 -37 n When you borrow 1 from one column, it becomes the value of the base in the next column, or 10 in this case. John Owen, Rockport Fulton HS 8
Subtraction, Base 10 513 63 -37 26 n Then you subtract the two columns with a result of 26. John Owen, Rockport Fulton HS 9
Subtraction, Base 8 n n Now let’s try base eight: 63 -37 Again, in this problem, you need to borrow. John Owen, Rockport Fulton HS 10
Subtraction, Base 8 511 63 -37 n Borrow from the 6, which becomes five, and add 8 to the 3, making 11! John Owen, Rockport Fulton HS 11
Subtraction, Base 8 511 63 -37 n When you borrow 1 from a column, it becomes the value of the base in the next column, or 8 in this case. John Owen, Rockport Fulton HS 12
Subtraction, Base 8 511 63 -37 24 n Then you subtract the two columns with a result of 24, base 8. John Owen, Rockport Fulton HS 13
Subtraction, Base 16 Now base 16: 519 63 -37 n Again, we borrow from the 6, which becomes five, and add 16 to the 3, making 19! John Owen, Rockport Fulton HS 14
Subtraction, Base 16 519 63 -37 n When you borrow 1 from a column, it becomes the value of the base in the next column, or 16 in this case. John Owen, Rockport Fulton HS 15
Subtraction, Base 16 519 63 -37 2 C n In the ones column, 19 minus 7 is 12, which is C in base sixteen, with 2 in the second column. John Owen, Rockport Fulton HS 16
Subtraction, Base 16 Here’s another example in base 16 D 6 -3 B n How is this one solved? Try it. John Owen, Rockport Fulton HS 17
Subtraction, Base 16 C 22 D 6 -3 B n We must borrow from D, which becomes C, then add 16 to 6, which makes 22. John Owen, Rockport Fulton HS 18
Subtraction, Base 16 C 22 D 6 -3 B 9 B n n n 22 minus B (11) is B. C minus 3 is 9. Answer is 9 B John Owen, Rockport Fulton HS 19
Subtraction, Base 2 Now base 2: 11 - 1 10 n This one is easy…answer is 10 John Owen, Rockport Fulton HS 20
Subtraction, Base 2 Another in base 2: 02 110 - 1 n Here we need to borrow from the twos place… John Owen, Rockport Fulton HS 21
Subtraction, Base 2 02 110 - 1 101 Subtract to get the answer. John Owen, Rockport Fulton HS 22
Subtraction, Base 2 Still another in base 2: 02 110 - 11 1 Now borrow again… John Owen, Rockport Fulton HS 23
Subtraction, Base 2 2 100 - 11 11 Final answer is 11, base 2 John Owen, Rockport Fulton HS 24
Simple Equations Here an equation to solve (base 10): x + 6 = 14 John Owen, Rockport Fulton HS 25
Simple Equations Solution…subtract 6 from both sides x + 6 = 14 -6 -6 x = 8 John Owen, Rockport Fulton HS 26
Simple Equations Now do it in base 8: x + 6 = 14 John Owen, Rockport Fulton HS 27
Simple Equations Solution…subtract 6 from both sides x + 6 = 14 -6 -6 x = ? John Owen, Rockport Fulton HS 28
Simple Equations Answer is 6, base 8 12 x + 6 = 14 -6 -6 x = 6 John Owen, Rockport Fulton HS 29
Simple Equations Here’s an equation in base sixteen (remember, A and F are NOT variables, but base sixteen values): x + 2 A = F 3 John Owen, Rockport Fulton HS 30
Simple Equations Solution? x + 2 A = F 3 John Owen, Rockport Fulton HS 31
Simple Equations Subtract 2 A from both sides: E 19 x + 2 A = F 3 - 2 A -2 A x = C 9 John Owen, Rockport Fulton HS 32
Exercises n 1. 2. 3. 4. 5. 6. Now try these exercises 12 - 1 2 = 78 - 6 8 = F 16 - A 16 = 158 - 68 = 4916 - 2 B 16 = CC 16 - AD 16 = John Owen, Rockport Fulton HS 33
Exercises 7. 8. 9. 10. 11. 12. 13. 738 - 348 = 3 E 16 – 2 F 16 = 1012 - 102 = 11012 - 112 = 10102 - 1112 = 7168 - 3648 = 7768 + 3378 = John Owen, Rockport Fulton HS 34
Exercises Now let’s mix it up a bit! 14. AE 16 + 768 = _____8 15. 2348 + 110110112 = _____16 16. 101102 - F 16 + 768 = _____10 17. 38 + 3910 - 1101012 = _____16 18. 11112 - F 16 + 1510 = _____16 John Owen, Rockport Fulton HS 35
Exercises And finally, some equations 19. x 16 + 7616 = AB 16 20. x 2 - 10112 = 1012 21. x 8 + 568 = 728 22. x 2 + 2510 = 1 F 16 23. x 8 + 3748 - 65568 = BAD 16 24. 378 + X 16 = 110111102 John Owen, Rockport Fulton HS 36
ANSWERS (JUMBLED) 0 1 5 7 11 11 14 19 35 37 69 110 177 332 354 1010 1335 10000 14037 1 E 1 F BF F F John Owen, Rockport Fulton HS 37
- Slides: 37