All images and every digital sounds are made from ‘0’s and ‘1’s. Each one of these digits is called a binary digit. Each binary digit is 1 bit. 8 bits make up a byte. Confused? Well don’t worry, that’s what bits, bytes and binary codes are in the short form. However, this post will go into more detail what they are and examples of how they are used and interpreted.
- Each pixel is represented by a binary number. A binary digit can be either 0 or 1.
- 1 Binary digit = 1 bit.
- 8 bits = 1 byte.
- 1 kilobyte = 1024 bytes = 210 bytes (I will get onto why 1 kilobyte is not 1000 bytes later).
- 1 megabyte = 1,048,576 = 220 bytes.
No. of combinations = 2n where n = number of bits
To make this clearer, I will use an example:
From this, you can make 0-15 from four binary digits which is 16 different combinations.
Therefore, 16 = 2n where n = number of bits which is 24
Let’s do a question using this theory.
Calculate the number of colours available if 1 pixel in an image = 3 bytes.
What we will do first is change that ‘byte’ into ‘bit’ as 8 bits make one byte.
8 x 3 = 24. This tells us there are 24 bits in each pixel of the image. It also tells us the number of bits in the image. Therefore, we can work out the number of colours: 224 = 16, 777, 216 (number of colours available in the image).
If you are revising Physics Topics, please have a look at other articles I have done on Physics you may be interested in.