In the world of computers and digital electronics, the binary number system forms the very foundation of how data is represented and processed. Unlike the decimal system, which uses ten digits (0-9), the binary system uses only two digits: 0 and 1. These digits are called bits, short for binary digits.
Why only two digits? Because digital devices like computers operate using two voltage levels: low (0) and high (1). This makes binary the natural language of machines. Every piece of data, whether a number, letter, or image, is ultimately stored and manipulated as a sequence of bits.
Understanding binary is crucial not only for computer science but also for competitive exams that test your aptitude in computer fundamentals.
The binary system is a base-2 number system. This means each digit's place value is a power of 2, starting from the rightmost digit (least significant bit).
Let's understand place values in binary:
| Decimal | Binary | Place Values (2⁴ 2³ 2² 2¹ 2⁰) |
|---|---|---|
| 0 | 00000 | 0x16 + 0x8 + 0x4 + 0x2 + 0x1 = 0 |
| 1 | 00001 | 0 + 0 + 0 + 0 + 1 = 1 |
| 2 | 00010 | 0 + 0 + 0 + 2 + 0 = 2 |
| 3 | 00011 | 0 + 0 + 0 + 2 + 1 = 3 |
| 4 | 00100 | 0 + 0 + 4 + 0 + 0 = 4 |
| 5 | 00101 | 0 + 0 + 4 + 0 + 1 = 5 |
| 6 | 00110 | 0 + 0 + 4 + 2 + 0 = 6 |
| 7 | 00111 | 0 + 0 + 4 + 2 + 1 = 7 |
| 8 | 01000 | 0 + 8 + 0 + 0 + 0 = 8 |
| 9 | 01001 | 0 + 8 + 0 + 0 + 1 = 9 |
| 10 | 01010 | 0 + 8 + 0 + 2 + 0 = 10 |
| 11 | 01011 | 0 + 8 + 0 + 2 + 1 = 11 |
| 12 | 01100 | 0 + 8 + 4 + 0 + 0 = 12 |
| 13 | 01101 | 0 + 8 + 4 + 0 + 1 = 13 |
| 14 | 01110 | 0 + 8 + 4 + 2 + 0 = 14 |
| 15 | 01111 | 0 + 8 + 4 + 2 + 1 = 15 |
Each binary digit represents whether a particular power of 2 is included (1) or not (0) in the number. For example, binary 1011 means:
Converting between binary and decimal is a fundamental skill. Let's explore both directions.
graph TD A[Start] --> B{Conversion Type?} B -->|Binary to Decimal| C[Multiply each bit by 2^position and sum] B -->|Decimal to Binary| D[Divide decimal by 2 repeatedly, note remainders] C --> E[Sum all values] D --> F[Write remainders in reverse order] E --> G[Decimal number obtained] F --> H[Binary number obtained]To convert a binary number to decimal:
To convert a decimal number to binary, use the division-remainder method:
101101 to its decimal equivalent. Step 1: Write down the place values for each bit (from right to left):
Positions: 5 4 3 2 1 0
Place values: \(2^5=32\), \(2^4=16\), \(2^3=8\), \(2^2=4\), \(2^1=2\), \(2^0=1\)
Step 2: Write the bits of 101101:
1 0 1 1 0 1
Step 3: Multiply each bit by its place value:
Step 4: Add all the products:
32 + 0 + 8 + 4 + 0 + 1 = 45
Answer: Binary 101101 = Decimal 45
45 to its binary equivalent. Step 1: Divide 45 by 2 and note the quotient and remainder:
Step 2: Write the remainders in reverse order:
101101
Answer: Decimal 45 = Binary 101101
Just like decimal arithmetic, binary numbers can be added, subtracted, multiplied, and divided. However, the rules differ slightly because binary digits are only 0 or 1.
| Bit 1 | Bit 2 | Sum | Carry |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
| Minuend Bit | Subtrahend Bit | Difference | Borrow |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 (borrowed) |
Multiplication and division in binary follow the same logic as decimal but simplified due to digits being only 0 or 1.
1101 and 1011. Step 1: Write the numbers aligned:
1101+ 1011------
Step 2: Add bit by bit from right to left:
Step 3: Write down the carry:
1 (carry) 1101+ 1011------11000
Answer: 1101 + 1011 = 11000 (binary)
1010 from 1111. Step 1: Write the numbers aligned:
1111- 1010------
Step 2: Subtract bit by bit from right to left:
Answer: 1111 - 1010 = 0101 (binary) = 5 (decimal)
Binary numbers are closely linked to logic operations in digital electronics. The basic logic gates operate on binary inputs (0 or 1) and produce binary outputs.
Here are the three fundamental logic gates:
| Input A | Input B | AND | OR | NOT A |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
AND gate: Output is 1 only if both inputs are 1.
OR gate: Output is 1 if at least one input is 1.
NOT gate: Output is the inverse of the input.
Boolean algebra is the branch of algebra that deals with variables having two possible values: 0 (false) and 1 (true). It uses operations similar to logic gates.
Key Boolean operations:
Some common Boolean laws useful for simplification:
Step 1: Apply the Boolean law \( A + AB = A \).
Answer: The simplified expression is \( A \).
Binary numbers are everywhere in computing - from representing numbers, text, images, to controlling hardware through logic circuits. Simplifying Boolean expressions helps design efficient digital circuits, saving cost and power.
One powerful tool for simplification is the Karnaugh map (K-map), which visually groups terms to minimize logic expressions.
Step 1: Plot the 1s on the K-map at positions 0,1,3,7.
Step 2: Group adjacent 1s in powers of two (groups of 2 or 4).
Step 3: Derive simplified terms from each group.
Step 4: Combine terms to get the minimal expression.
Answer: The simplified expression is \( A'B' + AB \).
110011 to decimal. Step 1: Assign place values:
Positions: 5 4 3 2 1 0
Place values: \(2^5=32\), \(2^4=16\), \(2^3=8\), \(2^2=4\), \(2^1=2\), \(2^0=1\)
Step 2: Multiply bits by place values:
Step 3: Add all:
32 + 16 + 0 + 0 + 2 + 1 = 51
Answer: Binary 110011 = Decimal 51
1010 and 111. Step 1: Align the numbers:
1010+ 0111-----
Step 2: Add bit by bit from right:
Step 3: Write carry:
1 (carry) 1010+0111-----10001
Answer: 1010 + 111 = 10001 (binary)
100 to binary. Step 1: Divide repeatedly by 2:
Step 2: Write remainders in reverse:
1100100
Answer: Decimal 100 = Binary 1100100
Step 1: Apply Boolean law \( A + A'B = A + B \).
Answer: The simplified expression is \( A + B \).
When to use: When converting decimal numbers to binary quickly.
When to use: During binary arithmetic operations in exams.
When to use: To simplify Boolean expressions efficiently.
When to use: While converting binary to decimal.
When to use: When solving logic gate and Boolean algebra problems.
Progress tracking is paywalled — subscribe to mark subtopics as understood and save your streak.
Go to practice →