Join 36000+ teachers and students using TTIO.
Decimal is the number system we are used to working with and is base 10, with 10 digits from 0 to 9. Binary is a base 2 number system with just two digits - 0 and 1.
Binary to Decimal game: Play it here
Take the number 11 (Decimal). How do we convert it into Binary?
Step 1:
Write out the following grid of numbers. Note that it starts (from the right hand side, with 1, and then each number is doubled)
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Step 2:
Consider which numbers in the grid would add up to 11. In this case 8 + 2 + 1. Put a 1 under each of those numbers and a zero in every other cell.
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 |
Step 3:
Copy out the binary sequence. The below binary sequence is 11
0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 |
If you have coded before and even if you haven't, you may want to have a go at this decimal to binary conversion challenge (in Python). Click through to the last slide for the video demonstration. You will need to have some understanding of the MOD (%) and DIV (//) operators in Python as well as loops and the creation of variables and functions.
www.teachyourselfpython.com