Arithmetic in Different Number Bases

Explore arithmetic in different number bases, conversions, and operations like addition, subtraction, multiplication, and division. Master this key concept for students.

Number bases are fundamental to how we represent quantities, and while the decimal system (base 10) is ubiquitous, understanding arithmetic in different number bases is crucial for various fields, including computer science. This guide will explore the principles behind different number bases, how to convert between them, and how to perform basic arithmetic operations like addition, subtraction, multiplication, and division in non-decimal systems. Mastering these concepts provides a deeper insight into the structure of numbers.

Understanding Number Bases: An Introduction

A number base, or radix, determines the number of unique digits and the foundational value for each position in a number. The familiar decimal system uses ten digits (0-9) and powers of 10 for place values. For instance, the number 8,904 can be expressed as $8 \cdot 10^3 + 9 \cdot 10^2 + 0 \cdot 10^1 + 4 \cdot 10^0$. This is a positional system, meaning the value of a digit depends on its position (e.g., 42 is not equal to 24).

Early Learning of Decimal System Concepts

Children are introduced to the decimal system through manipulative activities at an early age. For example, in first grade, they might group 13 buttons into one pile of ten and three leftover buttons, understanding 1 'ten' and 3 'ones' (13). In higher grades, this extends to numbers up to 100, 1,000, and beyond, using bundles of sticks, paper clips, or even play money to represent tens, hundreds, and thousands. Estimation is also a key skill taught alongside these concepts.

General Definition of a Number Base

For any natural number z greater than 1, any natural number a (where $a \geq 1$) can be uniquely expressed in the form:

$a = a_n \cdot z^n + a_{n-1} \cdot z^{n-1} + \dots + a_2 \cdot z^2 + a_1 \cdot z^1 + a_0 \cdot z^0$

This is known as the expansion of number a in base z. The digits $a_i$ must be less than z ($0 \leq a_i < z$), and $a_n \neq 0$. Common bases include:

  • Base 2 (Binary): Digits 0, 1
  • Base 8 (Octal): Digits 0-7
  • Base 16 (Hexadecimal): Digits 0-9, A-F (where A=10, B=11, etc.)

Numbers in non-decimal bases are typically denoted with a subscript, like $101_2$ (binary) or $154_6$ (base 6), whereas decimal numbers usually omit the subscript.

Converting Between Number Bases

Converting numbers between different bases is a fundamental skill. Let's explore the common methods.

Converting from a Non-Decimal Base to Decimal

To convert a number from any base z to decimal (base 10), use the expanded form by summing the products of each digit and the base z raised to the power of its position (starting from 0 on the right).

Examples:

  • $2012_3$ to Decimal: $2 \cdot 3^3 + 0 \cdot 3^2 + 1 \cdot 3^1 + 2 \cdot 3^0 = 2 \cdot 27 + 0 \cdot 9 + 1 \cdot 3 + 2 \cdot 1 = 54 + 0 + 3 + 2 = 59_{10}$

  • $110110_2$ to Decimal: $1 \cdot 2^5 + 1 \cdot 2^4 + 0 \cdot 2^3 + 1 \cdot 2^2 + 1 \cdot 2^1 + 0 \cdot 2^0 = 32 + 16 + 0 + 4 + 2 + 0 = 54_{10}$

  • $135_6$ to Decimal: $1 \cdot 6^2 + 3 \cdot 6^1 + 5 \cdot 6^0 = 1 \cdot 36 + 3 \cdot 6 + 5 \cdot 1 = 36 + 18 + 5 = 59_{10}$

Converting from Decimal to a Non-Decimal Base

There are two primary methods for converting from decimal to a non-decimal base.

Method 1: Repeated Division (Euclidean Algorithm)

This method involves repeatedly dividing the decimal number by the target base and recording the remainders. The new number is formed by reading the remainders from bottom to top.

Example: Convert $85_{10}$ to Base 2 (Binary)

  1. $85 \div 2 = 42$ remainder 1
  2. $42 \div 2 = 21$ remainder 0
  3. $21 \div 2 = 10$ remainder 1
  4. $10 \div 2 = 5$ remainder 0
  5. $5 \div 2 = 2$ remainder 1
  6. $2 \div 2 = 1$ remainder 0
  7. $1 \div 2 = 0$ remainder 1

Reading remainders from bottom to top: $1010101_2$. So, $85_{10} = 1010101_2$.

Example: Convert $112_{10}$ to Base 2 (Binary)

  1. $112 \div 2 = 56$ remainder 0
  2. $56 \div 2 = 28$ remainder 0
  3. $28 \div 2 = 14$ remainder 0
  4. $14 \div 2 = 7$ remainder 0
  5. $7 \div 2 = 3$ remainder 1
  6. $3 \div 2 = 1$ remainder 1
  7. $1 \div 2 = 0$ remainder 1

Result: $1110000_2$. So, $112_{10} = 1110000_2$.

Method 2: Grouping (for primary school instruction)

This hands-on method helps visualize the conversion process. It involves grouping items into powers of the target base.

Example: Convert $13_{10}$ to Base 2 (Binary)

Imagine 13 buttons. We group them by powers of 2 (8s, 4s, 2s, 1s).

  • How many groups of 8? One group. (1 button left)
  • How many groups of 4? One group. (13 - 8 = 5 remaining, 5 - 4 = 1 left)
  • How many groups of 2? Zero groups. (1 remaining)
  • How many groups of 1? One group. (1 remaining)

This gives us $1 \cdot 8 + 1 \cdot 4 + 0 \cdot 2 + 1 \cdot 1 = 1101_2$. So, $13_{10} = 1101_2$.

Converting Between Two Non-Decimal Bases

To convert a number from base $z_1 \neq 10$ to base $z_2 \neq 10$, it's usually easiest to first convert the number to decimal, and then convert the decimal result to base $z_2$.

However, if $z_2 = z_1^k$ or $z_1 = z_2^k$ (i.e., one base is a power of the other), a shortcut exists:

Example: Convert $223112_4$ to Base 2 (Binary)

Since $4 = 2^2$, each digit in base 4 corresponds to two binary digits. Convert each base 4 digit to its 2-digit binary equivalent:

  • $2_4 = 10_2$
  • $3_4 = 11_2$
  • $1_4 = 01_2$

Concatenate these: $223112_4 = 101011010110_2$.

Example: Convert $223112_4$ to Base 16 (Hexadecimal)

Since $16 = 4^2$, group the base 4 digits in pairs from the right, and convert each pair to its base 16 equivalent:

  • $12_4 = 1 \cdot 4^1 + 2 \cdot 4^0 = 4 + 2 = 6_{10} = 6_{16}$
  • $31_4 = 3 \cdot 4^1 + 1 \cdot 4^0 = 12 + 1 = 13_{10} = D_{16}$
  • $22_4 = 2 \cdot 4^1 + 2 \cdot 4^0 = 8 + 2 = 10_{10} = A_{16}$

Concatenate these: $223112_4 = AD6_{16}$.

Arithmetic in Different Number Bases

Performing arithmetic operations in non-decimal bases follows similar algorithms to decimal arithmetic, but requires knowledge of the base's addition and multiplication tables. Carries and borrows are performed based on the base value z instead of 10.

1. Addition in Different Number Bases

To add numbers in a base z, you perform column addition as usual, but when a sum in a column exceeds z-1, you carry over the 'extra' amount divided by z to the next column. It's helpful to create an addition table for the specific base if you are unfamiliar.

Example: $1234_5 + 344_5$

Here's an addition table for base 5:

+01234
001234
1123410
22341011
334101112
4410111213
 1234_5
+ 344_5
--------
  1. Rightmost column (ones place): $4_5 + 4_5 = 13_5$ (from table). Write down 3, carry over 1.
  2. Next column: $3_5 + 4_5 + 1_5$ (carry) $= 12_5 + 1_5 = 13_5$. Write down 3, carry over 1.
  3. Next column: $2_5 + 3_5 + 1_5$ (carry) $= 10_5 + 1_5 = 11_5$. Write down 1, carry over 1.
  4. Leftmost column: $1_5 + 1_5$ (carry) $= 2_5$. Write down 2.

Result: $1234_5 + 344_5 = 2133_5$.

2. Subtraction in Different Number Bases

Subtraction also follows the familiar column method. If a digit in the minuend is smaller than the corresponding digit in the subtrahend, you 'borrow' from the next higher place value. When you borrow 1 from a column, it adds z (the base) to the current column's digit.

Example: $2330_4 - 103_4$

Here's an addition table for base 4 (useful for understanding borrowing by 'counting up'):

+0123
00123
112310
2231011
33101112
 2330_4
- 103_4
--------
  1. Rightmost column (ones place): $0_4 - 3_4$. Borrow from the 3 in the fours place. The 0 becomes $0+4=4_4$. So, $4_4 - 3_4 = 1_4$.
  2. Next column (fours place): The 3 became 2 due to the borrow. $2_4 - 0_4 = 2_4$.
  3. Next column (sixteens place): $3_4 - 1_4 = 2_4$.
  4. Leftmost column: $2_4 - 0_4 = 2_4$.

Result: $2330_4 - 103_4 = 2221_4$.

3. Multiplication in Different Number Bases

Multiplication is performed using a similar algorithm to decimal multiplication, often relying on a multiplication table for the base and then adding the partial products.

Example: $44231_6 \cdot 4_6$

Here's a multiplication table for base 6:

$\cdot$012345
0000000
1012345
2024101214
30310132023
40412202432
50514233241
 44231_6
$\times$ 4_6
----------
  1. $4_6 \cdot 1_6 = 4_6$.
  2. $4_6 \cdot 3_6 = 20_6$. Write down 0, carry over 2.
  3. $4_6 \cdot 2_6 = 12_6$. Add carry-over: $12_6 + 2_6 = 14_6$. Write down 4, carry over 1.
  4. $4_6 \cdot 4_6 = 24_6$. Add carry-over: $24_6 + 1_6 = 25_6$. Write down 5, carry over 2.
  5. $4_6 \cdot 4_6 = 24_6$. Add carry-over: $24_6 + 2_6 = 30_6$. Write down 30.

Result: $44231_6 \cdot 4_6 = 305404_6$.

4. Division in Different Number Bases

Division in non-decimal bases uses a long division algorithm, much like decimal division. It requires finding partial quotients by referencing the multiplication table of the given base.

Example: $12345_6 \div 5_6$

Using the multiplication table for base 6 (from above):

  1. $12_6 \div 5_6$: Look for the largest multiple of $5_6$ less than or equal to $12_6$. $1 \cdot 5_6 = 5_6$. The quotient is 1. Subtract $12_6 - 5_6 = 3_6$. (Think: how much is 5 from 12? From $5_6$ to $12_6$ is $3_6$).
  2. Bring down the next digit (3) to make $33_6$. $33_6 \div 5_6$: The largest multiple of $5_6$ less than or equal to $33_6$ is $32_6$ ($4_6 \cdot 5_6 = 32_6$). The quotient is 4. Subtract $33_6 - 32_6 = 1_6$.
  3. Bring down the next digit (4) to make $14_6$. $14_6 \div 5_6$: The largest multiple of $5_6$ less than or equal to $14_6$ is $14_6$ ($2_6 \cdot 5_6 = 14_6$). The quotient is 2. Subtract $14_6 - 14_6 = 0_6$.
  4. Bring down the next digit (5) to make $05_6$. $05_6 \div 5_6$: $1_6 \cdot 5_6 = 5_6$. The quotient is 1. Subtract $05_6 - 5_6 = 0_6$.

Result: $12345_6 \div 5_6 = 1421_6$ with a remainder of 0.

FAQ: Common Questions About Number Bases

What are number bases and why are they important?

Number bases are systems for representing numbers using a specific count of unique digits, including zero, and a base value for place values. They are important because they are foundational to computer science (binary, hexadecimal), data representation, and provide a deeper understanding of arithmetic principles by illustrating that our familiar decimal system is just one way to count and calculate.

How do you convert a decimal number to a non-decimal base?

The most common method is repeated division. You repeatedly divide the decimal number by the target base, recording the remainder at each step. The sequence of remainders, read from bottom to top, forms the number in the new base.

Can you perform addition and subtraction in any number base?

Yes, addition and subtraction (and all other arithmetic operations) can be performed in any number base. The algorithms are analogous to those used in the decimal system, but you must use the specific base's values for carrying over in addition and borrowing in subtraction instead of 10.

What is a positional number system?

A positional number system is one where the value of a digit depends on its position within the number. For example, in the number 234, the '2' represents 200, the '3' represents 30, and the '4' represents 4. Changing the position of digits changes the number's value (e.g., 234 is different from 432). This is in contrast to non-positional systems like Roman numerals.

Related topics