Class 11 Computer Science Unit 2 Number System & Boolean Logic Notes

NEB Class 11 • Computer Science

Unit 2: Number System and Boolean Logic

Complete NEB Class 11 Computer Science Unit 2 notes covering number systems, conversions, binary calculations, complements, Boolean algebra, logic gates and De Morgan’s theorems.

✓ NEB Syllabus ✓ Easy Explanation ✓ Solved Examples ✓ Exam Revision

Welcome to Nepal eNotes. In Unit 2, you will learn how computers represent numbers using binary, octal, decimal and hexadecimal number systems.

You will also learn binary addition and subtraction, one’s and two’s complement, Boolean algebra, logic gates, Boolean laws and De Morgan’s theorems.

A number system is a method of representing numbers using a fixed set of symbols and a specific base or radix.

Number System Base Digits Used Example
Decimal 10 0–9 245
Binary 2 0, 1 1101
Octal 8 0–7 372
Hexadecimal 16 0–9 and A–F 1F3
Hexadecimal Values:
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15

Decimal to Binary

To convert decimal to binary, repeatedly divide the decimal number by 2 and write the remainders. Read the remainders from bottom to top.

Example: Convert (25)₁₀ into Binary
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 Read from bottom to top: 11001 Therefore: (25)₁₀ = (11001)₂

Binary to Decimal

Multiply each binary digit by 2 raised to the power of its position, starting with power 0 from the right.

Example: Convert (1101)₂ into Decimal
1101 = (1 × 2³) + (1 × 2²) + (0 × 2¹) + (1 × 2⁰) = 8 + 4 + 0 + 1 = 13 Therefore: (1101)₂ = (13)₁₀

Decimal to Octal

Repeatedly divide the decimal number by 8 and read the remainders from bottom to top.

Example: Convert (100)₁₀ into Octal
100 ÷ 8 = 12 remainder 4 12 ÷ 8 = 1 remainder 4 1 ÷ 8 = 0 remainder 1 Read from bottom to top: 144 Therefore: (100)₁₀ = (144)₈

Decimal to Hexadecimal

Repeatedly divide the decimal number by 16. Remainders from 10 to 15 are represented by A to F.

Example: Convert (254)₁₀ into Hexadecimal
254 ÷ 16 = 15 remainder 14 = E 15 ÷ 16 = 0 remainder 15 = F Read from bottom to top: FE Therefore: (254)₁₀ = (FE)₁₆

Binary to Octal Shortcut

Since 8 = 2³, divide binary digits into groups of 3 bits starting from the right.

Binary: 101110 Group into 3 bits: 101 110 5 6 Therefore: (101110)₂ = (56)₈

Binary to Hexadecimal Shortcut

Since 16 = 2⁴, divide binary digits into groups of 4 bits starting from the right.

Binary: 101110 Add leading zeros: 0010 1110 0010 = 2 1110 = E Therefore: (101110)₂ = (2E)₁₆
Easy Rule:
Binary → Octal = Group in 3 bits
Binary → Hexadecimal = Group in 4 bits

Binary Addition Rules

A B Sum Carry
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1
Example: Add 1011 and 1101
1011 + 1101 ——- 11000 Therefore: 1011 + 1101 = 11000

Binary Subtraction Rules

A B Difference Borrow
0 0 0 0
1 0 1 0
1 1 0 0
0 1 1 1
Example: Subtract 0101 from 1110
1110 – 0101 ——- 1001 Therefore: 1110 – 0101 = 1001

One’s Complement

The one’s complement of a binary number is obtained by changing every 0 into 1 and every 1 into 0.

Original: 1010 Flip every bit: 0101 One’s Complement = 0101

Subtraction Using One’s Complement

To subtract using one’s complement:

  1. Find the one’s complement of the subtrahend.
  2. Add it to the minuend.
  3. If a carry is generated, add it back to the result.
Example: 1110 – 0101
One’s complement of 0101: 1010 Add: 1110 + 1010 ——- 11000 End-around carry: 1000 + 1 = 1001 Therefore: 1110 – 0101 = 1001

Two’s Complement

The two’s complement is obtained by finding the one’s complement and then adding 1.

Original: 1010 One’s complement: 0101 Add 1: 0101 + 1 —– 0110 Two’s Complement = 0110

Subtraction Using Two’s Complement

  1. Find the two’s complement of the subtrahend.
  2. Add it to the minuend.
  3. Discard the final carry if one is generated.
Example: 1110 – 0101
Two’s complement of 0101: One’s complement = 1010 Add 1: 1010 + 1 = 1011 Now add: 1110 + 1011 ——- 11001 Discard final carry: 1001 Therefore: 1110 – 0101 = 1001
Remember:
One’s complement → Flip all bits.
Two’s complement → Flip all bits + 1.

Introduction to Boolean Algebra

Boolean algebra is a branch of algebra in which variables can have only two possible values: True (1) or False (0).

Boolean algebra is used to analyze and simplify logical statements and digital circuits.

George Boole developed Boolean algebra. It forms an important mathematical foundation of digital computers.

Boolean Values

A Boolean value can have only two states:

  • True = 1
  • False = 0

These can represent conditions such as ON/OFF, YES/NO or HIGH/LOW.

Truth Table

A truth table shows all possible input combinations of a Boolean expression together with the corresponding output.

Boolean Expression

A Boolean expression combines Boolean variables using operators such as AND, OR and NOT.

Example:
Y = A.B + C

Y becomes true when A AND B are true, or when C is true.

Boolean Function

A Boolean function accepts one or more Boolean inputs and produces one Boolean output.

A logic gate is a basic building block of digital circuits that accepts binary input and produces binary output.

AND Gate

Output is 1 only when all inputs are 1.

Y = A.B

ABY
000
010
100
111

OR Gate

Output is 1 when at least one input is 1.

Y = A + B

ABY
000
011
101
111

NOT Gate

The NOT gate reverses the input.

Y = A’

AY
01
10

NAND Gate

NAND produces the opposite result of an AND gate.

Y = (A.B)’

ABY
001
011
101
110

NOR Gate

NOR produces the opposite result of an OR gate.

Y = (A+B)’

ABY
001
010
100
110

XOR Gate

XOR gives output 1 when the inputs are different.

Y = A ⊕ B

ABY
000
011
101
110

XNOR Gate

XNOR gives output 1 when both inputs are the same.

Y = (A ⊕ B)’

ABY
001
010
100
111
Easy Trick:
XOR = 1 when inputs are different.
XNOR = 1 when inputs are same.

Complement Laws

A + A’ = 1


A.A’ = 0

Identity Laws

A + 0 = A


A.1 = A


A + 1 = 1


A.0 = 0

Commutative Laws

A + B = B + A


A.B = B.A

Associative Laws

(A + B) + C = A + (B + C)


(A.B).C = A.(B.C)

Distributive Laws

A.(B + C) = (A.B) + (A.C)


A + (B.C) = (A+B).(A+C)

De Morgan’s First Theorem

(A + B)’ = A’.B’

The complement of an OR expression equals the AND of the individual complements.

De Morgan’s Second Theorem

(A.B)’ = A’ + B’

The complement of an AND expression equals the OR of the individual complements.

Boolean laws can be verified by calculating both sides of an equation for every possible input combination.

Commutative Law

A + B = B + A

A B A+B B+A
0000
0111
1011
1111
Since both output columns are identical, the commutative law is verified.

Distributive Law

A.(B+C) = (A.B)+(A.C)

A B C B+C A.(B+C) A.B A.C (A.B)+(A.C)
00000000
00110000
01010000
01110000
10000000
10111011
11011101
11111111

De Morgan’s First Theorem

(A+B)’ = A’.B’

A B A+B (A+B)’ A’ B’ A’.B’
0001111
0110100
1010010
1110000

De Morgan’s Second Theorem

(A.B)’ = A’ + B’

A B A.B (A.B)’ A’ B’ A’+B’
0001111
0101101
1001011
1110000
Exam Point:

A Boolean law is verified when the output columns on both sides of the equation are exactly the same for every possible input.

⚡ Quick Revision – Unit 2

  • Binary base = 2.
  • Octal base = 8.
  • Decimal base = 10.
  • Hexadecimal base = 16.
  • Decimal to another system: repeatedly divide by its base.
  • Binary to octal: group binary digits in 3s.
  • Binary to hexadecimal: group binary digits in 4s.
  • One’s complement: change 0 to 1 and 1 to 0.
  • Two’s complement: one’s complement + 1.
  • Seven logic gates: AND, OR, NOT, NAND, NOR, XOR and XNOR.
  • XOR = 1 when inputs are different.
  • XNOR = 1 when inputs are same.
  • Boolean values are 0 and 1.
  • De Morgan’s First Theorem: (A+B)’ = A’.B’.
  • De Morgan’s Second Theorem: (A.B)’ = A’+B’.

Frequently Asked Questions

A number system is a method of representing numbers using a fixed set of digits and a particular base or radix.

The four main number systems are Binary, Octal, Decimal and Hexadecimal.

One’s complement is obtained by changing every binary 0 into 1 and every binary 1 into 0.

Two’s complement is obtained by taking the one’s complement of a binary number and adding 1.

Boolean algebra is a system of algebra that works with two values, 0 and 1, and is used in digital circuits and computer logic.

The seven logic gates are AND, OR, NOT, NAND, NOR, XOR and XNOR.

De Morgan’s first theorem is (A+B)’ = A’.B’ and the second theorem is (A.B)’ = A’+B’.

Conclusion

Unit 2 introduces important concepts used by computers to represent numbers and perform digital logical operations.

Students should especially practice number conversions, binary addition and subtraction, complements, logic-gate truth tables, Boolean laws and De Morgan’s theorems for examination preparation.

Continue learning with Nepal eNotes for more NEB Class 11 Computer Science notes and study materials.

Discussion

Share a helpful question, idea, or explanation with other students.

Leave a Comment

Write a clear question, answer, or helpful explanation.
Your email will not be published.

Download Our Offline App

Study class-wise notes even when internet is not available. Get the app from Play Store.

Nepal eNotes offline app preview
Get it on Google Play