Practical lesson: coding and units of information
With two signs (0 and 1) we can make many different codes, because the number of combinations depends on the number of bits. 1 bit gives 2 states, 2 bits give 4 (00, 01, 10, 11), 3 bits give 8, 4 bits give 16 and 8 bits give 256 combinations: every extra bit doubles the number. To convert: bytes → bits, multiply by 8; bits → bytes, divide by 8; KB → bytes, multiply by 1024; MB → KB, also multiply by 1024. To find the size of a text, count the characters (spaces and punctuation marks count too), because each character is 1 byte. For a long text: pages × lines × characters per line.
| Bits | Combinations |
|---|---|
| 1 | 2 |
| 2 | 4 |
| 3 | 8 |
| 4 | 16 |
| 8 | 256 |
800 × 600 = 480000 pixels
480000 × 8 bit = 3840000 bit = 480000 bytes ≈ 0.46 MB
(uncompressed; formats such as JPEG are smaller)
In a computer lesson a child compared two files in a folder: a page of text and a photo. The photo’s size was shown to be much bigger than the text’s. Knowing sizes makes storing and sending files easier.
A system administrator plans for enough storage, a programmer keeps files small, and a communications engineer works out data transfer speed.
Put one letter, one word, one sentence and one page of text in order of size, from smallest to largest.
| 000 | 001 | 010 | 011 |
| 100 | 101 | 110 | 111 |
| S | a | l | o | m | , | ␣ |
| d | u | n | y | o | ! |
“Row of bits”: three pupils hold cards (card up = 1, down = 0). The class finds all 8 combinations together and writes them on the board.