| Creator | Mikko Muilu |
| Subject | Math, ICT |
| Length | 45 minutes |
| Pedagogical Approach | Phenomenon-based learning, problem-based learning |
| Competences | Students learn how to use binary numbers in subtraction |
| Grades | Students aged 9-12. |
| Technologies | Pen and paper |
Description:
Computers are made of transistors and they can’t calculate or understand numbers in the very basic level like we do. Computers work with ones and zeros, which can be marked with electrical voltage on or off. No voltage means 0 and voltage on means 1. This is easy enough to understand, but what if we need other numbers or other symbols than just 0’s and 1’s.
In binary code we first decide how many bits we want to use. In 8-bit system we use eight numbers every time we want to express even a simple number.
For example 1 is 00000001 in 8-bit binary.
The first bit from the left is marking plus or minus. If it’s 0 it means it’s a positive integer, if it’s 1, it’s a negative integer.
Here comes the interesting part, it has been agreed that negative numbers are compliments of the positive numbers. This means that if every bit in a number is changed, it becomes a negative number.
For example 4 is 00000100. If we want to create binary number -4, we change every bit in binary of 4. That means that -4 is 11111011 in binary.
This creates a wonderful way to calculate subtractions in binary.
For example 5-4 can be thought to be 5 + (-4), which would be 00000101 + 11111011. We learned to do long addition in the last learning scenario, so we can use that or the binary cards. The result will be 9 bit, so we have to move the leftmost digit to the rightmost place. This might be a bit counterintuitive at first, but it will clear out as students advance.

Take note, that there’s a 9th bit in the answer

This means that our number system has gone a full circle. You can think this as a kilometer counter in a car. There is no more room in the meter, so it has to start from the beginning.

This means the 5-4 subtraction is 00000001 or just 1.
Ex
Exercise 1:
Teachers gives out 3-bit binary numbers for pairs of students and students try to form positive and negative numbers from them. With just 3 bits it is only possible to create numbers from -3 to 3. Students can try to add them together. Students can use binary cards to decode the value of binary numbers.
Discussion:
What was hard? How did the calculation go? How hard would the calculations be if more bits were added?
Exercise 2:
Calculations with 5-bit binary numbers. Students can use binary cards to decode the value of binary numbers. They can check answers via changing the binary numbers to decimal numbers
For example
01001 – 00010
00100 – 00100
01111 – 00001
Discussion:
Computers have basic mathematical operations like addition and subtraction programmed into them. Adding in binary is simple and it is fairly easy to do with basic logic ports in electronics. Subtraction is done with the addition operation and complimenting the numbers.
