AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ 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.

BitsCombinations
12
24
38
416
8256
800 × 6000.46 MB469 KB

800 × 600 = 480000 pixels

480000 × 8 bit = 3840000 bit = 480000 bytes ≈ 0.46 MB

(uncompressed; formats such as JPEG are smaller)

💡 Where will I use this?
In real life

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.

Who uses it

A system administrator plans for enough storage, a programmer keeps files small, and a communications engineer works out data transfer speed.

Try it today

Put one letter, one word, one sentence and one page of text in order of size, from smallest to largest.

Worked examples
All 3-bit codes: 8
000001010011
100101110111
All 3-bit codes: 000, 001, 010, 011, 100, 101, 110, 111 – eight in all, that is 2 × 2 × 2 = 8.
13 characters = 13 bytes = 104 bits (␣ = space)
Salom,␣
dunyo!
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?
Story of the Week · The Khwarizmi WayA mission for Teachers’ DayClose the week: all of this week’s subjects in one storyRead →