Understand and use library routines

Cambridge IGCSE Computer Science (0478) – Complete Revision Notes

How to Use These Notes

  • Read each topic, then attempt the practice questions at the end of the section.
  • Focus on the “Key Points” boxes for quick exam‑style recall.
  • Where a diagram is mentioned, sketch it on a separate sheet.
  • All code examples are in Python 3, the language used in the IGCSE practical.

1. Data Representation

1.1 Number Systems

SystemBaseDigits Used
Binary20, 1
Denary (Decimal)100‑9
Hexadecimal160‑9, A‑F

Conversion Algorithms (Worked Example)

  1. Denary → Binary (156)
    1. 156 ÷ 2 = 78 r 0
    2. 78 ÷ 2 = 39 r 0
    3. 39 ÷ 2 = 19 r 1
    4. 19 ÷ 2 = 9 r 1
    5. 9 ÷ 2 = 4 r 1
    6. 4 ÷ 2 = 2 r 0
    7. 2 ÷ 2 = 1 r 0
    8. 1 ÷ 2 = 0 r 1

    Read remainders upwards → 10011100₂.

  2. Binary → Hexadecimal (1011 1100₂)
    1. Group bits in fours from the right: 1011 11001011 and 1100.
    2. Convert each group: 1011₂ = B₁₆, 1100₂ = C₁₆.

    Result: BC₁₆.

1.2 Two’s‑Complement for Signed Integers

  • Positive numbers: same as ordinary binary.
  • Negative numbers: invert all bits (1’s complement) then add 1.

Example – Represent –18 in 8‑bit two’s‑complement:

  1. 18 → 0001 0010₂
  2. Invert → 1110 1101₂
  3. Add 1 → 1110 1110₂

1.3 Logical Shifts

Shift TypeEffectTypical Use
Logical left shift (<<)Bits move left; 0 fills rightmost bitsMultiply by 2ⁿ
Logical right shift (>>)Bits move right; 0 fills leftmost bitsInteger division by 2ⁿ

1.4 Text, Sound & Images

  • Text encoding
    • ASCII – 7‑bit code, 128 characters (e.g., A = 01000001₂).
    • Unicode – 16‑bit (or more) code, supports worldwide scripts.
  • Sound representation
    • Sample rate – number of samples per second (e.g., 44 kHz).
    • Bit depth – bits per sample (e.g., 16‑bit gives 65 536 possible amplitudes).
    • File size ≈ sample‑rate × bit‑depth × duration ÷ 8 bits/byte.
  • Images
    • Pixel = smallest picture element; colour stored as RGB values.
    • Colour depth – bits per pixel (e.g., 24‑bit = 8 bits per colour → 16 777 216 colours).
    • File size = width × height × bits‑per‑pixel ÷ 8.

1.5 Data Storage & Compression

TopicDetails
Binary prefixes1 KiB = 2¹⁰ B, 1 MiB = 2²⁰ B, 1 GiB = 2³⁰ B (used in computer memory).
File‑size example800 × 600 px, 24‑bit colour → 800 × 600 × 24 ÷ 8 = 1 440 000 B ≈ 1.37 MiB.
Lossless compressionRun‑Length Encoding (RLE) – stores count + value (e.g., AAAAABBB → 5A3B).
Lossy compressionJPEG – reduces file size by discarding visual information that the eye is less likely to notice.

Key Points – Data Representation

  • Convert confidently between binary, decimal and hexadecimal.
  • Two’s‑complement range for n bits: –2ⁿ⁻¹ to 2ⁿ⁻¹ – 1.
  • Logical shifts correspond to multiplication/division by powers of two.
  • Know ASCII vs Unicode, sample rate & bit depth for sound, and colour depth for images.
  • Distinguish lossless (e.g., RLE) from lossy (e.g., JPEG) compression and be able to calculate simple file sizes.

2. Data Transmission

2.1 Packet Structure

+----------+-----------+----------+-----------+
| Header   | Payload   | Trailer  | Checksum  |
+----------+-----------+----------+-----------+
| Src Addr | Data …   | End Flag | Parity/CRC|
+----------+-----------+----------+-----------+
  • Header – source/destination address, protocol ID.
  • Payload – actual data being transferred.
  • Trailer – end‑of‑packet marker.
  • Checksum / CRC – error‑detection field.

2.2 Transmission Media & Protocols

  • Wired: Twisted‑pair (Ethernet), fibre‑optic, coaxial.
  • Wireless: Wi‑Fi (IEEE 802.11), Bluetooth, satellite.
  • Key protocols: TCP/IP (reliable, connection‑oriented), UDP (unreliable, faster).

2.3 Error Detection & Correction

MethodHow It WorksTypical Use
Parity bit (even/odd)Add one bit so total number of 1’s is even (or odd).Simple serial links.
Check digit / Echo checkSum of digits (or characters) modulo 10; echoed back for verification.Banking, bar‑code scanners.
ChecksumSum of data bytes, modulo 256, transmitted with the packet.Internet protocols (e.g., TCP).
CRC (Cyclic Redundancy Check)Polynomial division; remainder sent as CRC field.Hard‑disk, Ethernet, Wi‑Fi.
ARQ (Automatic Repeat reQuest)Receiver detects error → sends NACK → sender retransmits.TCP’s reliability mechanism.

2.4 Encryption Basics

  • Symmetric encryption – same key for encryption and decryption (e.g., AES). Used for bulk data.
  • Asymmetric encryption – public‑private key pair (e.g., RSA). Used for secure key exchange and digital signatures.

Key Points – Data Transmission

  • Identify header, payload, trailer and checksum in a packet.
  • Explain why parity, checksum, CRC and ARQ are needed.
  • Distinguish symmetric from asymmetric encryption and give an example of each.
  • Know the difference between a check digit/echo check and a parity bit.

3. Hardware

3.1 The Fetch‑Decode‑Execute Cycle

[PC] → MAR → Memory → MDR → IR (decode) → CU → ACC (execute) → PC+1
  • PC (Program Counter) – address of the next instruction.
  • MAR (Memory Address Register) – holds the address to be accessed.
  • MDR (Memory Data Register) – holds data fetched from or to be written to memory.
  • IR (Instruction Register) – holds the current instruction for decoding.
  • CU (Control Unit) – generates control signals.
  • ACC (Accumulator) – primary arithmetic/logic register.

3.2 CPU Architecture – General‑Purpose vs Embedded

FeatureGeneral‑Purpose CPUEmbedded CPU
Typical clock speed2–4 GHz10–200 MHz
Cache hierarchyL1, L2, L3 (KB–MB)L1 only (KB)
Power consumption50–150 W0.1–5 W
Typical useDesktops, laptops, serversMicrowave ovens, car ECUs, Arduino boards

3.3 Buses and I/O

  • Data bus – carries actual data (width = 8, 16, 32 bits etc.).
  • Address bus – carries memory addresses; determines maximum addressable memory.
  • Control bus – carries read/write, interrupt and timing signals.

Key Points – Hardware

  • Describe each step of the FDE cycle and name the registers involved.
  • Compare a general‑purpose CPU with an embedded microcontroller.
  • Explain the role of the data, address and control buses.

4. Software

4.1 Types of Software

  • System software – operating system, device drivers, utility programmes.
  • Application software – word processors, spreadsheets, games, specialised apps (e.g., CAD).

4.2 Operating System Functions

FunctionDescription
File ManagementCreate, store, retrieve, delete files; organise directories.
Process ManagementAllocate CPU time, multitask, schedule processes.
Memory ManagementAllocate RAM, virtual memory, paging.
SecurityUser authentication, permissions, firewalls.
Device ManagementDrivers translate OS calls into hardware actions.

4.3 Interrupts

Hardware signal → CPU finishes current instruction →
Save state → Jump to ISR (Interrupt Service Routine) →
Execute ISR → Restore state → Resume previous task
  • Improves efficiency by handling asynchronous events without constant polling.

4.4 Language Levels & Translation

  • Machine language – binary instructions executed directly by the CPU.
  • Assembly language – mnemonic representation of machine code; needs an assembler.
  • High‑level language – Python, Java, etc.; translated by a compiler (produces an executable) or an interpreter (executes line‑by‑line).

4.5 Integrated Development Environments (IDEs)

  • Code editor with syntax highlighting.
  • Built‑in debugger (breakpoints, step‑through).
  • Run/Compile button, project management, auto‑completion.

Key Points – Software

  • Distinguish system software from application software with examples.
  • List at least three OS functions and explain their importance.
  • State why interrupts are more efficient than polling.
  • Differentiate a compiler from an interpreter.

5. The Internet & Its Uses

5.1 Internet vs. World Wide Web

  • Internet: Global network of interconnected devices using the TCP/IP protocol suite.
  • WWW: Collection of hyper‑text documents accessed via HTTP/HTTPS; one service that runs on the Internet.

5.2 URL Structure

Example: https://www.example.com:443/path/page.html?search=cat#section2

  • Protocolhttps
  • Domain namewww.example.com
  • Port443 (default for HTTPS; optional in a URL)
  • Path/path/page.html
  • Query string?search=cat
  • Fragment#section2

5.3 HTTP/HTTPS Request Cycle

Browser → DNS lookup → TCP handshake → HTTP GET → Server processes → HTTP response (HTML, CSS, JS) → Browser renders

5.4 Cookies & Sessions

  • Cookies – small pieces of data stored on the client (e.g., login token).
  • Sessions – server‑side storage of user state; cookie usually holds the session ID.

5.5 Cyber‑Security Essentials

ThreatCountermeasure
PhishingVerify sender, avoid clicking unknown links.
MalwareAnti‑virus software, keep OS and apps updated.
Unauthorised accessStrong passwords, two‑factor authentication.
Data interceptionUse HTTPS, VPNs, encrypt sensitive files.

Key Points – Internet

  • Differentiate the Internet from the World Wide Web.
  • Identify each component of a URL.
  • Outline the steps of an HTTP request/response cycle.
  • State two ways to protect personal data online.

6. Automated & Emerging Technologies

6.1 Sensors & Actuators

SensorPhysical Quantity MeasuredTypical Output
ThermistorTemperatureResistance (Ω) → voltage
PhotodiodeLight intensityCurrent proportional to lux
AccelerometerAcceleration (g)Voltage on three axes

6.2 Robotics & Control

  • Microcontroller reads sensor data → decision algorithm → actuator command.
  • Feedback loop (closed‑loop control) uses sensor input to correct motion (e.g., line‑following robot).

6.3 Artificial Intelligence (AI) Basics

  • Expert system: Knowledge base + inference engine (e.g., medical diagnosis).
  • Machine learning: Algorithms improve performance from data (e.g., image classification).

6.4 Emerging Technologies (brief overview)

  • Internet of Things (IoT): Everyday objects equipped with sensors, network connectivity and remote control.
  • Cloud computing: Delivery of computing resources (storage, processing) over the Internet.
  • 3‑D printing: Additive manufacturing that builds objects layer‑by‑layer from digital models.
  • Virtual & Augmented Reality: Immersive environments for education, training and entertainment.

Key Points – Automated & Emerging Technologies

  • Give examples of sensors, their outputs and typical uses.
  • Explain how a feedback loop improves robot accuracy.
  • Distinguish an expert system from a machine‑learning system.
  • Name two emerging technologies and a practical application for each.

Create an account or Login to take a Quiz

37 views
0 improvement suggestions

Log in to suggest improvements to this note.