Last updated: 4 December 2026 · Punjab Board 9th Class Computer Science and Entrepreneurship (new syllabus 2025-26) · Unit 3
Easy, exam-focused notes for Unit 3: Digital Systems and Logic Design of the new Punjab Board 9th class Computer Science book. Short answers are written to fit the board e-sheet answer space. All exercise MCQs are checked against the textbook answer key.
In this unit
- Analog and digital signals, ADC and DAC
- Boolean algebra: AND, OR, NOT
- Boolean functions and truth tables
- Logic gates
- Boolean laws, duality and simplification
- Half-adder and full-adder
- Karnaugh map (K-map)
- Exercise: MCQs, short and long questions
- FAQs
Notation: a bar on top means NOT, e.g. A = NOT A. “·” means AND, “+” means OR, “⊕” means XOR.
3.1 Basics of digital systems
| Analog signal | Digital signal |
|---|---|
| Changes smoothly and continuously | Discrete – only two values, 0 and 1 |
| Infinite possible values in a range | Finite values |
| Examples: voice, body temperature, radio waves | Example: binary data in computers |
| Affected more by noise | Less affected by noise; better for storage and long-distance transfer |
- ADC (Analog-to-Digital Converter): changes analog signals into digital so computers and phones can process them. Example: a microphone turns your voice into digital data.
- DAC (Digital-to-Analog Converter): changes digital data back into analog so humans can perceive it. Example: speakers turn digital audio back into sound waves.
- Logic levels: a high voltage (e.g. 5 V) means 1 and a low voltage (0 V) means 0.
3.2 Boolean algebra and basic operations
Boolean algebra (by George Boole, born 1815 in England) works with only two values: True (1) and False (0). Its three basic operations are AND, OR and NOT.
| A | B | A AND B (A·B) | A OR B (A+B) | A XOR B (A⊕B) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 |
| A | NOT A (A) |
|---|---|
| 0 | 1 |
| 1 | 0 |
- AND: output 1 only when all inputs are 1 (two switches in series: bulb glows only if both are ON).
- OR: output 1 when at least one input is 1 (alarm rings if either sensor detects a problem). In logic, 1 + 1 = 1.
- NOT: gives the opposite of its single input.
Boolean functions and truth tables
A Boolean function has one or more binary inputs and one binary output, built with AND, OR and NOT. Example: F(A, B) = A·B is 1 only when A = B = 1. A truth table lists the output for every possible input combination (2ⁿ rows for n inputs).
| A | B | C | A·B | A | A·C | F = A·B + A·C |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 1 |
Uses in computers: arithmetic in the ALU, data processing in memory and storage, and control logic that coordinates the parts of the computer. Phones and calculators use them all the time.
3.2.2 Logic gates
| Gate | Output is 1 when… | Expression |
|---|---|---|
| AND | all inputs are 1 | A·B |
| OR | at least one input is 1 | A+B |
| NOT | the input is 0 (inverts) | A |
| NAND | at least one input is 0 (AND followed by NOT) | A·B |
| XOR | exactly one input is 1 (inputs are different) | A⊕B |
Creating a logic diagram: find the gates the function needs, arrange them in the order of the operations, then connect the inputs and output.
3.3 Boolean laws and simplification
| Law | OR form | AND form |
|---|---|---|
| Identity | A + 0 = A | A · 1 = A |
| Null | A + 1 = 1 | A · 0 = 0 |
| Idempotent | A + A = A | A · A = A |
| Complement | A + A = 1 | A · A = 0 |
| Commutative | A + B = B + A | A · B = B · A |
| Associative | (A + B) + C = A + (B + C) | (A·B)·C = A·(B·C) |
| Distributive | A + B·C = (A + B)·(A + C) | A·(B + C) = A·B + A·C |
| Absorption | A + A·B = A | A·(A + B) = A |
| De Morgan | A + B = A·B | A·B = A + B |
| Double negation | A = A |
Duality: the dual of a Boolean expression is made by swapping AND ↔ OR and 0 ↔ 1 (variables stay the same). If an identity is true, its dual is also true. Example: A + 0 = A has the dual A · 1 = A.
Simpler expressions need fewer gates, so circuits become smaller, cheaper, faster and use less power.
3.5.1 Half-adder and full-adder
| A | B | Sum (S) | Carry (C) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
Half-adder adds two bits. S = A ⊕ B (XOR gate), C = A · B (AND gate). It cannot accept a carry from a previous column.
| A | B | Cin | Sum | Cout |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Full-adder adds three bits (A, B and carry-in). Sum = A ⊕ B ⊕ Cin, Cout = A·B + Cin·(A ⊕ B). Sum is 1 when an odd number of inputs are 1; carry is 1 when at least two inputs are 1. It can be built from two half-adders and an OR gate.
3.5.2 Karnaugh map (K-map)
- A K-map is a grid that simplifies Boolean expressions visually, without long algebra.
- Size: 2 variables = 2×2, 3 variables = 2×4, 4 variables = 4×4.
- Each cell is a minterm – a product (AND) term containing every variable once, plain or complemented. For A = 1, B = 0, C = 1 the minterm is ABC (m5).
- Neighbouring cells differ by one bit (Gray code order).
- Steps: draw the grid → fill 1s and 0s from the truth table → group adjacent 1s in groups of 1, 2, 4, 8 … (rows or columns) → write one term per group.
Group the column B = 1 → B; group the row A = 1 → A.
F = A + B
Unit 3 exercise (solved)
A. Multiple choice questions
1. Which of the following Boolean expressions represents the OR operation?
(a) A · B (b) A + B (c) A̅ (d) A ⊕ B
Answer: (b) A + B – “+” is the OR symbol.
2. What is the dual of the Boolean expression A · 0 = 0?
(a) A + 1 = 1 (b) A + 0 = A (c) A · 1 = A (d) A · 0 = 0
Answer: (a) A + 1 = 1 – Swap AND with OR and 0 with 1.
3. Which logic gate outputs true only if both inputs are true?
(a) OR gate (b) AND gate (c) XOR gate (d) NOT gate
Answer: (b) AND gate – AND gives 1 only when all inputs are 1.
4. In a half-adder circuit, the carry is generated by which operation?
(a) XOR operation (b) AND operation (c) OR operation (d) NOT operation
Answer: (b) AND operation – Carry = A · B; the sum uses XOR.
5. What is the decimal equivalent of the binary number 1101?
(a) 11 (b) 12 (c) 13 (d) 14
Answer: (c) 13 – 8 + 4 + 0 + 1 = 13.
B. Short questions
C. Long questions
- Arithmetic: the ALU uses Boolean functions (adders) to add, subtract, multiply and divide.
- Data processing: reading, writing and handling binary data in memory and storage.
- Control logic: the control unit uses them to coordinate all parts of the computer.
- Daily devices: phones (keypad input, unlocking) and calculators use Boolean logic to give the right result.
- Count the inputs (n) and make 2ⁿ rows.
- Write all input combinations in binary order.
- Add a column for each part of the expression.
- Work out the final column.
| Half-adder | Full-adder | |
|---|---|---|
| Inputs | 2 (A, B) | 3 (A, B, Cin) |
| Sum | A ⊕ B | A ⊕ B ⊕ Cin |
| Carry | A · B | A·B + Cin·(A ⊕ B) |
| Gates | 1 XOR + 1 AND | 2 XOR + 2 AND + 1 OR (two half-adders + OR) |
| Use | Lowest (first) bit | Every other bit, where a carry comes in |
- Draw a grid for the number of variables (2 → 2×2).
- Fill each cell with the output from the truth table.
- Group adjacent 1s in powers of two (1, 2, 4 …), as large as possible.
- Write a term for each group, keeping only variables that do not change inside it.
- Bit 0 (rightmost): a half-adder adds A0 + B0 → S0 and carry C1.
- Bits 1, 2, 3: full-adders add Ai + Bi + Ci → Si and carry to the next bit.
- The last carry C4 is the overflow / 5th bit. This chain is called a ripple-carry adder.
- Example: 0101 (5) + 0011 (3): bit0 1+1 = 0 carry 1; bit1 0+1+1 = 0 carry 1; bit2 1+0+1 = 0 carry 1; bit3 0+0+1 = 1 → 1000 (8).
(b) A·A + A·B + B·A + B·B = A·B + A·B (XNOR)
(c) A + A·X = A + X → A + B + C
(d) X̅ + X = 1 (complement law, X = A·B)
(e) A·B + A·B is already simplest; it is the XNOR of A and B (1 when A = B).
9th class computer unit 3 MCQs with answers
Unit 3 (Digital Systems and Logic Design) exercise MCQ answers: 1-b, 2-a, 3-b, 4-b, 5-c.
What is the difference between half adder and full adder?
A half-adder adds two bits (Sum = A⊕B, Carry = A·B). A full-adder adds three bits including a carry-in (Sum = A⊕B⊕Cin, Carry = A·B + Cin·(A⊕B)).
What are De Morgan’s theorems?
NOT(A + B) = NOT A · NOT B, and NOT(A · B) = NOT A + NOT B.
What is duality in Boolean algebra?
Swapping AND with OR and 0 with 1 in a true identity gives another true identity, e.g. A + 0 = A and A · 1 = A.
What is a K-map?
A Karnaugh map is a grid used to simplify Boolean expressions by grouping adjacent 1s in groups of 1, 2, 4 or 8.
📄 Download these notes as PDF
Save this chapter to your phone or computer and read it offline, or share it with your friends.
The PDF downloads directly. Long chapters may take a few seconds.
More 9th Class Computer Science
Need a Computer Science home tutor?
Male & female Computer Science tutors in all major cities of Pakistan, home or online. 3-day free demo.
