Subtraction
Objectives
We would like to :- Review the subtraction algorithm
- Discuss subtraction in binary.
Notes
- Can you subtract 372-134
372 - 134 ----- 2-4 we need to borrow a 1 from the 7 This becomes 12-4 = 8 61 3
72 - 134 ----- 8 6-3 = 3 61 372 - 134 ----- 38 3-1 = 2 61 372 - 134 ----- 238 - But it gets more complex, do 2000 - 1
- We will not look at 22 - 123, yet because we don't have negative numbers.
- We do use the addition table but in reverse
- Perform the barrow if necessary
- Find the first number inside the table.
- Find the second number on top/left
- Find the results on the left/top
- So how do we subtract in binary?
- The same way.
-
101101 - 10111 ---------- 1-1 = 0 101101 - 10111 ---------- 0 0-1 = 1, with a borrow 01 101101 - 10111 ---------- 10 0-1 => 10-1 = 1, with a borrow 1 001 101101 - 10111 ---------- 110 0 - 0= 0 1 001 101101 - 10111 ---------- 0110 0-1 => 10-1 = 1, with a borrow 1 1001101101 - 10111 ---------- 10110