Example Implement XOR using AND, OR, and NOT gates.
A⊕B=(A⋅Bˉ)+(Aˉ⋅B)
This requires: 2 NOT gates, 2 AND gates, 1 OR gate.
Truth table verification:
| A | B | Aˉ | Bˉ | A⋅Bˉ | Aˉ⋅B | A⊕B |
|---|
| 0 | 0 | 1 | 1 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 | 0 | 0 |
Half adder: Adds two single bits. Produces sum and carry.
\mathrm{Sum = A \oplus B
\mathrm{Carry = A \cdot B
Full adder: Adds two bits and a carry-in. Produces sum and carry-out.
\mathrm{Sum = A \oplus B \oplus C_{\mathrm{in}
C_{\mathrm{out} = (A \cdot B) + (C_{\mathrm{in} \cdot (A \oplus B))
Why full adders matter. A full adder can be chained to add multi-bit numbers. To add two 8-bit Numbers, chain 8 full adders: the carry-out of each stage becomes the carry-in of the next. The Final carry-out is the 9th bit of the result.
Worked Example. Add 0110 and 0011 using half adders and full adders.
| Position | 3 (MSB) | 2 | 1 | 0 (LSB) |
|---|
| A | 0 | 1 | 1 | 0 |
| B | 0 | 0 | 1 | 1 |
| Carry in | 0 | 0 | 1 | 0 |
| Sum | 0 | 1 | 0 | 1 |
| Carry out | 0 | 0 | 1 | 0 |
Result: 01001=9. Check: 6+3=9. Correct.
An operating system (OS) manages hardware and provides services for applications.
- Process management: Schedules and manages running programs (processes).
- Memory management: Allocates memory to processes, virtual memory, paging.
- File system management: Organizes, stores, and retrieves files.
- Device management: Controls hardware devices through drivers.
- User interface: Provides a way for users to interact with the computer (GUI or CLI).
- Security: Authentication, authorization, access control.
Virtual memory. When RAM is full, the OS swaps inactive pages to disk. A page fault occurs When the CPU accesses data that has been swapped out. The OS loads the required page from disk into RAM, which is much slower than a RAM access.
Worked Example. A computer has 4 GB of RAM. Programs require 6 GB total. The OS uses 2 GB of Virtual memory on the SSD. What happens when a program accesses data in virtual memory?
A page fault occurs. The OS suspends the program, loads the required page from the SSD into RAM (swapping out a less recently used page if necessary), and resumes the program. This takes Milliseconds instead of nanoseconds, causing a noticeable delay.
| Type | Examples | Characteristics |
|---|
| Desktop | Windows, macOS, Linux | Personal use, multitasking |
| Mobile | iOS, Android | Touch-optimized, app-based |
| Server | Windows Server, Linux | Network services, high uptime |
| Embedded | RTOS, firmware | Limited resources, dedicated |
| Real-time | VxWorks, FreeRTOS | Guaranteed response times |
The kernel is the core part of the OS that runs with full hardware access. It manages memory, Processes, and devices. User applications run in user mode with restricted access; system calls Request the kernel to perform privileged operations on their behalf.
- Requirements analysis: Understand what the software should do.
- Design: Plan the architecture and algorithms.
- Implementation: Write the code.
- Testing: Verify correctness and fix bugs.
- Deployment: Release the software to users.
- Maintenance: Update and fix issues over time.
| Type | Description |
|---|
| Unit testing | Testing individual components |
| Integration testing | Testing interactions between components |
| System testing | Testing the entire system |
| Acceptance testing | Testing against user requirements |
| Black-box testing | Testing based on inputs/outputs (no code access) |
| White-box testing | Testing based on internal code structure |
Black-box vs white-box. Black-box testing verifies that the system produces correct outputs for Given inputs, without examining the code. White-box testing examines the code structure to ensure Every path is tested (e.g., every branch of every if statement).
Worked Example. A function isValidAge(age) returns true if 0 ≤ age ≤ 120.
Black-box tests: age = -1 (invalid), 0 (boundary, valid), 60 (normal, valid), 120 (boundary, valid), 121 (invalid), 200 (invalid).
White-box tests: additionally verify each branch of the if statement is taken.
- Tracks changes to source code over time.
- Enables collaboration (multiple developers).
- Supports branching and merging.
- Common tools: Git, Subversion.
Git concepts. A repository is a project folder tracked by Git. A commit is a snapshot of The project at a point in time. A branch is an independent line of development. A pull Request proposes merging one branch into another.
In Java, int is a 32-bit two’s complement integer. The range is −2147483648 to 2147483647.
Worked Example. What happens when you compute 2000000000 + 2000000000 in Java?
2000000000+2000000000=4000000000. This exceeds 231−1=2147483647. In 32-bit two’s Complement, the result wraps around to 4000000000−232=−294967296.
| Operator | Name | Description |
|---|
& | AND | Bitwise AND |
| | OR | Bitwise OR |
^ | XOR | Bitwise XOR |
~ | NOT | Bitwise complement (inverts all bits) |
<< | Left shift | Shifts bits left, fills with zeros |
>> | Right shift | Shifts bits right, fills with sign bit |
int c = a & b; // 00001000 = 8
int d = a | b; // 00001110 = 14
int e = a ^ b; // 00000110 = 6
Java uses UTF-16 internally for char. ASCII characters (0—127) map directly to Unicode code Points.
char ch = 'A'; // Unicode code point 65
int codePoint = (int) ch; // 65
char upper = (char) ('a' - 32); // 'A'
| Metric | HDD | SSD |
|---|
| Read speed | 50-200 MB/s | 200-550 MB/s |
| Write speed | 50-150 MB/s | 200-500 MB/s |
| Latency | 5-10 ms | 0.05-0.1 ms |
| IOPS | 100-200 | 5000-100000 |
| Cost per GB | Low | Higher |
| Durability | Mechanical parts | No moving parts |
| Power usage | Higher | Lower |
IOPS (Input/Output Operations Per Second) measures how many read/write operations a drive can Perform per second. SSDs excel here due to having no moving parts.
BIOS (Basic Input/Output System): Legacy firmware interface. 16-bit, limited to 2.2 TB drives.
UEFI (Unified Extensible Firmware Interface): Modern replacement. 32-bit/64-bit, supports drives Larger than 2.2 TB, secure boot, graphical interface.
Repeatedly divide by 2 and record remainders.
Worked Example. Convert 20010 to binary.
200/2=100 r 0, 100/2=50 r 0, 50/2=25 r 0, 25/2=12 r 1, 12/2=6 R 0, 6/2=3 r 0, 3/2=1 r 1, 1/2=0 r 1.
Reading bottom to top: 110010002.
Multiply each bit by its position value and sum.
Worked Example. Convert 110101102 to decimal.
128+64+16+4+2=214.
Worked Example. Convert 3A7 from hex to decimal.
3imes256+10imes16+7=768+160+7=935.
Worked Example. Convert FF from hex to binary and decimal.
Binary: 11111111. Decimal: 15imes16+15=255.
Addition rules:
| 0+0 | 0+1 | 1+0 | 1+1 |
|---|
| 0 | 1 | 1 | 10 (0 carry 1) |
Worked Example. Add 0110 and 0011.
0110+0011=1001=9. Check: 6+3=9. Correct.
Worked Example. Add 1011 and 0110.
1011+0110=10001=17. Check: 11+6=17. Correct.
A process can be in one of several states:
- New: Being created.
- Ready: Waiting for CPU time.
- Running: Currently executing on the CPU.
- Blocked/Waiting: Waiting for I/O or a resource.
- Terminated: Finished execution.
Paging: Memory is divided into fixed-size pages. The OS maps virtual pages to physical frames.
Segmentation: Memory is divided into variable-size segments based on logical divisions (code, Data, stack).
Worked Example. A process needs 12 KB but the OS uses 4 KB pages. How many pages are needed?
12/4=3 pages.
File allocation methods:
- Contiguous: Files stored in consecutive blocks. Fast access but causes fragmentation.
- Linked: Each block points to the next. No fragmentation but slow random access.
- Indexed: An index block contains pointers to all data blocks. Fast random access.
Directory structures:
- Flat: All files in one directory.
- Hierarchical: Tree structure with folders and subfolders (most common).
| Utility | Purpose |
|---|
| Disk defragmenter | Reorganises data on a HDD for faster access |
| Disk cleaner | Removes unnecessary files to free up space |
| Antivirus | Detects and removes malware |
| Compression software | Compresses and decompresses files |
| Backup software | Creates copies of data for recovery |
| Firewall | Monitors and filters network traffic |
Disk defragmentation. On a HDD, files can become fragmented — stored in non-contiguous clusters Across the disk. This slows down reading because the read head must move to multiple locations. Defragmentation reorganises files into contiguous blocks. Note: SSDs do not need defragmentation and It can actually reduce their lifespan.
Convert the decimal number 200 to 8-bit binary.
Explain the difference between paging and segmentation in memory management.
A computer has a 32-bit address bus and runs at 3.2 GHz. Calculate the maximum addressable memory and the maximum data transfer rate if the data bus is 64 bits wide.
Explain three differences between BIOS and UEFI.
Design a truth table for the Boolean expression (A \cdot B) + (ar{A} \cdot C).
Explain the difference between contiguous and linked file allocation methods.
A program needs 20 KB of memory but the OS uses 4 KB pages. How many page table entries are needed?
Explain what a device driver is and why it is necessary. Give an example.
Calculate the result of 11012+10112. Show all carries.
Explain the principle of least privilege in the context of operating system security.
A system has three processes: P1 (8 MB), P2 (16 MB), P3 (4 MB). The system has 32 MB of RAM. Explain how virtual memory allows all three processes to run simultaneously.
Explain the role of the kernel in an operating system. What is the difference between user mode and kernel mode?
Worked Example. Convert 110101102 to hexadecimal.
Group into 4s: 1101 0110=extD616.
Worked Example. Convert extA3F_16 to binary.
A = 1010, 3 = 0011, F = 1111. Result: 1010001111112.
Worked Example. Convert ext2B_16 to decimal.
2imes16+11=43.
A half adder adds two single bits:
extSum=A⊕B extCarry=A⋅B
Implementation using basic gates: 1 XOR gate (sum), 1 AND gate (carry).
A full adder adds two bits and a carry-in:
extSum=A⊕B⊕C\*extin
C∗extout=(A⋅B)+(C_extin⋅(A⊕B))Implementation: 2 XOR gates, 2 AND gates, 1 OR gate.
Worked Example. Add 7 and 5 using full adders (4-bit).
| Position | 3 (MSB) | 2 | 1 | 0 (LSB) |
|---|
| A | 0 | 1 | 1 | 1 |
| B | 0 | 1 | 0 | 1 |
| Carry in | 0 | 1 | 0 | 0 |
| Sum | 1 | 1 | 0 | 0 |
| Carry out | 0 | 0 | 1 | 0 |
Result: 1100=12. Check: 7+5=12. Correct.
Git tracks changes to source code over time. Key concepts:
- Repository: A project folder tracked by Git.
- Commit: A snapshot of the project at a point in time.
- Branch: An independent line of development.
- Pull request: Proposes merging one branch into another.
- Clone: Copy a remote repository to your local machine.
Common Git commands:
| Command | Purpose |
|---|
git init | Create a new repository |
git add . | Stage all changes |
git commit -m "msg" | Commit staged changes |
git push | Upload commits to remote |
git pull | Download and merge changes |
git branch name | Create a new branch |
git checkout branch | Switch to a branch |
git merge branch | Merge a branch into current |
git log | View commit history |
An IDE combines a code editor, compiler/interpreter, debugger, and other tools in one application.
Examples: Eclipse, IntelliJ IDEA, Visual Studio Code, PyCharm.
Features: Syntax highlighting, auto-completion, error detection, debugging tools, version Control integration.
Draw a truth table for the expression A⋅B+A⋅C. Simplify using De Morgan’s Laws.
Explain the difference between a full adder and a half adder. Why is a full adder needed for multi-bit addition?
A computer uses 4 KB pages. A process requires 50 KB of memory. How many pages does it need? What happens if the system only has 10 free pages?
Explain what a firewall does and give three examples of rules a firewall might enforce.
Compare the three types of testing (unit, integration, system) with examples for each.
Explain why an SSD has no moving parts and why this makes it more suitable for laptops than an HDD.
A binary number has 12 bits. What is the maximum unsigned value it can represent? What is the range if it uses two’s complement?
Explain the purpose of each DNS record type (A, AAAA, CNAME, MX, NS) with examples.
Computing systems are about how hardware and software work together to execute programs. The key abstractions — binary representation, logic gates, processors, memory — hide enormous complexity while creating performance trade-offs.
Binary intuition: Computers use binary (base-2) because transistors have two states: on and off. This maps logically to 1s and 0s. All data — numbers, text, images, programs — is ultimately stored as binary. The same binary pattern can represent different things depending on interpretation (a number vs a character).
Logic gate intuition: Every computational operation can be built from three basic gates: AND, OR, and NOT. These are physical devices (transistors) that implement Boolean logic. Combinational circuits produce outputs that depend only on current inputs; sequential circuits have memory and produce outputs that depend on past inputs.
Processor cycle intuition: The CPU executes a fetch-decode-execute cycle: fetch the next instruction from memory, decode what it means, execute it, and store the result. This cycle repeats billions of times per second. Understanding this cycle explains why certain programming patterns are faster than others (cache locality, branch prediction).
- Confusing bits and bytes. 1 byte = 8 bits. Storage is measured in bytes; data rates in bits per second.
- Incorrect two’s complement conversion. Always flip all bits AND add 1.
- Confusing AND and OR in Boolean expressions. AND requires both true; OR requires at least one true.
- Forgetting De Morgan’s Laws.
- Confusing hexadecimal digits. A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
- Thinking the OS is the hardware. The OS is software.
- Confusing process and thread. A process is an instance of a program; a thread is a lightweight unit of execution within a process.
- Forgetting that NAND and NOR are universal gates. Any Boolean function can be built using only NAND gates or only NOR gates.
- Not padding binary groups of 4 when converting to hex.
Convert the decimal number −75 to 8-bit two’s complement.
Convert 11011101 from binary to hexadecimal.
Draw a truth table and logic circuit for the expression Aˉ⋅B+A⋅Bˉ. What Boolean operation does this represent?
Using De Morgan’s Laws, simplify A+Bˉ⋅C.
Explain the role of the operating system in managing memory. What is virtual memory?
Design a full adder circuit using only NAND gates.
Convert the hexadecimal number 3F7 to binary and decimal.
Explain the difference between black-box testing and white-box testing. Give an example of each.
Calculate the file size of a 1280×720 image with 32-bit colour depth in megabytes.
A 2-minute audio file is recorded at 48000 Hz with 16-bit resolution in stereo. Calculate the file size in megabytes.
Explain what the kernel is and why it is necessary. What is the difference between user mode and kernel mode?
Explain the concept of functional completeness in logic gates. Why are NAND gates called universal gates?
Prove De Morgan’s second law (A+B=Aˉ⋅Bˉ) using a truth table.
A 4-bit two’s complement adder adds 7 and 5. Show the calculation and determine whether overflow occurs.
Draw the truth table for a full adder. Show all eight rows for inputs A, B, and carry-in.
Explain the difference between process management and memory management in an operating system.
A computer has a 64-bit data bus and runs at 3.2 GHz. Calculate the maximum theoretical data transfer rate in GB/s.
Explain three ways in which an operating system provides security. Give a concrete example for each.
Question 1: Two's complement arithmetic
Perform the following 8-bit two’s complement addition: −50+30. Show the binary representation of each number, the addition, and determine whether overflow occurs.
Answer
-50 in 8-bit two’s complement: 50 = 00110010, invert = 11001101, add 1 = 11001110. 30 in 8-bit two’s complement: 00011110.
Addition: 11001110 + 00011110 = 11101100.
Convert result to decimal: 11101100 is negative (MSB = 1). Invert = 00010011, add 1 = 00010100 = 20. So the result is -20.
Check: -50 + 30 = -20. Correct.
No overflow occurred because a negative and a positive number were added (overflow can only occur when adding two numbers of the same sign).
Question 2: Logic circuit simplification
Simplify the Boolean expression Aˉ⋅Bˉ⋅C+Aˉ⋅B⋅C+A⋅Bˉ⋅C using Boolean algebra identities.
Answer
Aˉ⋅Bˉ⋅C+Aˉ⋅B⋅C+A⋅Bˉ⋅C
Factor out C from the first two terms: C(Aˉ⋅Bˉ+Aˉ⋅B)+A⋅Bˉ⋅C
Factor out Aˉ from the parenthesised expression: C⋅Aˉ(Bˉ+B)+A⋅Bˉ⋅C
Since Bˉ+B=1: C⋅Aˉ⋅1+A⋅Bˉ⋅C=Aˉ⋅C+A⋅Bˉ⋅C
Factor out C: C(Aˉ+A⋅Bˉ)
Using the distributive law: C(Aˉ+A)(Aˉ+Bˉ)
Wait — that’s incorrect. Let me redo: C(Aˉ+A⋅Bˉ). This doesn’t simplify further using basic identities .
Alternative approach — try consensus: AˉC+ABˉC. The consensus of Aˉ and Bˉ with respect to C is AˉBˉWhich is not present, so no further simplification.
The simplified expression is: Aˉ⋅C+A⋅Bˉ⋅C=C(Aˉ+A⋅Bˉ).
Question 3: Number conversion
Convert the decimal number 0.6875 to binary. Show the fractional conversion process.
Answer
Integer part: 0 = 0 in binary.
Fractional part: multiply by 2 repeatedly:
- 0.6875 × 2 = 1.375, digit = 1, remainder = 0.375
- 0.375 × 2 = 0.75, digit = 0, remainder = 0.75
- 0.75 × 2 = 1.5, digit = 1, remainder = 0.5
- 0.5 × 2 = 1.0, digit = 1, remainder = 0 (done)
Reading the digits top to bottom: 0.1011.
So 0.6875 in decimal = 0.1011 in binary.
Verification: 1×2−1+0×2−2+1×2−3+1×2−4=0.5+0+0.125+0.0625=0.6875. Correct.
Question 4: File size calculation
A 5-minute video is recorded at 30 frames per second with a resolution of 1920×1080 pixels. Each pixel uses 24 bits for colour (RGB). Calculate the file size in gigabytes before compression. Express your answer to 2 significant figures.
Answer
Total frames: 30×5×60=9,000 frames.
Pixels per frame: 1920×1080=2,073,600 pixels.
Bits per frame: 2,073,600×24=49,766,400 bits.
Total bits: 49,766,400×9,000=447,897,600,000 bits.
Convert to bytes: 447,897,600,000/8=55,987,200,000 bytes.
Convert to GB: 55,987,200,000 / (1024^3) = 55,987,200,000 / 1,073,741,824 \approx 52.15 \mathrm{ GB.
Rounded to 2 significant figures: 52 GB. This demonstrates why video compression is essential.
Question 5: De Morgan's Laws application
Using De Morgan’s Laws, convert the expression A⋅B+C⋅D into an expression that uses only AND and NOT operations.
Answer
A⋅B+C⋅D
Applying De Morgan’s Law (distribute the NOT over the OR): =A⋅B⋅C⋅D
Applying De Morgan’s Law to each term: =(Aˉ+Bˉ)⋅(Cˉ+Dˉ)
Wait — the question asks for only AND and NOT. Let me apply the other form:
A⋅B+C⋅D=A⋅B⋅C⋅D
To express using only AND and NOT, note that X+Y=Xˉ⋅Yˉ (De Morgan’s). But the question says only AND and NOT. Since A⋅B=A+BThis introduces OR.
Using only NAND (AND + NOT): \overline{A \cdot B} = \mathrm{NAND(A, B) and \overline{C \cdot D} = \mathrm{NAND(C, D).
So: \mathrm{NAND(A, B) \cdot \mathrm{NAND(C, D) — but this uses AND.
Actually, NAND(A, B) already uses AND and NOT: A⋅B. So the answer is: A⋅B⋅C⋅DWhich uses only AND (implicit in the NOT-AND) and NOT operations.
A[2_Computing Systems] --> B[Key Concepts]
A --> D[Practical Applications]
B --> E[Fundamental definitions]
D --> G[Real-world usage]
This topic covers the core concepts of computing systems, including underlying theory, practical implementation, and key applications.
Key concepts include:
- variables, data types, and control flow
- functions and procedures
- object-oriented programming
- error handling and debugging
- modular design
Understanding these concepts thoroughly is essential for both examinations and practical programming, and requires both theoretical knowledge and hands-on practice.
Worked examples demonstrating the application of key concepts are covered in the detailed sub-pages linked above.