Binary - The Language of Computers
Binary is the language of computers. It is a system that uses only 0's and 1's to represent everything you see or use on your computer like numbers, images, words, instructions, sound and even movies.
Binary was not invented when computers were though. It is much older than computers. In fact the binary number system was discovered by Gottfried Leibniz in 1679, but it can even be traced back further to the 9th century BC in China and their I-Ching (or Yijing) - which was based around Ying and Yang.
Binary is used in computers as a change in voltage. A 1 represents high voltage, and 0 low voltage and these are used to process information. A single binary number is known as a bit (binary digit), which is represented with a small ‘b’. However, we normally work in bytes (represented with a capital ‘B’) when dealing with binary in a computer. A byte is 8 bits (so 8 binary numbers).
Binary is the language of computers. It is a system that uses only 0's and 1's to represent everything you see or use on your computer like numbers, images, words, instructions, sound and even movies.
Binary was not invented when computers were though. It is much older than computers. In fact the binary number system was discovered by Gottfried Leibniz in 1679, but it can even be traced back further to the 9th century BC in China and their I-Ching (or Yijing) - which was based around Ying and Yang.
Binary is used in computers as a change in voltage. A 1 represents high voltage, and 0 low voltage and these are used to process information. A single binary number is known as a bit (binary digit), which is represented with a small ‘b’. However, we normally work in bytes (represented with a capital ‘B’) when dealing with binary in a computer. A byte is 8 bits (so 8 binary numbers).
0 - a bit (1 binary digit)
0000 - a nibble (4 binary digits)
0000 0000 - a byte (8 binary digits)
256b - 256 bits of binary data (or 32B)
256B - 256 bytes of binary data (or 2048b)
0000 - a nibble (4 binary digits)
0000 0000 - a byte (8 binary digits)
256b - 256 bits of binary data (or 32B)
256B - 256 bytes of binary data (or 2048b)
Task 1 - Bits to Bytes and Vice Versa
Convert the following bits to bytes, or bytes to bits. Show your working out.
*Remember to divide by 8 to go from bits to bytes and to times by 8 to go from bytes to bits*
Convert the following bits to bytes, or bytes to bits. Show your working out.
*Remember to divide by 8 to go from bits to bytes and to times by 8 to go from bytes to bits*
- 64b
- 8B
- 128b
- 512b
- 32B
- 1,024B
Binary - Number Representation
Remembering how base 10 works
For our 'normal' number system we use one called base 10 (or decimal/denary). This gives us 10 different numbers to use - 0 to 9. We use this system because, simply, we have 10 fingers so it suits us best. Once we have reached the limit we can count to (9) we then increase the digit to the right of it by one. So for example:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9... I can now not count any further on this digit, so I increase the digit to the left of it by 1 and reset the digit I am currently counting on. So it becomes 10. I then continue counting:
10, 11, 12, 13, 14, 15, 16, 17, 18, 19... I have run out again so I increase the digit to the left once more and it becomes 20.
This may seem very simple, but it is quite easy to forget how base 10 works as we are so familiar with using it.
Remember in base 10, each unit we use changes by a multiple of 10.
For our 'normal' number system we use one called base 10 (or decimal/denary). This gives us 10 different numbers to use - 0 to 9. We use this system because, simply, we have 10 fingers so it suits us best. Once we have reached the limit we can count to (9) we then increase the digit to the right of it by one. So for example:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9... I can now not count any further on this digit, so I increase the digit to the left of it by 1 and reset the digit I am currently counting on. So it becomes 10. I then continue counting:
10, 11, 12, 13, 14, 15, 16, 17, 18, 19... I have run out again so I increase the digit to the left once more and it becomes 20.
This may seem very simple, but it is quite easy to forget how base 10 works as we are so familiar with using it.
Remember in base 10, each unit we use changes by a multiple of 10.
Task 2 - Back to Basics (This will help later on!)
Break these base 10 numbers into units, tens, hundreds, thousands and so on.
Break these base 10 numbers into units, tens, hundreds, thousands and so on.
- 27
- 392
- 1,877
- 32, 206
- 790, 440
Binary Numbers - Base 2
Once we know how base 10 works, every base number system becomes very simple, and binary is the simplest of all as we only have two numbers to worry about; 0 and 1.
Where in base 10, we count to 9 before moving to the next digit on the left, in binary we only count to 1. Remember you should never see any number above 1 in a binary number - if you have a number 2 or higher, you have done something wrong!
So how do we use binary to represent any number we can think of? It is sometimes easier to think of the units like switches. They are either off (0) or on (1).
Once we know how base 10 works, every base number system becomes very simple, and binary is the simplest of all as we only have two numbers to worry about; 0 and 1.
Where in base 10, we count to 9 before moving to the next digit on the left, in binary we only count to 1. Remember you should never see any number above 1 in a binary number - if you have a number 2 or higher, you have done something wrong!
So how do we use binary to represent any number we can think of? It is sometimes easier to think of the units like switches. They are either off (0) or on (1).
Here we have the binary number 10011100 and you can see the units increase in multiples of 2 (remember base 10 was multiples of 10). We have 0x1, 0x2, 1x4, 1x8, 1x16, 0x32, 0x64 and 1x128. If we add up all of the numbers that are 'turned on' we have 4+8+16+128 = 156 which is the number 10011100 in base 10. We put a small 10 next to the number to show this number is in base 10. You can see a small 2 has been put next to the binary number to show it is in base 2. This way we do not get confused.