Other numeral systems
A computer only understands $0$ and $1$. A Mayan inscription uses dots and bars. A theatre plaque reads "MCMXCVIII". Our decimal system (base $10$) is not the only possible one: any number can be written in any base, by changing how many different symbols you use and what each position is worth.
The decimal system is not the only one: what a base is
In base $10$ we use $10$ symbols ($0$-$9$) and each position is worth $10$ times the previous one. In base $2$ (binary) there are only two symbols, $0$ and $1$, and each position is worth twice the previous one.
In computer science, the smallest unit of information is the bit, which can only take the values $0$ or $1$ (binary system). An old processor in a retro console uses…
In computer science, the smallest unit of information is the bit, which can only take the values $0$ or $1$ (binary system). An old processor in a retro console uses 8-bit registers. If a character has an energy level represented by the decimal number $43$, how would that value appear in the console's binary code?
In an archaeological dig, an inscription with an unknown number system was found. After analysing it, experts determined that it is a base-4 system, where the symbols…
In an archaeological dig, an inscription with an unknown number system was found. After analysing it, experts determined that it is a base-4 system, where the symbols are: $\triangle = 0$, $\square = 1$, $\bigcirc = 2$ and $\star = 3$.
If the treasure is located at a distance of $\bigcirc \star \square \triangle$ metres from the main entrance, calculate this distance in our decimal system. Then, express the result obtained in the binary system.
From decimal to binary: successive divisions
To go the other way, you divide the number by $2$ over and over again, and the remainders (read from last to first) form the binary number.
Computers use the binary system (base 2) to process information, using only the digits $0$ and $1$. To understand how a machine "thinks", convert the decimal number $13$…
Computers use the binary system (base 2) to process information, using only the digits $0$ and $1$. To understand how a machine "thinks", convert the decimal number $13$ to binary code using the method of successive divisions by $2$.
The diagram shows the divisions you need to do. In each row, the quotient from the previous row is divided by $2$, and you continue until the quotient is $0$.
- a) Fill in the boxes of the diagram: the quotient and remainder of each division, until you reach a quotient of $0$.
- b) Read the remainders from bottom to top (from the last to the first) and write the number $13$ in base 2.
In a computer system, multiplying a binary number by $2^n$ is equivalent to shifting its digits $n$ positions to the left (adding zeroes at the end). Given the decimal…
In a computer system, multiplying a binary number by $2^n$ is equivalent to shifting its digits $n$ positions to the left (adding zeroes at the end).
Given the decimal number $21$:
- a) Express it in the binary system.
- b) Perform the operation of shifting its digits $3$ positions to the left.
- c) Convert the resulting number back to the decimal system and check that the result is equivalent to multiplying $21 \times 2^3$.
Interpreting and modifying the algorithm
Conversion by successive divisions is an algorithm. Its input is a non-negative integer and its output is that number written in binary. For the input 0 we simply return 0. For all the others, we repeat integer division by 2 and keep the remainders until the quotient is zero; finally we read the remainders backwards.
Transfer the idea: to convert to base 3, change the divisor to 3; the possible remainders are 0, 1 and 2. With 13 you get remainders 1, 1, 1 and the output $111_3$, since $9+3+1=13$. Explain which parts of the algorithm stay the same and which change.
To investigate with a spreadsheet, write the starting number in A2; in B2, =RESIDUO(A2;2), and in A3, =COCIENTE(A2;2). Copy the remainder formula and carry on with the divisions until the first quotient of zero; do not include the remainder from that extra row. Read the previous remainders in reverse order. If you change base, you must change the divisor in both formulas. How many digits will a number need before you convert it? Compare numbers close to powers of the base and check your conjecture with small cases.
Roman numerals
Roman numerals are not positional: each symbol has a fixed value, and they are combined by adding or subtracting depending on the order in which they appear.
On the façade of an old theatre in your city, the year of its opening is carved in Roman numerals: MCMXCVIII. Convert this number to our decimal system to find out which…
On the façade of an old theatre in your city, the year of its opening is carved in Roman numerals: MCMXCVIII. Convert this number to our decimal system to find out which year the theatre opened.
Calculate the result of the following operation with Roman numerals, expressing the final value both in Roman numerals and in the decimal number system:…
Calculate the result of the following operation with Roman numerals, expressing the final value both in Roman numerals and in the decimal number system:
$(MMCDLXIV - MDCCCLXXXIX) \times XII$
Other ancient systems: Mayan, Babylonian and other bases
Not all civilisations used base $10$. The Maya used base $20$ (vigesimal) with dots and bars; the Babylonians used base $60$ (the same base we still use today for time and angles).
The Mayan number system was vigesimal (base 20) and vertically positional. Look at the following number represented by its levels and convert it into our decimal system:…
The Mayan number system was vigesimal (base 20) and vertically positional. Look at the following number represented by its levels and convert it into our decimal system:
-
Level 3 (top): One dot.
-
Level 2 (middle): Two bars and three dots.
-
Level 1 (bottom): One bar.
(Remember that in the Mayan system, the dot is worth $1$ and the bar is worth $5$).
An intergalactic explorer has arrived on a planet where the natives use a base 5 numeral system. You are given the following equivalences to understand their language:…
An intergalactic explorer has arrived on a planet where the natives use a base 5 numeral system. You are given the following equivalences to understand their language:
$1_{5} = \text{I}$, $2_{5} = \text{V}$, $3_{5} = \text{X}$, $4_{5} = \text{L}$.
If they tell you that there are $\text{XXL}$ hours left until the mothership takes off:
- a) Write the number of hours in the decimal system.
- b) Calculate how many minutes that time is equivalent to.