Comprehensive Senior School Computer Science Study Guide

Essence and Framework of the Computer Science Curriculum

The Computer Science curriculum at Senior School is designed to equip learners with competencies, skills, and attitudes in computing principles, concepts, and techniques. It aims to enable learners to design, implement, and manage systems providing social, economic, industrial, and technological solutions for national development.

  • Curriculum Pillars: The design encompasses theoretical and practical aspects of foundations of computer science, computer networking, and software development. It utilizes learner-centered, experiential, and inquiry-based learning approaches to foster problem-solving, critical thinking, and analytical skills.

  • National Alignment: The learning area is anchored on:

    • National Goals of Education No. 2: Providing skills/attitudes for industrial development.

    • Kenya Vision 2030: Making education responsive to economic needs.

    • Sessional Paper No. 1 of 2019: Promoting Technical and Vocational Education with an emphasis on Science, Technology, and Innovation (ST&I).

    • Africa Agenda 2063 (Second Pillar): Advancing technological foundations.

    • National ICT Policy of Kenya 2016 (revised 2020): Using ICT for a robust economy.

  • General Subject Learning Outcomes: By the end of Senior Secondary School, the learner should be able to:

    • a) Use knowledge, skills, and values in computer science for daily life activities.

    • b) Practice ethical and safe use of computer technology.

    • c) Develop computer applications for real-world problems.

    • d) Configure and manage computer networks for resource sharing.

    • e) Initiate career and entrepreneurship opportunities in computer science.

    • f) Adapt to the dynamic digital world to cope with changing societal needs.

Evolution and Development of Computers

Early computing devices introduced fundamental concepts in computation that paved the way for modern electronic systems.

  • Ancient and Medieval Devices:

    • Abacus (Around 2400 BC): A manual tool with beads on rods representing place values. It introduced numerical representation and basic data processing manipulation.

    • Napier's Bones (Early 17th Century): Numbered rods for multiplication and division using pre-calculated multiples, moving toward automation.

    • Pascaline (1642): The first mechanical calculator by Blaise Pascal using gears and dials for addition and subtraction.

    • Slide Rule (Around 1620): An analog computer using two logarithmic scales for multiplication, division, roots, and trigonometry.

  • The Mechanical Era:

    • Difference Engine (Early 19th Century): Designed by Charles Babbage to calculate polynomial functions and eliminate manual calculation errors. It introduced automated computation and mechanical memory for intermediate results.

    • Analytic Engine (Mid-19th Century): A general-purpose mechanical computer design by Babbage. It featured components analogous to modern computers: the "mill" (arithmetic unit), "store" (memory), a control unit, and input/output via punched cards. Ada Lovelace is recognized as the first programmer for her work on this engine.

    • Jacquard Loom (Early 19th Century): Used punched cards to control intricate textile patterns, influencing programmable instruction and data storage in early computers.

Principle Technologies and Computer Generations

The evolution of computers is categorized by the dominant technology of the era.

  • Core Technologies:

    • Vacuum Tubes (Early to Mid-20th Century): Electronic devices controlling current flow between electrodes. They were large, power-hungry, generated high heat, and were unreliable (frequent burnouts).

    • Transistors (Mid-20th Century): Semiconductor devices for switching/amplifying. Smaller, faster, more reliable, and energy-efficient than vacuum tubes.

    • Integrated Circuits (ICs) - SSI and MSI (Late 20th Century): Single chips containing interconnected components. Small Scale Integration (SSI) held a few transistors; Medium Scale Integration (MSI) held hundreds.

    • LSI and VLSI (Late 20th Century to Present): Large Scale Integration (LSI) held thousands, while Very Large Scale Integration (VLSI) holds millions of transistors. VLSI made the microprocessor (CPU on a single chip) possible.

  • Summary Table of Generations:

Generation

Period

Technology

Characteristics

Examples

First

1940s - 1950s

Vacuum Tubes

Large, hot, unreliable, slow

ENIAC, UNIVAC I

Second

1950s - 1960s

Transistors

Smaller, faster, more reliable

IBM 1401, PDP-1

Third

1960s - 1970s

ICs (SSI/MSI)

Reduced cost/size, efficient

IBM System/360, PDP-8

Fourth

1970s - Present

LSI / VLSI

Microprocessors, PCs, low cost

Macintosh, IBM PC

Fifth

Present/Future

AI / Quantum

Parallel processing, Natural Language

Supercomputers, AI

Computer Organization and von Neumann Architecture

The von Neumann architecture, described in 1945 by John von Neumann for the EDVAC, is the foundation of modern computers. It utilizes a single address space for both instructions and data.

  • Functional Units:

    1. Input Unit: Devices like keyboards and scanners that feed data and instructions.

    2. Central Processing Unit (CPU): Comprising the Arithmetic Logic Unit (ALU) for math/logic and the Control Unit (CU) for fetching, decoding, and coordinating activities.

    3. Memory Unit: Consists of Main Memory (RAM), which is volatile and stores active data, and Secondary Storage (SSD/HDD) for long-term retention.

    4. Output Unit: Devices like monitors or printers that present processed information.

    5. Buses: Electrical conductors for transmission:

      • Data Bus: Carries data between CPU, memory, and peripherals.

      • Address Bus: Carries memory locations from the CPU.

      • Control Bus: Transmits control signals from the CU.

Data Representation and Number Systems

Digital computers use binary numbers, with octal and hexadecimal used as human-readable shorthand.

  • Binary (Base-2): Uses digits 00 and 11. It is the fundamental language as circuits represent "on/off" states.

    • Conversion (Base-10 to Binary): Divide the decimal number by 22 and record remainders in reverse order.

    • Example: 131013_{10}

      • 13÷2=613 \div 2 = 6 Remainder 11

      • 6÷2=36 \div 2 = 3 Remainder 00

      • 3÷2=13 \div 2 = 1 Remainder 11

      • 1÷2=01 \div 2 = 0 Remainder 11. Result: 110121101_{2}.

    • Conversion (Binary to Base-10): Sum each bit multiplied by its power of 22.

    • Example: 10110210110_{2}

      • (1×24)+(0×23)+(1×22)+(1×21)+(0×20)=16+0+4+2+0=2210(1 \times 2^4) + (0 \times 2^3) + (1 \times 2^2) + (1 \times 2^1) + (0 \times 2^0) = 16 + 0 + 4 + 2 + 0 = 22_{10}.

  • Octal (Base-8): Uses digits 070-7. One octal digit equals three binary digits.

    • Binary to Octal: Group bits in threes from the right. 110101211010165658110101_{2} \rightarrow 110 | 101 \rightarrow 6 | 5 \rightarrow 65_{8}.

  • Hexadecimal (Base-16): Uses symbols 090-9 and AFA-F (where A=10,B=11,C=12,D=13,E=14,F=15A=10, B=11, C=12, D=13, E=14, F=15).

    • Binary to Hexadecimal: Group bits in fours from the right. 11110010211110010F2F21611110010_{2} \rightarrow 1111 | 0010 \rightarrow F | 2 \rightarrow F2_{16}.

Input/Output (I/O) Devices

I/O devices are peripherals that facilitate interaction between the user and the computer.

  • Input Devices:

    • Keying: Keyboard, Numeric Keypad.

    • Pointing: Mouse, Trackball, Touchpad, Joystick, Light Pen (uses light-sensitive styling on CRT).

    • Scanning: Flatbed Scanner, Barcode Reader, QR Code Reader, 2D and 3D Scanners (captures length, width, and depth).

    • Touchscreens:

      • Resistive: Layers of conductive material; requires physical pressure.

      • Capacitive: Uses electrical fields; sensitive and supports multi-touch.

      • Infra-red (IR): Interrupted light beams; affected by dust but has high clarity.

    • Others: Digital cameras, Voice input (microphones with speech recognition), Digitizers (Graphics Tablets).

  • Output Devices:

    • Monitors: CRT (Bulky), LCD (Liquid Crystals), LED (LCD with LED backlighting).

    • Printers:

      • Inkjet: Sprays ink; good for color.

      • Laser: Uses electrostatic images and toner; cost-effective for high-volume.

      • Dot Matrix: Striking pins on ribbons; noisy, used for multi-part forms.

    • Others: Speakers, Projectors, Plotters (large-format graphics for engineering), Actuators (produce physical movement like robotic arms).

Computer Storage Systems

Computer storage is categorized into Primary and Secondary levels.

  • Primary Storage (Main Memory): Directly accessible by the CPU, usually volatile.

    • RAM (Random Access Memory): Provides high-speed read/write.

      • DRAM (Dynamic): Data stored in capacitors; requires periodic refreshing.

      • SRAM (Static): Uses flip-flop circuits; faster and no refresh needed; used for cache.

    • ROM (Read-Only Memory): Non-volatile; stores boot instructions (BIOS).

      • Types: PROM (write once), EPROM (erased by UV light), EEPROM (electrically erasable; includes Flash memory).

  • Secondary Storage (Auxiliary): Non-volatile, long-term storage.

    • Magnetic: Hard Disk Drive (HDD) - spinning platters with read/write heads.

    • Solid-State: Solid State Drive (SSD) / USB Flash - uses flash memory chips; no moving parts, faster, durable.

    • Optical: CD, DVD, Blu-ray (uses laser beams to read/write data layers).

  • Remote/Cloud Storage: Data stored on networked servers managed by third parties (Google Drive, Dropbox). Advantages include accessibility and automatic backup; disadvantages include dependency on the internet.

The Central Processing Unit (CPU) and OS

The CPU manages data flow and instruction execution via the Fetch-Decode-Execute Cycle.

  • CPU Internal Registers:

    • Program Counter (PC): Address of the next instruction.

    • Instruction Register (IR): The current instruction being decoded.

    • MAR & MDR: Memory Address/Data registers for transfer.

    • Accumulator (ACC): Stores intermediate calculation results.

  • CPU Types:

    • Instruction Sets: RISC (Reduced, fast simple instructions) vs. CISC (Complex, multi-operation instructions).

    • Architecture: 32-bit vs. 64-bit word lengths.

    • Cores: Single-core vs. Multi-core (Dual, Quad, Octa-core) for parallel processing.

  • Operating System (OS) Functions:

    • Booting: Initiating the system via the BIOS/UEFI.

    • Resource Management: Allocating CPU and memory efficiently.

    • Process Management: Scheduling and executing running programs.

    • File/User Management: Permissions and file systems.

    • User Interface: Providing a Graphical User Interface (GUI) or Command Line Interface (CLI).

Networking Concepts and Data Communication

Data communication is the transfer of digital data over a medium.

  • Basic Terms:

    • Signals: Analog (continuous waves) vs. Digital (discrete high/low levels).

    • Models: OSI Model (7 layers: Physical, Data Link, Network, Transport, Session, Presentation, Application) and TCP/IP.

    • Flow Modes:

      • Simplex: One direction only (Radio).

      • Half-Duplex: Both directions, but one at a time (Walkie-talkie).

      • Full-Duplex: Simultaneous bidirectional flow (Telephone/Internet).

  • Transmission Media:

    • Guided (Wired):

      • Twisted Pair: UTP or STP (shielded to reduce interference).

      • Coaxial: Braided shield for better EMI protection.

      • Fiber Optic: Data as light pulses; immune to EMI, very high bandwidth.

    • Unguided (Wireless): Radio waves (3 kHz3\text{ kHz} to 300 GHz300\text{ GHz}), Microwaves (1 GHz1\text{ GHz} to 300 GHz300\text{ GHz}), and Infrared (short-range line-of-sight).

  • Network Elements:

    • DTE: Data Terminal Equipment (computers/phones).

    • DCE: Data Circuit-terminating Equipment (modems/NICs).

    • Network Scale: PAN (Personal), LAN (Local), MAN (Metropolitan), WAN (Wide Area - the Internet).

    • Topologies: Bus (single cable), Star (central hub), Ring (closed loop), Mesh (fully redundant), and Tree (central bus with star branches).

Software Development and Programming

Programming is the process of creating computer instructions using specific languages and paradigms.

  • Evolution of Languages:

    • 1GL: Machine Language (Binary).

    • 2GL: Assembly Language (Mnemonics like ADD/MOV).

    • 3GL: High-level (C, FORTRAN, Pascal).

    • 4GL: Declarative (SQL).

    • 5GL: AI/Logic (Prolog).

  • Program Development Life Cycle (PDLC): Problem Definition, Design (Flowcharts/Pseudocode), Coding (Implementation), Testing (Unit/Integration), Deployment, Documentation, and Maintenance.

  • Standard Programming Structures:

    • Sequential: Linear execution.

    • Selection: branching based on conditions (if, if-elif-else).

    • Iteration: Looping (for for known counts, while for conditional persistence).

  • Functionality:

    • Data Types: Integer, Float, String, Boolean.

    • Operators: Arithmetic (+,,,/,//,%,+, -, *, /, //, \%, **), Relational (==, !=, >, <, >=, <=), and Logical (and, or, not).

    • Containers: Lists (ordered/mutable), Dictionaries (key-value pairs), Sets (unique elements), Tuples (fixed/immutable).

    • Functions: Reusable modules; categorized as Built-in (provided by language) vs. User-Defined. Support parameter passing (Pass by Value vs. Pass by Object Reference) and variable scope (Local vs. Global).