☰ Contents · Computing

Practice: coding and working out sizes

Lessons 5 · 1 lessons · D.T. Kamaltdinova, D.M. Sayfurov. Informatics and Information Technology, Grade 5 (general editor F.M. Zakirova). “Nashriyot uyi Tasvir”, Tashkent, 2020
5

Practical lesson: coding and units of information

Textbook: p. 23
GoalList binary code combinations, convert between bits, bytes, KB, MB and GB, and calculate the size of a text.
New words
a different arrangement or combination of signs · kombinatsiyabinary code: information written with 0 and 1 · ikkilik kodthe amount of information, measured in bits and bytes · axborot hajmithe number of a letter in the alphabet used as its code · tartib raqami
Explanation

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.

Worked examples
All 3-bit codes: 000, 001, 010, 011, 100, 101, 110, 111 – eight in all, that is 2 × 2 × 2 = 8.
In “Salom, dunyo!”: Salom (5) + comma (1) + space (1) + dunyo (5) + exclamation mark (1) = 13 characters. Size: 13 bytes = 13 × 8 = 104 bits.
Class activity

“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.

Practice
1
How many bits is 6 bytes?
2
How many bytes is 32 bits?
3
How many KB is 3 MB?
4
A flag has 3 stripes and each stripe can be red or white. How many different flags can be made?