Systems of Counting

Number Base Converter

Type a whole number or a number with a fractional part, for example 156, 101.11 or 7E9 (base 16), and choose its base and the base to convert it to. Digits above 9 are letters: A = 10, B = 11, …, Z = 35. The calculator shows the solution step by step.

What Is a Number System?

A number system, or system of counting, is a way of writing numbers with a small set of symbols called digits. We write numbers in the decimal system. It has ten digits, $0$ to $9,$ probably because people first counted on their ten fingers. The same numbers can be written in other systems too. Computers work in the binary system, which has only two digits, $0$ and $1;$ programmers also use base $8$ and base $16,$ and we still count minutes and seconds in sixties.

All these systems are positional: the value of a digit depends on its place in the number. In $555$ the three fives mean $500,$ $50$ and $5.$ Roman numerals are different: there X is always ten (added in LX, subtracted in XL); its place never makes it worth a hundred.

On this page: Calculator · Place value · Bases · Counting · Binary · To decimal · From decimal · Fractions · Binary arithmetic · Octal and hexadecimal · Bases 12 and 60 · Bits, bytes, BCD · Practice

Place Value in the Decimal System

Each place of a decimal number is worth ten times the place to its right: ones, tens, hundreds, thousands, and so on. So a number is the sum of its digits, each multiplied by a power of $10\text{:}$

${3507}={3\cdot 1000}+{5\cdot 100 + 0\cdot 10 + 7}={3\cdot 10^3 + 5\cdot 10^2}+{0\cdot 10^1 + 7\cdot 10^0.}$

This is the expanded form of the number. The zero matters: it shows that there are no tens, and without it $3507$ would become $357.$ The places to the right of the decimal point are worth tenths, hundredths, thousandths, that is, negative powers of $10\text{:}$

${0.25}={\frac{2}{10} + \frac{5}{100}}={2\cdot 10^{-1} + 5\cdot 10^{-2}.}$

Numbers in Any Base

Nothing forces us to group by tens. In a system with base $b$ (also called the radix) there are $b$ digits, from $0$ to $b-1,$ and each place is worth $b$ times the place to its right. The places are worth $1,$ $b,$ $b^2,$ $b^3,$ and so on, so the digits $a_n\ldots a_2a_1a_0$ mean

${(a_n\ldots a_2a_1a_0)_b}={a_n\cdot b^n + \ldots}+{a_2\cdot b^2 + a_1\cdot b + a_0.}$

The base is written as a small subscript after the digits: $1011_2$ is a binary number, and $1011_{10}$ is the decimal number one thousand and eleven. A number without a subscript is decimal. In a base above ten the digits after $9$ are letters: $\mathrm{A} = 10,$ $\mathrm{B} = 11,$ $\mathrm{C} = 12,$ and so on up to $\mathrm{Z} = 35$ in base $36.$

Example 1. The same digits mean different numbers in different bases:

${1011_2}={1\cdot 2^3 + 0\cdot 2^2 + 1\cdot 2 + 1}={8 + 2 + 1}={11,}$
${1011_3}={1\cdot 3^3 + 0\cdot 3^2 + 1\cdot 3 + 1}={27 + 3 + 1}={31,}$
${1011_{10}}={1000 + 10 + 1}={1011.}$

In every base, the numeral $10$ (one, zero) is the base itself: $10_2 = 2,$ $10_8 = 8,$ $10_{16} = 16,$ just as $10$ is ten in the decimal system. In the same way $100_b = b^2$ and $1000_b = b^3.$

The most common systems:

Number systemDigitsUsed for
Base 2, binary$0,$ $1$computers and all digital devices
Base 8, octal$0$ to $7$file permissions in Unix and Linux; older computers
Base 10, decimal$0$ to $9$everyday counting and calculating
Base 12, duodecimal$0$ to $9,$ $\mathrm{A},$ $\mathrm{B}$dozens and grosses; 12 months and 12 hours
Base 16, hexadecimal$0$ to $9,$ $\mathrm{A}$ to $\mathrm{F}$colors on web pages, memory addresses, bytes
Base 60, sexagesimal$0$ to $59$ in each placehours, minutes and seconds; degrees, minutes and seconds of angles

Counting in Other Bases

Mechanical counters, such as the odometer of an older car or a water meter, have little wheels with the digits $0$ to $9.$ The rightmost wheel turns one step for each unit. When it passes its last digit, it goes back to $0$ and turns the next wheel one step: after $0999$ comes $1000.$ A counter for base $b$ would have $b$ digits on each wheel. On a binary counter each wheel shows only $0$ or $1,$ so the rightmost wheel goes back to $0$ at every second step and turns the next wheel one step.

decimal0999+11000binary0111+11000

One more unit on a decimal counter and on a binary counter: $0999 + 1 = 1000$ and $0111_2 + 1 = 1000_2,$ that is, $7 + 1 = 8.$

So counting in base $b$ works just like counting in decimal: when a place has the largest digit, $b-1,$ the next unit makes it $0$ and carries $1$ to the next place. Here are the numbers from $0$ to $16$ in four bases:

DecimalBinaryOctalHexadecimal
$0$$0$$0$$0$
$1$$1$$1$$1$
$2$$10$$2$$2$
$3$$11$$3$$3$
$4$$100$$4$$4$
$5$$101$$5$$5$
$6$$110$$6$$6$
$7$$111$$7$$7$
$8$$1000$$10$$8$
$9$$1001$$11$$9$
$10$$1010$$12$$\mathrm{A}$
$11$$1011$$13$$\mathrm{B}$
$12$$1100$$14$$\mathrm{C}$
$13$$1101$$15$$\mathrm{D}$
$14$$1110$$16$$\mathrm{E}$
$15$$1111$$17$$\mathrm{F}$
$16$$10000$$20$$10$

The largest number with $n$ digits in base $b$ has all its digits equal to $b-1.$ One more unit gives $10\ldots0_b = b^n,$ so this number is $b^n-1\text{:}$ $999 = 10^3-1,$ $1111_2 = 2^4-1 = 15$ and $\mathrm{FF}_{16} = 16^2-1 = 255.$

The Binary System

The binary system has base $2$ and only two digits, $0$ and $1.$ A binary digit is called a bit, short for binary digit. The places of a binary number are worth the powers of $2\text{:}$

$2^7$$2^6$$2^5$$2^4$$2^3$$2^2$$2^1$$2^0$
$128$$64$$32$$16$$8$$4$$2$$1$

The next powers are $2^8 = 256,$ $2^9 = 512$ and $2^{10} = 1024.$ In binary every power of $2$ is written as $1$ followed by zeros, for example $2^5 = 100000_2.$

Computers use binary because a bit needs only two states that are easy to tell apart: a switch is off or on, a voltage is low or high. Since each place has only two digits, the carry comes very soon: $1 + 1 = 10_2.$ Counting in binary goes $1,$ $10,$ $11,$ $100,$ $101,$ $110,$ $111,$ $1000,$ and so on.

Converting a Number from Any Base to Decimal

Write the place value over each digit, multiply each digit by its place value and add. This is the expanded form again.

Example 2. Convert $110101_2$ to decimal.

Place value$32$$16$$8$$4$$2$$1$
Digit$1$$1$$0$$1$$0$$1$

${110101_2}={32 + 16 + 4 + 1}={53.}$

Example 3. Convert $753_8$ and $\mathrm{2A7}_{16}$ to decimal. In base $8$ the places are worth $1,$ $8$ and $8^2 = 64.$ In base $16$ they are worth $1,$ $16$ and $16^2 = 256,$ and the digit $\mathrm{A}$ is $10\text{:}$

${753_8}={7\cdot 64 + 5\cdot 8 + 3}={448 + 40 + 3}={491,}$
${\mathrm{2A7}_{16}}={2\cdot 256 + 10\cdot 16 + 7}={512 + 160 + 7}={679.}$

For long numbers there is a quicker way, the same as Horner's rule for polynomials: start with the first (leftmost) digit, then again and again multiply the result by the base and add the next digit. For $110101_2\text{:}$

Digit$1$$1$$0$$1$$0$$1$
Result$1$$3$$6$$13$$26$$53$

Each result is the previous result times $2$ plus the digit above it: $1\cdot 2 + 1 = 3,$ $3\cdot 2 + 0 = 6,$ $6\cdot 2 + 1 = 13,$ $13\cdot 2 + 0 = 26,$ $26\cdot 2 + 1 = 53.$ The last result is the number: $110101_2 = 53.$

Converting Decimal to Binary and Other Bases

Repeated Division

Divide the number by the new base $b.$ The remainder is the last digit of the answer. Divide the quotient by $b$ again: the new remainder is the digit before the last one. Go on until the quotient is $0,$ then read the remainders from the bottom up.

Example 4. Convert $13$ to binary.

DivisionQuotientRemainder
$13 \div 2$$6$$1$
$6 \div 2$$3$$0$
$3 \div 2$$1$$1$
$1 \div 2$$0$$1$

Reading the remainders from the bottom up gives $13 = 1101_2.$ Check: $8 + 4 + 1 = 13.$

Example 5. Convert $2025$ to hexadecimal. A remainder above $9$ is written as a letter: $14 = \mathrm{E}.$

DivisionQuotientRemainder
$2025 \div 16$$126$$9$
$126 \div 16$$7$$14 = \mathrm{E}$
$7 \div 16$$0$$7$

So $2025 = \mathrm{7E9}_{16}.$ Check: ${7\cdot 256 + 14\cdot 16 + 9}={1792 + 224 + 9}={2025.}$

Why does this work? A division with remainder writes the number as $n = b\cdot q + r$ with $0 \le r < b,$ so $r$ is a single digit in base $b.$ In base $b,$ multiplying $q$ by $b$ adds a zero at the end of its digits, just as multiplying by $10$ does in decimal, and then adding $r$ puts $r$ in the place of that zero. So $r$ is the last digit, and the digits of $q$ come before it.

Subtracting Powers of 2

For binary there is another way. Take away the largest power of $2$ that is not greater than the number, then the largest power of $2$ that fits into what is left, and so on until nothing is left. Each power used gives a $1$ in its place; all the other places get $0.$ For example, $13 - 8 = 5,$ $5 - 4 = 1,$ $1 - 1 = 0,$ so $13 = 8 + 4 + 1 = 1101_2,$ as in Example 4.

Example 6. Convert $1546$ to binary. The largest power of $2$ up to $1546$ is $2^{10} = 1024\text{:}$

$1546 - 1024 = 522,$   $522 - 512 = 10,$   $10 - 8 = 2,$   $2 - 2 = 0.$

So ${1546}={2^{10} + 2^9 + 2^3 + 2^1.}$ The places $10,$ $9,$ $3$ and $1$ get ones, counting the places from $0$ at the right: $1546 = 11000001010_2.$

To convert a number between two bases other than ten, convert it to decimal first and then to the new base. The calculator does this too, except when both bases are powers of the same number, such as $8$ and $16.$ For the bases $2,$ $8$ and $16$ there is a shortcut, shown in the section Octal and Hexadecimal.

Fractions in Other Bases

The digits after the point work in the same way: in base $b$ they are worth $\frac{1}{b},$ $\frac{1}{b^2},$ $\frac{1}{b^3}$ and so on. In binary the places after the point are halves, quarters, eighths:

$$101.11_2 = 4 + 1 + \frac{1}{2} + \frac{1}{4} = 5.75.$$

To write a number between $0$ and $1$ in base $b,$ multiply it by $b.$ The whole part of the product is the first digit after the point. Then multiply the fractional part of the product by $b$ again to get the next digit, and so on. This works because multiplying by $b$ moves the point one place to the right in base $b\text{:}$ the first digit after the point jumps in front of it and becomes the whole part.

Example 7. Convert $0.625$ to binary.

MultiplicationProductDigit
$0.625\cdot 2$$1.25$$1$
$0.25\cdot 2$$0.5$$0$
$0.5\cdot 2$$1$$1$

The fractional part became $0,$ so the digits end. Read them from the top down, not from the bottom up as in division: $0.625 = 0.101_2.$ Check: $\frac{1}{2} + \frac{1}{8} = 0.625.$

A number with a whole part and a fractional part is converted in two pieces: the whole part by repeated division, the fractional part by repeated multiplication. For example, $13 = 1101_2$ (Example 4) and $0.625 = 0.101_2,$ so $13.625 = 1101.101_2.$

Example 8. Convert $0.1$ to binary.

MultiplicationProductDigit
$0.1\cdot 2$$0.2$$0$
$0.2\cdot 2$$0.4$$0$
$0.4\cdot 2$$0.8$$0$
$0.8\cdot 2$$1.6$$1$
$0.6\cdot 2$$1.2$$1$

The fractional part $0.2$ has appeared before, in the second row, so from there the digits $0011$ repeat forever:

${0.1}={0.0001100110011\ldots_2}={0.0\overline{0011}_2.}$

The bar over $0011$ means that this block repeats. A computer keeps only a fixed number of bits, so it stores $0.1$ only approximately. That is why in many programming languages 0.1 + 0.2 gives 0.30000000000000004 and not exactly 0.3.

Whether a fraction ends depends on the base. A fraction in lowest terms ends in base $b$ (has finitely many digits after the point) exactly when every prime factor of its denominator divides $b.$ In base $10 = 2\cdot 5$ the fractions $\frac{1}{2},$ $\frac{1}{4},$ $\frac{1}{5},$ $\frac{1}{8}$ end, but $\frac{1}{3} = 0.\overline{3}$ does not. In base $3$ it is the other way round: $\frac{1}{3} = 0.1_3.$ In base $7$ even $\frac{1}{7} = 0.1_7,$ while in decimal $\frac{1}{7} = 0.\overline{142857}.$ In binary only the fractions whose denominator in lowest terms is a power of $2$ end.

A repeating expansion can be turned back into a fraction: multiply it by $b^k,$ where $k$ is the length of the repeating block, and subtract. Let ${x}={0.\overline{01}_2}={0.010101\ldots_2.}$ Multiplying by $2^2 = 100_2$ moves the point two places to the right: ${4x}={1.010101\ldots_2}={1 + x.}$ So $3x = 1$ and $x = \frac{1}{3}.$

Binary Arithmetic

Calculations in any base use the same column methods as in decimal; only the tables of addition and multiplication are different. In binary they are tiny.

Addition

$0 + 0 = 0,$ $0 + 1 = 1 + 0 = 1$ and $1 + 1 = 10_2\text{:}$ write $0$ and carry $1.$ With a carry, $1 + 1 + 1 = 11_2\text{:}$ write $1$ and carry $1.$

Example 9. Add $1011_2 + 110_2.$ The carries are written in red above the columns.

$$\begin{array}{cr} & \textcolor{#c0392b}{111}\phantom{00} \\ & 1011 \\ + & 110 \\ \hline & 10001 \end{array}$$

From the right: $1 + 0 = 1;$ $1 + 1 = 10_2,$ write $0$ and carry $1;$ $0 + 1 + 1 = 10_2,$ write $0$ and carry $1;$ $1 + 1 = 10_2,$ write $0$ and carry $1$ into a new place. In decimal this is $11 + 6 = 17,$ and indeed $10001_2 = 16 + 1 = 17.$

Subtraction

$0 - 0 = 0,$ $1 - 0 = 1$ and $1 - 1 = 0.$ For $0 - 1$ borrow $1$ from the next place to the left. It is worth $2$ in the current place, so the column gives $10_2 - 1 = 1.$ If the next place is $0,$ borrow from the nearest $1$ to the left; the zeros in between become $1,$ just as $1000 - 1 = 999$ in decimal.

Example 10. Subtract $1101_2 - 110_2.$

$$\begin{array}{cr} & 1101 \\ - & 110 \\ \hline & 111 \end{array}$$

From the right: $1 - 0 = 1.$ Then $0 - 1$ needs a borrow from the third place: $10_2 - 1 = 1,$ and the third place becomes $0.$ Now the third column is $0 - 1$ and borrows from the fourth place: $10_2 - 1 = 1.$ The fourth place is left with $0.$ The answer is $111_2,$ and in decimal $13 - 6 = 7.$

Multiplication

The binary multiplication table is $0\cdot 0 = 0\cdot 1 = 1\cdot 0 = 0$ and $1\cdot 1 = 1.$ So in long multiplication each row is either a row of zeros or the first number itself, shifted to the left, and only additions remain. Multiplying by $2 = 10_2$ adds a zero at the end, just as multiplying by $10$ does in decimal.

Example 11. Multiply $101_2\cdot 11_2,$ that is, $5\cdot 3.$

$$\begin{array}{cr} & 101 \\ \times & 11 \\ \hline & 101 \\ & 101\phantom{0} \\ \hline & 1111 \end{array}$$

The answer is ${1111_2}={8 + 4 + 2 + 1}={15.}$

Example 12. Multiply $37\cdot 27$ in binary. First $37 = 100101_2$ and $27 = 11011_2.$ The second number has the digits $1,$ $1,$ $0,$ $1,$ $1$ from the right, so the rows are $100101$ shifted by $0,$ $1,$ $3$ and $4$ places, with a row of zeros for the $0\text{:}$

$$\begin{array}{cr} & 100101 \\ \times & 11011 \\ \hline & 100101 \\ & 100101\phantom{0} \\ & 000000\phantom{00} \\ & 100101\phantom{000} \\ & 100101\phantom{0000} \\ \hline & 1111100111 \end{array}$$

The product is ${1111100111_2}={512 + 256 + 128}+{64 + 32 + 4 + 2 + 1}={999,}$ and indeed $37\cdot 27 = 999.$ This is the long way round, but a computer's multiplier circuit works in a similar way: it forms the shifted rows and adds them, billions of times per second.

Division

Long division in binary is simpler than in decimal. At each step the divisor either fits into the part of the dividend brought down so far, and the next digit of the quotient is $1,$ or it does not fit, and the digit is $0.$ So division is repeated subtraction.

Example 13. Divide $1111_2 \div 101_2,$ that is, $15\div 5.$

$$\begin{array}{cr} & 1111 \\ - & 101\phantom{0} \\ \hline & 101 \\ - & 101 \\ \hline & 0 \end{array}$$

The divisor $101$ does not fit into $1$ or $11,$ but it fits into $111\text{:}$ the first digit of the quotient is $1,$ and $111 - 101 = 10.$ Bring down the last digit: $101.$ The divisor fits again, and the remainder is $0.$ So $1111_2 \div 101_2 = 11_2,$ that is, $15 \div 5 = 3.$

Example 14. Divide $4773\div 37,$ that is, ${1001010100101_2 \div 100101_2.}$

$$\begin{array}{cr} & 1001010100101 \\ - & 100101\phantom{0000000} \\ \hline & 100101 \\ - & 100101 \\ \hline & 0 \end{array}$$

The divisor fits into the first six digits exactly, so the first digit of the quotient is $1$ and the remainder is $0.$ For the next six digits brought down the numbers are smaller than the divisor, and the quotient gets six zeros. With the last digit brought down we have $100101$ again: the last digit of the quotient is $1,$ with remainder $0.$ So ${1001010100101_2 \div 100101_2}={10000001_2,}$ and ${10000001_2}={128 + 1}={129;}$ indeed $37\cdot 129 = 4773.$

Octal and Hexadecimal

Long binary numbers are hard to read and easy to mistype. Since $8 = 2^3$ and $16 = 2^4,$ every octal digit stands for exactly three bits and every hexadecimal digit for exactly four bits:

DigitBitsDigitBits
$0$$0000$$8$$1000$
$1$$0001$$9$$1001$
$2$$0010$$\mathrm{A}$$1010$
$3$$0011$$\mathrm{B}$$1011$
$4$$0100$$\mathrm{C}$$1100$
$5$$0101$$\mathrm{D}$$1101$
$6$$0110$$\mathrm{E}$$1110$
$7$$0111$$\mathrm{F}$$1111$

For an octal digit, use only the last three bits from the table: $5 = 101_2,$ $7 = 111_2.$ To convert a binary number to hexadecimal, split its bits into groups of four from the right, add zeros on the left if the first group is short, and replace each group by its digit. For octal, use groups of three. To convert back, write each digit as four bits (or three for octal).

Example 15. Convert $10110110_2$ to hexadecimal and to octal.

${10110110_2}={1011\ 0110_2}={\mathrm{B6}_{16},}$
${10110110_2}={010\ 110\ 110_2}={266_8.}$

Check: ${\mathrm{B6}_{16}}={11\cdot 16 + 6}={182}$ and ${266_8}={2\cdot 64 + 6\cdot 8 + 6}={182.}$

Example 16. Write $\mathrm{3F}_{16}$ and $\mathrm{7E9}_{16}$ in binary, and $753_8$ in hexadecimal.

${\mathrm{3F}_{16}}={0011\ 1111_2}={111111_2,}$
${\mathrm{7E9}_{16}}={0111\ 1110\ 1001_2}={11111101001_2.}$

Between octal and hexadecimal, go through binary: $753_8 = 111\ 101\ 011_2,$ and in groups of four from the right this is $1\ 1110\ 1011_2 = \mathrm{1EB}_{16}.$ Both numbers equal $491.$

This is why programmers like hexadecimal: two hexadecimal digits are exactly one byte, eight bits. A color on a web page is often written as three bytes, for red, green and blue. For example, #FF8800 is red $\mathrm{FF}_{16} = 255,$ green $88_{16} = 136$ and blue $0,$ a shade of orange.

Bases 12 and 60

The Duodecimal System

Counting in twelves, the duodecimal system, survives in dozens ($12$) and grosses ($12^2 = 144$), in the $12$ months of the year and the $12$ hours on a clock face. Its advantage is that $12$ has more divisors than $10\text{:}$ $2,$ $3,$ $4$ and $6,$ while $10$ has only $2$ and $5.$ So halves, thirds, quarters and sixths are short in base $12\text{:}$ $\frac{1}{2} = 0.6_{12},$ $\frac{1}{3} = 0.4_{12},$ $\frac{1}{4} = 0.3_{12},$ $\frac{1}{6} = 0.2_{12},$ while in decimal $\frac{1}{3} = 0.\overline{3}$ never ends. The two extra digits for ten and eleven are written $\mathrm{A}$ and $\mathrm{B}$ here; some books use other signs, such as t and e.

Example 17. Convert $143{,}131$ to base $12$ and back.

DivisionQuotientRemainder
$143{,}131 \div 12$$11{,}927$$7$
$11{,}927 \div 12$$993$$11 = \mathrm{B}$
$993 \div 12$$82$$9$
$82 \div 12$$6$$10 = \mathrm{A}$
$6 \div 12$$0$$6$

So $143{,}131 = \mathrm{6A9B7}_{12}.$ Back: ${\mathrm{6A9B7}_{12}}={6\cdot 12^4 + 10\cdot 12^3}+{9\cdot 12^2 + 11\cdot 12 + 7}={124{,}416 + 17{,}280}+{1296 + 132 + 7}={143{,}131.}$

The Sexagesimal System

The Babylonians counted in base $60,$ and we still use it for time and angles. Here each "digit" is a number from $0$ to $59,$ written in decimal. A time of $2$ h $15$ min $30$ s is the base-$60$ number with the digits $2,$ $15$ and $30\text{:}$ it is ${2\cdot 60^2 + 15\cdot 60 + 30}={8130}$ seconds. In the other direction, divide by $60\text{:}$ $10{,}000 = 60\cdot 166 + 40$ and $166 = 60\cdot 2 + 46,$ so $10{,}000$ seconds are $2$ h $46$ min $40$ s. Angles are measured in the same way: $12^\circ 30' = 12.5^\circ,$ since $30' = \frac{30}{60}$ of a degree.

Bits, Bytes and Binary-Coded Decimal

A group of $8$ bits is a byte. With $n$ bits one can write $2^n$ different numbers, from $0$ to $2^n-1.$ A byte holds the numbers $0$ to $255,$ two bytes hold $0$ to $65{,}535,$ and $32$ bits give $2^{32} = 4{,}294{,}967{,}296$ different values, a little over four billion.

Many pocket calculators, digital clocks and meters keep each decimal digit in its own group of four bits. This is called binary-coded decimal (BCD). For example, $1546$ in BCD is $0001\ 0101\ 0100\ 0110,$ one group for each of the digits $1,$ $5,$ $4$ and $6,$ while in pure binary $1546 = 11000001010_2.$ BCD needs more bits, $16$ instead of $11$ here, but each digit typed on the keys is stored as it is, the number is easy to show on the display digit by digit, and a decimal fraction such as $0.1$ is stored exactly.

Practice Problems

Solve the problems, then open them to see the answers. You can check your work with the calculator at the top of this page.

1. Convert $10110_2$ to decimal.

${10110_2}={16 + 4 + 2}={22.}$ Answer: $22.$

2. Convert $1111111_2$ to decimal.

Seven ones: ${1 + 2 + 4 + 8}+{16 + 32 + 64}={127,}$ or quicker, ${1111111_2}={2^7 - 1}={127.}$ Answer: $127.$

3. Convert $45$ to binary.

${45}={32 + 8 + 4 + 1}={2^5 + 2^3 + 2^2 + 2^0.}$ Answer: $101101_2.$

4. Convert $200$ to binary.

$200 = 128 + 64 + 8.$ Answer: $11001000_2.$

5. Convert $777_8$ and $\mathrm{1A3}_{16}$ to decimal.

${777_8}={7\cdot 64 + 7\cdot 8 + 7}={511}={8^3 - 1}$ and ${\mathrm{1A3}_{16}}={256 + 10\cdot 16 + 3}={419.}$ Answer: $511$ and $419.$

6. Convert $100$ to base $3.$

$100 = 3\cdot 33 + 1,$ $33 = 3\cdot 11 + 0,$ $11 = 3\cdot 3 + 2,$ $3 = 3\cdot 1 + 0,$ $1 = 3\cdot 0 + 1.$ Reading the remainders from the bottom up gives $10201_3.$ Check: $81 + 2\cdot 9 + 1 = 100.$ Answer: $10201_3.$

7. Convert $2000$ to hexadecimal.

$2000 = 16\cdot 125 + 0,$ $125 = 16\cdot 7 + 13$ and $7 = 16\cdot 0 + 7,$ with $13 = \mathrm{D}.$ Reading the remainders from the bottom up: $7,$ $\mathrm{D},$ $0.$ Check: ${7\cdot 256 + 13\cdot 16}={1792 + 208}={2000.}$ Answer: $\mathrm{7D0}_{16}.$

8. Convert $11010111_2$ to octal and to hexadecimal.

$011\ 010\ 111_2 = 327_8$ and $1101\ 0111_2 = \mathrm{D7}_{16};$ both equal $215.$ Answer: $327_8$ and $\mathrm{D7}_{16}.$

9. Convert $\mathrm{3B}_{16}$ and $57_8$ to binary.

$\mathrm{3B}_{16} = 0011\ 1011_2$ and $57_8 = 101\ 111_2.$ Answer: $111011_2$ and $101111_2.$

10. Add $1011_2 + 1101_2.$

From the right: $1 + 1 = 10_2,$ write $0$ and carry $1;$ $1 + 0 + 1 = 10_2,$ write $0$ and carry $1;$ $0 + 1 + 1 = 10_2,$ write $0$ and carry $1;$ $1 + 1 + 1 = 11_2,$ write $1$ and carry $1.$ Check: $11 + 13 = 24 = 16 + 8.$ Answer: $11000_2.$

11. Subtract $10010_2 - 1011_2.$

From the right: $0 - 1$ borrows from the second place: $10_2 - 1 = 1.$ Now the second column is $0 - 1,$ and the third and fourth places are $0,$ so borrow from the fifth: it becomes $0,$ the fourth and third places become $1,$ and the second column gives $10_2 - 1 = 1.$ Then $1 - 0 = 1,$ $1 - 1 = 0,$ $0 - 0 = 0.$ Check: $18 - 11 = 7.$ Answer: $111_2.$

12. Multiply $1111_2\cdot 111111_2$ and check the result in decimal.

The rows are $111111_2$ shifted by $0,$ $1,$ $2$ and $3$ places. Add them two at a time: ${111111_2 + 1111110_2}={10111101_2,}$ ${10111101_2}+{11111100_2}={110111001_2,}$ ${110111001_2}+{111111000_2}={1110110001_2.}$ Check: $1111_2 = 15,$ $111111_2 = 63$ and ${15\cdot 63}={945}={512 + 256 + 128}+{32 + 16 + 1.}$ Answer: $1110110001_2.$

13. Divide $11110000010_2 \div 11111_2$ and check the result in decimal.

$11110000010_2 = 1922,$ $11111_2 = 31$ and ${1922\div 31}={62}={32 + 16 + 8 + 4 + 2.}$ Answer: $111110_2.$

14. Convert $0.375$ and $0.8$ to binary.

$0.375\cdot 2 = 0.75,$ $0.75\cdot 2 = 1.5,$ $0.5\cdot 2 = 1,$ so $0.375 = 0.011_2.$ For $0.8\text{:}$ $0.8\cdot 2 = 1.6,$ $0.6\cdot 2 = 1.2,$ $0.2\cdot 2 = 0.4,$ $0.4\cdot 2 = 0.8,$ and $0.8$ comes back. Answer: $0.011_2$ and $0.\overline{1100}_2.$

15. Which fractions are $0.\overline{1}_2$ and $0.\overline{011}_2?$

For $x = 0.\overline{1}_2\text{:}$ $2x = 1.\overline{1}_2 = 1 + x,$ so $x = 1,$ just as $0.\overline{9} = 1$ in decimal. For $y = 0.\overline{011}_2\text{:}$ $8y = 11.\overline{011}_2 = 3 + y,$ so $7y = 3.$ Answer: $1$ and $\frac{3}{7}.$

16. In which base is $13 + 5 = 20$ true?

In base $b$ this means $(b + 3) + 5 = 2b,$ so $b = 8.$ Check: $13_8 = 11,$ $11 + 5 = 16 = 20_8.$ Answer: in base $8.$

17. How many different numbers can be written with $10$ bits, and which is the largest of them?

Each bit is $0$ or $1,$ so there are $2^{10} = 1024$ numbers, from $0$ to $1111111111_2 = 2^{10} - 1.$ Answer: $1024$ numbers, the largest is $1023.$

See also: Roman numerals · exponents · divisibility

Feedback   Contact email:
Follow us on   X   Facebook
  Math10 Banners   Math History  
Copyright © 2005 - 2026