Binary and Decimal Conversion
students, every time you use a phone, play a game, or save a file, a computer is working with numbers behind the scenes π±π». One of the most important ideas in computer science is that computers store and process information using binary, while people usually count in decimal. In this lesson, you will learn how these two number systems work, how to convert between them, and why this skill matters in IB Computer Science SL System Fundamentals.
Lesson Objectives
By the end of this lesson, students, you should be able to:
- Explain the main ideas and terminology behind binary and decimal conversion.
- Convert numbers from decimal to binary and from binary to decimal.
- Use place value to show how binary works.
- Connect binary conversion to data representation and system fundamentals.
- Understand why binary is essential in computer systems.
Why Computers Use Binary
Humans usually use the decimal system, which is based on $10$. That means each place value represents powers of $10$, such as $1$, $10$, $100$, and so on. For example, the number $347$ means:
$$347 = 3 \times 10^2 + 4 \times 10^1 + 7 \times 10^0$$
Computers, however, use the binary system, which is based on $2$. Binary has only two digits: $0$ and $1$. Each place value represents powers of $2$, such as $1$, $2$, $4$, $8$, $16$, and so on.
Why does this matter? Inside a computer, data is stored using electronic signals. A signal can be interpreted as being in one of two states, such as on/off or high/low voltage. These two states fit perfectly with $0$ and $1$. This is why binary is the foundation of digital systems π.
Binary is not just a math topic. It is a key part of how a CPU processes instructions, how memory stores data, and how devices communicate. Understanding binary helps students understand how computers represent text, images, sound, and numbers in System Fundamentals.
Binary Place Value
Binary uses place value just like decimal, but the powers are different. In decimal, the places are powers of $10$. In binary, the places are powers of $2$.
For example, the binary number $1011$ means:
$$1011_2 = 1 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 1 \times 2^0$$
So:
$$1011_2 = 8 + 0 + 2 + 1 = 11_{10}$$
This is read as β$1011$ in base $2$ equals $11$ in base $10$.β The subscript shows the base of the number system.
A useful way to remember binary place values is to write them out from right to left:
$$1,\ 2,\ 4,\ 8,\ 16,\ 32,\ 64,\ 128$$
Each new place is double the previous one. This doubling pattern is very important in computer science because it helps with memory sizes, data ranges, and binary counting.
Example: Reading a Binary Number
Letβs convert $11010_2$ into decimal.
Match each digit with its place value:
$$11010_2 = 1 \times 2^4 + 1 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 0 \times 2^0$$
$$11010_2 = 16 + 8 + 0 + 2 + 0 = 26_{10}$$
So the decimal value is $26$.
Decimal to Binary Conversion
students, one of the most common exam skills is converting from decimal to binary. A reliable method is repeated division by $2$.
Method: Repeated Division by 2
- Divide the decimal number by $2$.
- Write down the remainder, which will be either $0$ or $1$.
- Keep dividing the quotient by $2$ until the quotient is $0$.
- Read the remainders from bottom to top.
Example: Convert $13_{10}$ to Binary
Divide by $2$ repeatedly:
- $13 \div 2 = 6$ remainder $1$
- $6 \div 2 = 3$ remainder $0$
- $3 \div 2 = 1$ remainder $1$
- $1 \div 2 = 0$ remainder $1$
Read the remainders upward:
$$13_{10} = 1101_2$$
Check it:
$$1 \times 2^3 + 1 \times 2^2 + 0 \times 2^1 + 1 \times 2^0 = 8 + 4 + 0 + 1 = 13$$
Example: Convert $42_{10}$ to Binary
- $42 \div 2 = 21$ remainder $0$
- $21 \div 2 = 10$ remainder $1$
- $10 \div 2 = 5$ remainder $0$
- $5 \div 2 = 2$ remainder $1$
- $2 \div 2 = 1$ remainder $0$
- $1 \div 2 = 0$ remainder $1$
Read upward:
$$42_{10} = 101010_2$$
This pattern shows why binary numbers often look longer than decimal numbers. Binary needs more digits to represent the same value because it only uses two symbols.
Binary to Decimal Conversion
Converting from binary to decimal is usually done using place value. This method is straightforward and very useful in exams.
Method: Place Value Addition
- Write the binary number.
- Label the place values from right to left as powers of $2$.
- Multiply each binary digit by its place value.
- Add the results.
Example: Convert $100101_2$ to Decimal
Write the place values:
$$100101_2 = 1 \times 2^5 + 0 \times 2^4 + 0 \times 2^3 + 1 \times 2^2 + 0 \times 2^1 + 1 \times 2^0$$
$$100101_2 = 32 + 0 + 0 + 4 + 0 + 1 = 37_{10}$$
So $100101_2 = 37_{10}$.
Example: Convert $111111_2$ to Decimal
$$111111_2 = 1 \times 2^5 + 1 \times 2^4 + 1 \times 2^3 + 1 \times 2^2 + 1 \times 2^1 + 1 \times 2^0$$
$$111111_2 = 32 + 16 + 8 + 4 + 2 + 1 = 63_{10}$$
This number is useful to remember because it shows a common pattern: a string of six $1$s in binary equals $63$ in decimal.
Why Conversion Skills Matter in System Fundamentals
Binary and decimal conversion connects to several parts of the IB Computer Science SL System Fundamentals topic.
Data Representation
All data in a computer is ultimately stored in binary. Numbers, text, images, and sound are encoded using bits. A bit is a binary digit, either $0$ or $1$. Eight bits make one byte. These units help describe storage and memory size.
For example, if a file size is measured in bytes, those bytes are still stored internally as binary patterns. Understanding conversion helps students understand how data is represented and why there are limits to how much information a device can store.
Memory and Storage
Computer memory addresses and storage capacities are based on powers of $2$. Common sizes such as $256$, $1024$, and $4096$ are related to binary because they are powers of $2$. For example:
$$1024 = 2^{10}$$
This is why memory sizes often come in values that are easy to describe using binary thinking.
Processing and Logic
The CPU performs calculations using binary logic. Operations in the ALU, or arithmetic logic unit, are designed around binary values. Even though users see decimal numbers on the screen, the computer is internally working with binary data.
Communication and Networking
Data sent across networks is broken into binary signals. Whether a message is being transmitted through Wi-Fi or stored on a hard drive, the underlying format depends on binary representation.
Common Mistakes and How to Avoid Them
students, binary conversion is simple once you know the rules, but a few mistakes happen often:
- Forgetting place values: Always start from the right with $2^0$.
- Reading remainders in the wrong order: In decimal to binary conversion, read remainders from bottom to top.
- Missing a zero placeholder: Every binary digit matters, even $0$ in the middle of a number.
- Mixing up bases: Use subscripts like $2$ and $10$ to show which number system you mean.
A good habit is to check your answer by converting back the other way. If both conversions match, your answer is likely correct β .
Practice Example
Try this one with students in mind:
Convert $25_{10}$ to binary.
Repeated division:
- $25 \div 2 = 12$ remainder $1$
- $12 \div 2 = 6$ remainder $0$
- $6 \div 2 = 3$ remainder $0$
- $3 \div 2 = 1$ remainder $1$
- $1 \div 2 = 0$ remainder $1$
Read upward:
$$25_{10} = 11001_2$$
Now check it:
$$1 \times 2^4 + 1 \times 2^3 + 0 \times 2^2 + 0 \times 2^1 + 1 \times 2^0 = 16 + 8 + 0 + 0 + 1 = 25$$
That check confirms the conversion.
Conclusion
Binary and decimal conversion is one of the most important early skills in IB Computer Science SL. It helps students understand how computers store and process data, why digital systems use two states, and how binary supports memory, storage, logic, and communication. Decimal is convenient for people, but binary is essential for machines. When you can move confidently between the two, you gain a stronger understanding of System Fundamentals and of how real computer systems work.
Study Notes
- Decimal is base $10$ and binary is base $2$.
- Binary uses only $0$ and $1$.
- Binary place values are powers of $2$: $1$, $2$, $4$, $8$, $16$, and so on.
- To convert binary to decimal, multiply each digit by its place value and add the results.
- To convert decimal to binary, repeatedly divide by $2$ and read the remainders from bottom to top.
- A bit is one binary digit, and a byte is $8$ bits.
- Computers use binary because electronic circuits naturally work with two states.
- Binary conversion is important for data representation, memory, storage, processing, and networking.
- Always label the base using subscripts such as $1101_2$ and $13_{10}$.
- Checking answers by converting back is a reliable way to reduce mistakes.
