Lessons 5–6 · 2 lessons · B. Boltayev, M. Mahkamov, A. Azamatov, S. Rahmonqulova. Informatics and Information Technologies, Grade 7. Revised and expanded third edition. “O‘zbekiston milliy ensiklopediyasi” State Scientific Publishing House, Tashkent, 2017
5
Calculating in the binary system
Textbook: pp. 29–31
GoalKnows the binary addition, subtraction and multiplication tables, calculates in columns with the carry and borrow rules, and checks the result by counting.
New words
place (position): the place of a digit in a number · razryadcarry: the part of a column sum that goes to the next place on the left · ko‘chirishborrow: taking a unit from the next place on the left when subtracting · qarz olishbinary digit: 0 or 1 · ikkilik raqam
Explanation
Column arithmetic works in all positional systems just as in the decimal system: the places are handled from right to left. In addition, when a column sum reaches or passes the base, the part equal to the base goes to the next place. The binary addition table is very short: 0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, 1 + 1 = 10 (write 0, carry 1). Three ones give 1 + 1 + 1 = 11: write 1, carry 1. In subtraction, when 1 cannot be taken from 0, we “borrow” from the left neighbour: 10 – 1 = 1. The multiplication table: 0 · 0 = 0, 0 · 1 = 0, 1 · 0 = 0, 1 · 1 = 1; in column multiplication, for every digit 1 of the multiplier we write the multiplicand shifted one place further left, then add the rows. To check a result you can count: in the list 0, 1, 10, 11, 100, 101, 110, 111, 1000 … the number 110 stands sixth after 0, so it equals six, and 1000 equals eight.
Worked examples
1011 + 101: from the right: 1 + 1 = 10 (write 0, carry 1); 1 + 0 + 1 = 10 (0, carry 1); 0 + 1 + 1 = 10 (0, carry 1); 1 + 1 (carried) = 10. The result is 10000. Check: 1011 is eleven, 101 is five, and the sum is sixteen.
1001 · 11: write 1001 once in place and once shifted one place left: 1001 + 10010 = 11011. Check: 9 · 3 = 27, and 11011 is twenty-seven.
Class activity
“Binary relay”: in each team pupils take turns to compute one place of a column sum (passing the carry to the next pupil). The fastest team without errors wins.
Practice
1
Add 1101 + 1011 in binary.
11000
2
Subtract 10010 – 111 in binary.
1011
3
Multiply 1010 · 11 in binary.
11110
4
Why is 1 + 1 = 10 in binary, not 2?
Because binary has no digit 2: the number two is written “10” – a zero is written and one is carried to the next place.