👁 Preview — Study, Practice and Revise are open; mock tests and the rest of the syllabus unlock on subscription. Unlock all · ₹4,999
← Back to Number Systems & Logic
Study mode

Binary

Introduction to Binary Number System

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.

Binary Number System

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:

Binary Place Values and Decimal Equivalents (0 to 15)
Decimal Binary Place Values (2⁴ 2³ 2² 2¹ 2⁰)
0000000x16 + 0x8 + 0x4 + 0x2 + 0x1 = 0
1000010 + 0 + 0 + 0 + 1 = 1
2000100 + 0 + 0 + 2 + 0 = 2
3000110 + 0 + 0 + 2 + 1 = 3
4001000 + 0 + 4 + 0 + 0 = 4
5001010 + 0 + 4 + 0 + 1 = 5
6001100 + 0 + 4 + 2 + 0 = 6
7001110 + 0 + 4 + 2 + 1 = 7
8010000 + 8 + 0 + 0 + 0 = 8
9010010 + 8 + 0 + 0 + 1 = 9
10010100 + 8 + 0 + 2 + 0 = 10
11010110 + 8 + 0 + 2 + 1 = 11
12011000 + 8 + 4 + 0 + 0 = 12
13011010 + 8 + 4 + 0 + 1 = 13
14011100 + 8 + 4 + 2 + 0 = 14
15011110 + 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:

  • 1 x 2³ (8) + 0 x 2² (0) + 1 x 2¹ (2) + 1 x 2⁰ (1) = 8 + 0 + 2 + 1 = 11 (decimal)

Conversions Between Binary and Decimal

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]

Binary to Decimal Conversion

To convert a binary number to decimal:

  1. Write down the binary number.
  2. Assign powers of 2 to each bit, starting from 0 on the right.
  3. Multiply each bit by its corresponding power of 2.
  4. Add all the results to get the decimal equivalent.

Decimal to Binary Conversion

To convert a decimal number to binary, use the division-remainder method:

  1. Divide the decimal number by 2.
  2. Write down the remainder (0 or 1).
  3. Divide the quotient again by 2 and note the remainder.
  4. Repeat until the quotient is 0.
  5. The binary number is the remainders read in reverse order (from last to first).
Example 1: Convert Binary 101101 to Decimal Easy
Convert the binary number 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:

  • 1 x 32 = 32
  • 0 x 16 = 0
  • 1 x 8 = 8
  • 1 x 4 = 4
  • 0 x 2 = 0
  • 1 x 1 = 1

Step 4: Add all the products:

32 + 0 + 8 + 4 + 0 + 1 = 45

Answer: Binary 101101 = Decimal 45

Example 2: Convert Decimal 45 to Binary Easy
Convert the decimal number 45 to its binary equivalent.

Step 1: Divide 45 by 2 and note the quotient and remainder:

  • 45 / 2 = 22 remainder 1
  • 22 / 2 = 11 remainder 0
  • 11 / 2 = 5 remainder 1
  • 5 / 2 = 2 remainder 1
  • 2 / 2 = 1 remainder 0
  • 1 / 2 = 0 remainder 1

Step 2: Write the remainders in reverse order:

101101

Answer: Decimal 45 = Binary 101101

Binary Arithmetic Operations

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.

Binary Addition Rules
Bit 1Bit 2SumCarry
0000
0110
1010
1101
Binary Subtraction Rules
Minuend BitSubtrahend BitDifferenceBorrow
0000
1010
1100
0111 (borrowed)

Multiplication and division in binary follow the same logic as decimal but simplified due to digits being only 0 or 1.

Example 3: Add Binary Numbers 1101 and 1011 Medium
Add the binary numbers 1101 and 1011.

Step 1: Write the numbers aligned:

  1101+ 1011------

Step 2: Add bit by bit from right to left:

  • 1 + 1 = 0 (carry 1)
  • 0 + 1 + 1 (carry) = 0 (carry 1)
  • 1 + 0 + 1 (carry) = 0 (carry 1)
  • 1 + 1 (carry) = 0 (carry 1)

Step 3: Write down the carry:

 1  (carry)  1101+ 1011------11000

Answer: 1101 + 1011 = 11000 (binary)

Example 4: Subtract Binary Number 1010 from 1111 Medium
Subtract binary 1010 from 1111.

Step 1: Write the numbers aligned:

  1111- 1010------

Step 2: Subtract bit by bit from right to left:

  • 1 - 0 = 1
  • 1 - 1 = 0
  • 1 - 0 = 1
  • 1 - 1 = 0

Answer: 1111 - 1010 = 0101 (binary) = 5 (decimal)

Binary Logic and Truth Tables

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:

Truth Tables for Basic Logic Gates
Input AInput BANDORNOT A
00001
01011
10010
11110

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 Basics

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:

  • AND (·): \( A \cdot B \) is true if both A and B are true.
  • OR (+): \( A + B \) is true if either A or B is true.
  • NOT ('): \( A' \) is the complement or inverse of A.

Some common Boolean laws useful for simplification:

  • \( A + AB = A \)
  • \( A + A'B = A + B \)
  • \( A \cdot 1 = A \)
Boolean Operations: A = 1, B = 0 A AND B = 0 A OR B = 1 NOT A = 0
Example 5: Simplify Boolean Expression \( A + AB \) Easy
Simplify the Boolean expression \( A + AB \).

Step 1: Apply the Boolean law \( A + AB = A \).

Answer: The simplified expression is \( A \).

Applications of Binary and Simplification

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.

1 1 0 1 AB AB' CD C'D
Example 6: Simplify Logic Function Using K-map Hard
Given a 4-variable function with 1s in cells corresponding to minterms 0,1,3,7, simplify using a Karnaugh map.

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 \).

Formula Bank

Decimal to Binary Conversion
\[ \text{Divide the decimal number by 2 repeatedly and write remainders in reverse order.} \]
where: Decimal number (N)
Binary to Decimal Conversion
\[ \text{Decimal} = \sum_{i=0}^{n-1} b_i \times 2^i \]
where: \( b_i \) = binary digit (0 or 1) at position \( i \), \( n \) = number of bits
Binary Addition Rules
\[ 0+0=0, \quad 0+1=1, \quad 1+0=1, \quad 1+1=0 \text{ (carry 1)} \]
Binary digits (bits)
Boolean Algebra Laws
\[ A + AB = A, \quad A + A'B = A + B, \quad A \cdot 1 = A \]
A, B = Boolean variables, \( A' \) = NOT A
Example 7: Convert Binary 110011 to Decimal Easy
Convert binary number 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:

  • 1 x 32 = 32
  • 1 x 16 = 16
  • 0 x 8 = 0
  • 0 x 4 = 0
  • 1 x 2 = 2
  • 1 x 1 = 1

Step 3: Add all:

32 + 16 + 0 + 0 + 2 + 1 = 51

Answer: Binary 110011 = Decimal 51

Example 8: Add Binary Numbers 1010 and 111 Medium
Add binary numbers 1010 and 111.

Step 1: Align the numbers:

 1010+ 0111-----

Step 2: Add bit by bit from right:

  • 0 + 1 = 1
  • 1 + 1 = 0 (carry 1)
  • 0 + 1 + 1 (carry) = 0 (carry 1)
  • 1 + 0 + 1 (carry) = 0 (carry 1)

Step 3: Write carry:

1 (carry) 1010+0111-----10001

Answer: 1010 + 111 = 10001 (binary)

Example 9: Convert Decimal 100 to Binary Easy
Convert decimal number 100 to binary.

Step 1: Divide repeatedly by 2:

  • 100 / 2 = 50 remainder 0
  • 50 / 2 = 25 remainder 0
  • 25 / 2 = 12 remainder 1
  • 12 / 2 = 6 remainder 0
  • 6 / 2 = 3 remainder 0
  • 3 / 2 = 1 remainder 1
  • 1 / 2 = 0 remainder 1

Step 2: Write remainders in reverse:

1100100

Answer: Decimal 100 = Binary 1100100

Example 10: Simplify Boolean Expression \( A + A'B \) Easy
Simplify the Boolean expression \( A + A'B \).

Step 1: Apply Boolean law \( A + A'B = A + B \).

Answer: The simplified expression is \( A + B \).

Tips & Tricks

Tip: Use the division-remainder method for decimal to binary conversion.

When to use: When converting decimal numbers to binary quickly.

Tip: Memorize binary addition rules to speed up calculations.

When to use: During binary arithmetic operations in exams.

Tip: Group 1s in powers of two (1, 2, 4, 8) when using K-maps.

When to use: To simplify Boolean expressions efficiently.

Tip: Remember that binary place values double each step to the left.

When to use: While converting binary to decimal.

Tip: Use truth tables to verify logic gate outputs.

When to use: When solving logic gate and Boolean algebra problems.

Common Mistakes to Avoid

❌ Confusing binary place values with decimal place values.
✓ Always multiply each binary digit by 2 raised to its position index starting from 0 on the right.
Why: Students often apply base-10 place values to binary numbers, leading to incorrect conversions.
❌ Forgetting to carry over in binary addition when sum exceeds 1.
✓ Apply binary addition rules carefully and carry over when sum is 2 (which is 10 in binary).
Why: Binary addition differs from decimal addition and requires careful carry handling.
❌ Incorrect grouping in K-maps leading to wrong simplification.
✓ Group only adjacent 1s in powers of two (1, 2, 4, 8) and cover all 1s with minimum groups.
Why: Improper grouping results in non-minimal or incorrect Boolean expressions.
❌ Mixing up Boolean variables and their complements.
✓ Clearly distinguish between a variable (A) and its complement (A') and apply Boolean laws accordingly.
Why: Misinterpretation leads to incorrect simplifications.
❌ Skipping steps in conversion leading to errors.
✓ Follow stepwise methods for conversions without skipping intermediate steps.
Why: Rushing causes calculation mistakes.

Key Takeaways

  • Binary system uses only two digits: 0 and 1, representing powers of 2.
  • Conversions between binary and decimal rely on place values and division-remainder methods.
  • Binary arithmetic follows specific rules for addition, subtraction, multiplication, and division.
  • Logic gates operate on binary inputs and are the basis of Boolean algebra.
  • Simplification techniques like Boolean laws and K-maps optimize digital circuit design.
Key Takeaway:

Mastering binary concepts is essential for computer aptitude and digital electronics.

Curated videos per subtopic
Top YouTube explainers, AI-ranked for your exam and language. Unlocks with subscription.
Unlock

Try Practice next.

Progress tracking is paywalled — subscribe to mark subtopics as understood and save your streak.

Go to practice →
Ask a doubt
Binary · 10 free messages
Ask me anything about this subtopic. You have 10 free messages this session — chat history isn't saved in preview.