What Is the Binary Number System?
The binary number system is a way of counting that uses only two digits: 0 and 1. Every number, letter, image, sound and video stored or processed by a computer is ultimately represented using only these two digits.
The number system we use in everyday life is called the decimal system (also called base 10), because it uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Binary is called base 2 because it uses only two digits.
Binary was not invented for computers โ it has been studied by mathematicians for centuries. But it became the foundation of modern computing because electronic circuits have exactly two stable states: on (represented as 1) and off (represented as 0). This makes binary the natural language of all digital electronics.
Key fact: A single binary digit (a 0 or a 1) is called a bit, which is short for binary digit. Eight bits together form a byte. Your phone's storage is measured in gigabytes โ billions of bytes โ all made up of individual 0s and 1s.
Why Do Computers Use Binary?
You might wonder: why not build computers that use the decimal system like humans do? The reason is physical. Inside every computer, data is stored and processed using tiny electronic switches called transistors. A transistor has two states โ it is either conducting electricity (on) or not conducting electricity (off). These two states map perfectly to 1 and 0.
If we tried to build a decimal computer, we would need transistors that could reliably hold ten different voltage levels โ one for each digit from 0 to 9. This is extremely difficult to do reliably, especially at the billions-per-second speeds modern computers operate at. Binary is robust, fast and error-resistant, which is why it has been the foundation of computing since the first electronic computers in the 1940s.
Everything a computer does โ running an application, displaying a webpage, playing a video, storing a photograph โ is ultimately just billions of transistors switching between on and off, billions of times per second.
Place Values in Binary
In the decimal system, each digit position represents a power of 10. The rightmost digit is the ones place (10โฐ = 1), the next is the tens place (10ยน = 10), then hundreds (10ยฒ = 100), and so on.
In binary, each digit position represents a power of 2 instead. The rightmost position is 2โฐ = 1, the next is 2ยน = 2, then 2ยฒ = 4, 2ยณ = 8, 2โด = 16, 2โต = 32, 2โถ = 64, and 2โท = 128.
This is the bit position table you need to memorise for KCSE Computer Studies:
When a binary digit in a particular position is 1, you include that position's value in the total. When it is 0, you do not. This is the key rule for all binary-to-decimal conversions.
Converting Binary to Decimal
To convert a binary number to decimal, write out the bit positions, place the binary digits under their positions, then add up the values of all positions that have a 1.
Worked Example 1 โ Convert 1011โ to decimal
Answer: 1011โ = 11โโ
Worked Example 2 โ Convert 10110100โ to decimal
Answer: 10110100โ = 180โโ
Worked Example 3 โ Convert 11111111โ to decimal
Answer: 11111111โ = 255โโ โ this is the maximum value of one byte
Converting Decimal to Binary
To convert a decimal number to binary, use the repeated division by 2 method. Divide the number by 2, write down the remainder (0 or 1), then divide the quotient by 2 again. Repeat until the quotient reaches 0. The binary number is the remainders read from bottom to top.
Worked Example 4 โ Convert 25โโ to binary
Answer: 25โโ = 11001โ
Verify: (1ร16)+(1ร8)+(0ร4)+(0ร2)+(1ร1) = 16+8+1 = 25 โ
Worked Example 5 โ Convert 200โโ to binary
Answer: 200โโ = 11001000โ
Binary Addition
Binary addition follows the same rules as decimal addition, but with only two digits. The rules are:
- 0 + 0 = 0
- 0 + 1 = 1
- 1 + 0 = 1
- 1 + 1 = 10 (write 0, carry 1)
- 1 + 1 + 1 = 11 (write 1, carry 1)
Worked Example 6 โ Add 1011โ + 0110โ
Answer: 1011โ + 0110โ = 10001โ (= 11 + 6 = 17 โ)
Binary and Data Storage
Understanding binary helps you understand how computers measure and store data. The units of storage are all based on powers of 2:
| Unit | Symbol | Size | Approximate Value |
|---|---|---|---|
| Bit | b | 1 binary digit (0 or 1) | โ |
| Nibble | โ | 4 bits | โ |
| Byte | B | 8 bits | One character (e.g. the letter A) |
| Kilobyte | KB | 1,024 bytes | A short text message |
| Megabyte | MB | 1,024 KB | A digital photograph |
| Gigabyte | GB | 1,024 MB | About 250 songs |
| Terabyte | TB | 1,024 GB | A large hard drive |
Note that storage units use powers of 2 (1,024 = 2ยนโฐ) rather than powers of 10 (1,000). This is a common source of confusion โ a hard drive manufacturer may advertise a "1 TB" drive using 1,000,000,000,000 bytes, but your operating system will show slightly less because it uses the binary definition (1,099,511,627,776 bytes = 1 TB).
Binary and ASCII โ How Text Is Stored
Every letter, number and symbol you type on a keyboard is stored in the computer as a binary number. The ASCII (American Standard Code for Information Interchange) system assigns a number to each character, which is then stored in binary.
For example: the letter A has ASCII code 65, which in binary is 01000001. The letter a (lowercase) has ASCII code 97, which in binary is 01100001. The digit 0 (the character, not the number) has ASCII code 48 = 00110000.
This means when you type the word "Hello" and save it in a file, the computer actually stores five bytes of binary data โ one byte per character โ each representing an ASCII code.
Common Mistakes to Avoid
- Reading binary left to right instead of right to left. Always start assigning bit position values from the rightmost digit (position 2โฐ = 1).
- Forgetting the carry in binary addition. When two 1s are added, the result is 10 (binary) โ you must carry the 1 to the next column.
- Confusing the subscript. Always write the base as a subscript to avoid confusion: 1011โ means binary, 1011โโ means decimal. They are very different numbers.
- Not padding to 8 bits. When writing a binary byte, always use 8 digits, padding with leading zeros if necessary. So 25 in binary is written as 00011001, not just 11001.
KCSE Examination Tips
Binary number conversions appear regularly in KCSE Computer Studies Paper 1. Here is what to focus on:
- Memorise the 8 bit position values: 128, 64, 32, 16, 8, 4, 2, 1.
- Always show your working โ the division table for decimal-to-binary or the addition of bit position values for binary-to-decimal.
- Practice binary addition carefully, paying special attention to the carry digit.
- Know the relationships: 1 byte = 8 bits, 1 KB = 1024 bytes, 1 MB = 1024 KB.
- Know ASCII codes for A (65), a (97), 0 (48) and be able to explain why uppercase letters have lower codes than lowercase letters.
๐ฎ Test Your Binary Knowledge
Practice binary-to-decimal conversion with instant feedback in our free interactive game.
Play Binary Explorer โSummary
Binary is the base-2 number system using only 0 and 1. Computers use binary because transistors have two stable states (on/off). Each bit position represents a power of 2 (from right: 1, 2, 4, 8, 16, 32, 64, 128). To convert binary to decimal, add the values of positions with a 1. To convert decimal to binary, repeatedly divide by 2 and read remainders upward. Eight bits make one byte, which is the basic unit of data storage and can represent numbers from 0 to 255.