AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Contents · Computing

Converting between number systems

Lessons 7–8 · 2 lessons · B. Boltayev, M. Mahkamov, A. Azamatov, S. Rahmonqulova. Informatics and Information Technologies, Grade 7. Revised and expanded third edition. “O‘zbekiston milliy ensiklopediyasi” State Scientific Publishing House, Tashkent, 2017
7

Writing numbers of one system in another system

Textbook: pp. 32–34
GoalConverts a number from any positional system to decimal and from decimal to any base, uses the decimal system as a “bridge”, and uses the dyad, triad and tetrad tables between bases 2, 8 and 16.
New words
conversion: writing the same number in another number system · o‘tkazishdivision with remainder: dividing and keeping the remainder · qoldiqli bo‘lishtriad: a group of 3 binary digits standing for one octal digit · triadatetrad: a group of 4 binary digits standing for one hexadecimal digit · tetrada
Explanation

To convert a number from a system whose base is not 10 into decimal, write it in expanded form and compute the sum: 111010₂ = 1 · 2⁵ + 1 · 2⁴ + 1 · 2³ + 0 · 2² + 1 · 2¹ + 0 · 2⁰ = 32 + 16 + 8 + 2 = 58. To convert a whole decimal number into base p, divide it by p with remainder, divide the quotient by p again, and go on until the quotient is less than p. The last quotient and all the remainders (starting from the last, i.e. from bottom to top) give the digits of the required number: for 100 : 2 the remainders are 0, 0, 1, 0, 0, 1 and the last quotient is 1; read from bottom to top, 1100100. If a remainder is above 9, a letter is written (10 = A, 11 = B, …). When moving between two other systems, the decimal system is a “bridge”: first to decimal, then to the required base. Between systems with bases 2, 4, 8, 16 there is a shortcut: one octal digit matches a group of 3 binary digits (triad), one hexadecimal digit matches a group of 4 (tetrad), and one base-4 digit matches a group of 2 (dyad). For example 3C₁₆ = 0011 1100₂.

OctalBinary (triad)
0000
1001
2010
3011
4100
5101
6110
7111
2⁷11282⁶1642⁵0322⁴0162³182²042¹022⁰01

11001000₂ = 128 + 64 + 8 = 200

The buttons flip the bits: 1 means the place value is added, 0 means it is not

💡 Where will I use this?
In real life

To turn 135 minutes into hours we divide by 60: 135 : 60 = 2 with remainder 15, which is 2 hours 15 minutes. Converting a number into another base works the same way: divide and write down the remainder.

Who uses it

A programmer converts numbers to the needed system, an electronics engineer checks signal codes, and a dispatcher splits time into hours and minutes.

Try it today

Split 125 seconds into minutes and seconds using division with remainder. Then write one sentence on how this resembles converting between bases.

Worked examples
bottom to top: 505₇
DivisionRemainder
250 : 7 = 355
35 : 7 = 50
last quotient5
Convert 250 into base 7: 250 : 7 = 35 (remainder 5); 35 : 7 = 5 (remainder 0); the last quotient is 5. From bottom to top: 5, 0, 5 → 505₇. Check: 5 · 49 + 0 · 7 + 5 = 250.
753₈ = 111101011₂
753
111101011
Convert 753₈ to binary with triads: 7 = 111, 5 = 101, 3 = 011 → 111 101 011, i.e. 111101011₂. The reverse: group a binary number in threes from the right and replace each group by an octal digit.
Class activity

“Chain of remainders”: each team gets a decimal number. Pupils take turns at the board doing one division and writing the remainder; at the end the remainders are read from bottom to top. Teams with the right answer score points.

Practice
1
Convert 111010₂ to decimal.
2
Convert 78 to binary.
3
Convert 745₈ to binary using the triad table.
4
Why are the remainders read from bottom to top?
Story of the Week · The Khwarizmi WayThe winter bird countClose the week: all of this week’s subjects in one storyRead →