What is binary and how does it work?
Binary is the language of computers. The two numbers 1 and 0 that we see in pictures like on the right represent the two options that we have in an electrical circuit: one (which we use 1 for), and off (which we use 0 for).
When we do mathematics we generally use a system of counting that we call the "decimal system." In this system we use 10 different numbers (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) to represent numbers in lots of 10. In maths we learn that columns have different values which go up by 10 each time. Beginning on the right hand side we start with the 1s columns, then the 10s column, then the 100s etc. When we look at 475 we can break this up into 3 different numbers: 400, 70, and 5 In binary we have similar rules, but instead of using 10 numbers we only use 2 numbers: 0 and 1. Because we only have 2 numbers our column values are doubled each time, instead of multiplied by 10. In binary, beginning on the right hand side we start with the 1s column, then the 2s, then the 4s, 8s, 16s, 32s etc. Notice that we double each time. |
Task One:
Go to this binary converter (https://www.advanced-ict.info/interactive/binary.html) and put in the following binary values:
Task Two:
Using the binary converter again, try to make the following numbers using binary:
Go to this binary converter (https://www.advanced-ict.info/interactive/binary.html) and put in the following binary values:
- 00000101
- 00000001
- 10000000
- 01000011
Task Two:
Using the binary converter again, try to make the following numbers using binary:
- 7
- 127
- 255
- 67
- 220
- 100
- 175
- 99
- 199
- 233
Bits and bytes
You are probably familiar with the words "bit" and "byte". In binary, a single digit is called a "bit." When dealing with bits we tend to collect them together in lots of 8, we call this a byte. Have a look at the image on the left. We see the binary number 10100101 - each of these numbers is 1 bit, the 8 of them together are a byte. In the lower part of the image we see that we can collect bytes together in larger amounts. 1024 bytes are what we call a kilobyte, 1024 kilobytes are a megabyte, 1024 megabytes are a gigabyte. These are no doubt terms that we have all heard and used many times before without perhaps understanding what they actually meant. Task Three: 1000 grams is a kg, but 1024 bits is a kb. Have a think about why this is and try your best to explain this in 50 words. |
Colours and binary
We can use numbers to represent colours, in fact the very screen that you're looking at right now is using numbers to store and display the information about the colours it is showing.
You may have heard the term "8-bit colour." This means that we are using 8 bits in order to store information about a colour. If we were representing a full red colour we would use "11111111" (the number 255), this would be a bright red because all of the values are "on". If we had "00000000" (the number 0) all of the values are "off" so we would have black. Unlike with paint, with colours of light the primary colours are red, green, and blue (RGB). Similar to with paint we can mix these together to get different colours. Task Four: In the top image on the right we see how we can get the colours: red, green, blue, yellow, and cyan using decimal & binary. Using the link below try to create the colours in the image below. jumk.de/color-calculator/ |