Original BCA Nepal study material. The units and topic order follow the 2025 course outline for BCA101; the wording here is our own explanation, not official TU text.
Course Overview
Computer Fundamentals and Applications (BCA101) serves as the foundational cornerstone for the Bachelor of Computer Applications curriculum under Tribhuvan University (2025 regulations). Designed to bridge the gap between intuitive user experiences and rigorous computing principles, this course provides students with an architectural, systemic, and operational perspective on modern computing hardware, foundational software stacks, relational and modern databases, telecommunications, digital security, and frontier technologies.
Students will examine not merely what computers do, but how electrons, logic gates, instruction pipelines, system software, networking protocols, and data models collaborate to solve computationally demanding real-world problems. The curriculum emphasizes both theoretical precision and practical relevance, equipping aspiring software engineers and IT professionals with the conceptual framework necessary to master advanced programming, systems architecture, and database engineering in subsequent semesters.
Learning Outcomes
Upon successful completion of this course, students will be able to:
- Explain the foundational anatomy, operational cycle, and evolutionary trajectory of electronic computing systems.
- Analyze the internal organization of computer hardware, including CPU microarchitecture, the hierarchical memory system, motherboard interfaces, and auxiliary power/firmware subsystems.
- Differentiate and categorize system and application software, elucidating the core responsibilities of operating systems and language translation pipelines.
- Formulate and critique database models, structured query mechanisms, and modern distributed storage and analytics architectures (Big Data, Data Warehousing, Data Mining).
- Model network communications across standard reference architectures (OSI and TCP/IP), evaluating physical transmission media, switching topologies, and internetworking protocols.
- Evaluate cybersecurity vulnerability profiles, cryptographic mechanisms, authentication schemes, and defensive perimeter controls in networked environments.
- Articulate the operational principles, architectural frameworks, and societal impacts of emerging paradigms, including Artificial Intelligence, Machine Learning, Blockchain ledgers, IoT ecosystems, and Immersive Technologies.
Unit 1: Introduction to Computer
Teaching hours: 5
Topics in outline order
- 1.1 Definition and characteristics of computer
- 1.2 Anatomy of computer
- 1.3 Types of computers (size, principle, brand and purpose)
- 1.4 History of computer and generations
- 1.5 Application of computer
1.1 Definition and characteristics of computer
Definition and Purpose
A computer is a programmable electronic device that accepts raw data as input, processes that data at high speeds using a sequence of stored instructions (the program), produces meaningful information as output, and preserves results in secondary storage for subsequent retrieval. It operates fundamentally on digital binary logic (base-2), executing arithmetic computations and Boolean logical evaluations.
In academic and professional computing, a computer cannot be described merely as a calculating machine. The defining quality of a modern computer is its stored-program capability (the Von Neumann architecture), wherein both data and the instructions directing operations reside in addressable memory.
Core Characteristics
The capabilities that distinguish digital computers from manual or electro-mechanical calculating tools include:
- Speed: Processing occurs at nanosecond ($10^{-9}$ s) and picosecond ($10^{-12}$ s) scales. Modern CPUs execute billions of instructions per second, measured in Gigahertz (GHz) or Millions of Instructions Per Second (MIPS).
- Accuracy: Calculations execute with 100% mathematical precision governed strictly by algorithm design and floating-point precision standards (IEEE 754). Computer errors almost invariably trace to erroneous human logic or faulty input, summarized as GIGO (Garbage In, Garbage Out).
- Diligence: Unlike human operators, electronic circuits exhibit zero cognitive fatigue, boredom, or loss of concentration. A system will execute the billionth iteration of an iterative loop with the identical fidelity and timing as the first.
- Versatility: The exact same general-purpose physical machine can render three-dimensional CAD blueprints, execute statistical Monte Carlo simulations, process payroll ledger entries, or stream packetized multimedia simply by switching loaded memory routines.
- Storage Capacity: Digital memory architectures can retain terabytes and petabytes of persistent data across magnetic, optical, and solid-state media with instantaneous byte-level or block-level retrieval.
- Automation: Once an operational sequence is initialized in main memory with designated input buffers, execution transitions through control logic autonomously until a termination condition or interrupt is signaled.
- Lack of Native IQ and Feelings: A computer possesses no innate intuition, subjective heuristics, or emotional motivation. It strictly evaluates instructions according to programmed logic states.
Comparison: Computer vs. Human Brain
| Dimension | Digital Computer | Human Brain |
|---|---|---|
| Processing Paradigm | Serial/Synchronous high-speed deterministic execution | Highly parallel, asynchronous, associative biological network |
| Operational Rate | $10^9$ to $10^{12}$ clock cycles per second | ~100 to 1000 Hz synaptic firing frequency |
| Storage Recall | Absolute bit-for-bit mathematical fidelity | Reconstructive, associative, lossy semantic memory |
| Heuristics & Adaptability | Strictly constrained to coded logic and trained models | Exceptional contextual generalization and conceptual leaps |
| Fatigue Index | Nil (governed strictly by thermal limits and hardware MTBF) | Subject to neuro-chemical depletion and cognitive exhaustion |
Common Pitfalls & Exam Traps
- Superficial Definition: Defining a computer only as an "electronic calculating machine" omits the stored-program principle, memory retrieval, and input-output synchronization, resulting in lost marks.
- Confusing Accuracy with Correctness: Remember GIGO. A computer executes flawed logic with flawless mathematical accuracy. The machine is accurate; the program logic is incorrect.
Review & Self-Check Questions
- What distinguishes a stored-program digital computer from an electronic desktop calculator?
Answer: A calculator performs immediate arithmetic operations on interactive keystrokes with fixed hardware registers. A stored-program computer holds complex, multi-branching instruction sets in memory alongside data, executing autonomous decision paths without manual intervention. - State three key engineering metrics used to measure a computer system's diligence and speed.
Answer: Clock frequency (GHz), Millions of Instructions Per Second (MIPS) / FLOPS, and Mean Time Between Failures (MTBF).
1.2 Anatomy of computer
Theoretical Architecture
The anatomy of a computer defines the functional subsystems that enable input ingestion, intermediate transformation, coordination, and output generation. This architectural decomposition originates from John von Neumann's 1945 functional specification.
flowchart LR
subgraph Input_Stage ["Input Stage"]
IN["Input Devices<br/>(Keyboard, Mouse, Sensors)"]
end
subgraph CPU ["Central Processing Unit (CPU)"]
CU["Control Unit (CU)<br/>[Instruction Fetch & Decode]"]
ALU["Arithmetic Logic Unit (ALU)<br/>[Arithmetic & Logic Operations]"]
REG["Registers<br/>[High-Speed Temporary Storage]"]
CU <--> ALU
CU <--> REG
ALU <--> REG
end
subgraph Storage_Stage ["Storage & Memory Subsystem"]
MEM["Primary Storage (RAM/ROM)"]
SEC["Secondary Storage (SSD, HDD)"]
MEM <--> SEC
end
subgraph Output_Stage ["Output Stage"]
OUT["Output Devices<br/>(Monitor, Printer, Actuators)"]
end
IN -->|Data / Instructions| MEM
MEM <-->|Bus Transfers| CPU
MEM -->|Processed Information| OUT
Figure 1.1: Functional Anatomy and Inter-subsystem Data Flow of a Computer System.
Functional Subsystems
- Input Unit: Transforms external real-world physical phenomena (keystrokes, acoustic waves, capacitive touch, optical scans) into standardized digital binary bitstreams (0s and 1s) consumable by computer bus architectures.
- Central Processing Unit (CPU): Known as the engine of computation. It comprises:
- Control Unit (CU): The supervisory director that orchestrates machine cycles. It extracts instruction opcodes from memory, decodes them via microcode decoders, and broadcasts timing control pulses across internal buses.
- Arithmetic Logic Unit (ALU): The computational foundry containing digital adder circuits, bit-shifters, and Boolean logic gates that execute arithmetic (
+,-,*,/) and comparative relational evaluations (<,>,==,!=). - Internal Registers: Ultra-low-latency, single-cycle flip-flop memory cells (Program Counter, Instruction Register, Accumulator, Memory Address Register) directly inside the processor die.
- Memory Unit:
- Primary Storage (RAM/ROM): High-speed, directly byte-addressable volatile and non-volatile silicon memory tied to the processor's address bus.
- Secondary Storage (HDD/SSD/NVMe): High-density, persistent non-volatile media organized by block addresses to store operational files, operating system kernels, and applications.
- Output Unit: Decodes processed binary streams into human-perceptible audio-visual representations or electromechanical actions (displays, audio DACs, industrial motor drivers).
- System Bus Architecture: Interconnecting copper traces divided into:
- Data Bus: Bidirectional pathway transporting actual instruction payloads and values.
- Address Bus: Unidirectional pathway asserting target physical memory or I/O port coordinates.
- Control Bus: Bidirectional signaling tracks transmitting read/write strobe signals, interrupts, and clock synchronization pulses.
Worked Trace of the Machine Cycle
Consider executing an assembly instruction: ADD R1, [2000H]
- Fetch: The Control Unit reads the address in the Program Counter (PC), asserts it onto the Address Bus, issues a
Memory Readsignal on the Control Bus, and latches the instruction byte from RAM into the Instruction Register (IR). PC increments by instruction length. - Decode: The instruction decoder resolves the opcode for
ADD, identifying operand registerR1and effective memory address2000H. - Execute: The CU fetches the data value at memory address
2000H, places it at the ALU input multiplexer alongsideR1's current value, triggers the ALU adder circuitry, and stores the resulting sum back into registerR1. - Write-back: Status flags (Zero, Carry, Sign) are updated in the Program Status Word (PSW) register.
1.3 Types of computers (size, principle, brand and purpose)
Computers are formally classified across four major analytical taxonomy axes.
mindmap
root((Computer Classification))
Classification by Operational Principle
Analog Computers
Digital Computers
Hybrid Computers
Classification by Physical Size & Power
Supercomputers
Mainframe Systems
Minicomputers / Mid-range
Microcomputers / Personal Systems
Classification by Application Purpose
General-Purpose Systems
Special-Purpose / Embedded Systems
Classification by Brand / Architecture
IBM-Compatible PC / x86 Architecture
Apple Macintosh / ARM Architecture
Figure 1.2: Taxonomy of Computing Machinery.
1. By Operational Principle
- Analog Computers: Compute by measuring continuous physical quantities (voltage variance, hydraulic pressure, mechanical rotation) without discrete binary digitization. Calculations occur instantaneously via analog operational amplifier circuits. Example: Flight simulator flight dynamics analog computers, chemical plant process monitors.
- Digital Computers: Compute strictly by processing discrete binary states (
0and1). Continuous phenomena are sampled and digitized via Analog-to-Digital Converters (ADCs). Highly versatile, deterministic, and software-reconfigurable. Example: Laptops, enterprise servers, smart handheld devices. - Hybrid Computers: Integrate the high-speed continuous processing of analog front-ends with the precise digital storage and logical control of digital back-ends. Example: Intensive Care Unit (ICU) telemetry stations (analog heart/respiratory wave sensing mated to digital alert logging and threshold processing).
2. By Physical Size, Cost, and Computing Capacity
- Supercomputers: Massive parallel processing arrays engineered to execute trillions to quadrillions of Floating-Point Operations Per Second (PetaFLOPS to ExaFLOPS). They feature tens of thousands of heterogeneous CPU/GPU compute cores interconnected via ultra-low-latency InfiniBand matrices with specialized liquid cooling. Applications: Molecular dynamics, global climate modeling, nuclear weapons simulations, astrophysical mapping.
- Mainframe Computers: Enterprise-scale transactional engines engineered for extreme I/O throughput, continuous zero-downtime reliability (RAS — Reliability, Availability, Serviceability), and concurrent multi-tenant transaction processing. Applications: National banking core ledgers (Nepal Rastra Bank RTGS networks), airline Global Distribution Systems (Sabre, Amadeus).
- Minicomputers (Mid-Range): Multi-user systems bridging microcomputers and mainframes, historically supporting departmental database hosting and factory process automation (e.g., DEC PDP/VAX series, modern rackmount multi-socket servers).
- Microcomputers: Systems engineered around a single-chip integrated microprocessor. Encompasses desktop workstations, consumer laptops, tablets, and smartphones.
3. By Purpose
- General-Purpose Computers: Engineered with flexible instruction sets and open operating systems capable of hosting varied software stacks ranging from spreadsheet accounting to compiler development and video processing.
- Special-Purpose (Embedded) Computers: Hardwired or firmware-locked microcontrollers optimized to perform a specific dedicated task with deterministic real-time constraints. Example: Automotive Electronic Control Units (ECU) for Anti-lock Braking Systems (ABS), traffic signal controllers, microwave control boards.
4. By Brand / Architecture
- IBM PC Compatible: Standardized systems rooted in the open x86/x86-64 CISC instruction set architecture historically established by IBM, Intel, and AMD.
- Apple (Macintosh): Proprietary ecosystem built historically on 68k, PowerPC, Intel x86, and currently custom ARM-based Apple Silicon (M-series) SoCs running macOS.
1.4 History of computer and generations
Pre-Electronic Computing Milestones
- Abacus (c. 2500 BCE): The earliest mechanical calculating tool utilizing positional bead frames.
- Napier's Bones (1617): John Napier's set of marked rods facilitating mechanical multiplication and division via logarithms.
- Pascaline (1642): Blaise Pascal's gear-driven mechanical calculating machine capable of addition and subtraction using mechanical carrying teeth.
- Stepped Reckoner (1673): Gottfried Wilhelm Leibniz's mechanical calculator incorporating a stepped drum gear, introducing direct multiplication and binary logic concepts.
- Jacquard Loom (1804): Joseph-Marie Jacquard's automated weaving loom controlled by punched cards—introducing the concept of binary coded machine instructions.
- Babbage's Engines (1822–1837): Charles Babbage designed the Difference Engine (to tabulate polynomial functions) and the Analytical Engine (the blueprint of general computing with a "Store", a "Mill" or CPU, and punched card input/output). Ada Lovelace authored algorithms for the engine, earning recognition as the world's first computer programmer.
- Hollerith's Tabulating Machine (1890): Herman Hollerith's electromechanical punched card reader used for the 1890 US Census, establishing the foundation for the Computing-Tabulating-Recording Company (later IBM).
Five Generations of Electronic Digital Computers
| Generation | Active Switching Tech | Operating Systems / Software | Memory Media | Operational Speed | Representative Systems |
|---|---|---|---|---|---|
| First (1940–1956) | Thermionic Vacuum Tubes | Machine Code, Raw Binary, Plugboards | Magnetic Drums, Mercury Delay Lines | Milliseconds ($10^{-3}$ s) | ENIAC, EDVAC, UNIVAC I, IBM 701 |
| Second (1956–1963) | Solid-State Discrete Transistors | Assembly language, Early High-Level Languages (FORTRAN, COBOL) | Magnetic Ferrite Core Memory, Magnetic Tape | Microseconds ($10^{-6}$ s) | IBM 1401, IBM 7094, CDC 1604 |
| Third (1964–1971) | Small/Medium Scale Integrated Circuits (SSI/MSI) | Time-sharing OS, Multiprogramming, Structured HLL (C, Pascal, BASIC) | Magnetic Core transitioning to Semiconductor RAM | Nanoseconds ($10^{-9}$ s) | IBM System/360, PDP-8, PDP-11 |
| Fourth (1971–Present) | Very Large / Ultra Large Scale ICs (VLSI/ULSI Microprocessors) | GUI OS (Windows, macOS, Linux, UNIX), Distributed Networking | Semiconductor Dynamic RAM, Flash SSD, NVMe | Picoseconds ($10^{-12}$ s) | Intel 8086/Pentium/Core, Apple Mac, Enterprise Clusters |
| Fifth (Present–Beyond) | AI SoCs, Neuromorphic Chips, Quantum Qubits | Natural Language Interaction, Neural Networks, Autonomous Agents | 3D Stacked High-Bandwidth Memory (HBM), Optical | Tera/ExaFLOPS, Quantum Superposition | Supercomputers (Frontier, Fugaku), AI accelerators (NVIDIA H100/B200) |
Swipe to see all columns
1.5 Application of computer
Modern computing applications permeate global commerce, governance, and daily life. Key application domains include:
- Banking, FinTech, and Electronic Commerce:
- Real-time online transaction processing (OLTP) managing distributed account ledgers and Automated Teller Machines (ATMs).
- Nepali Implementation Context: The national clearing infrastructure operated by Nepal Clearing House Limited (NCHL), including connectIPS, Fonepay QR payment rails, and central bank RTGS systems.
- Education and Academic Research:
- Learning Management Systems (Moodle, Canvas), computer-assisted instruction (CAI), automated examination evaluation, and large-scale data analysis for scientific dissertations.
- Healthcare and Medical Informatics:
- Diagnostic imaging technologies (Computed Tomography [CT], Magnetic Resonance Imaging [MRI], Ultrasound) relying on inverse Fourier transform image reconstruction algorithms.
- Hospital Information Systems (HIS) managing Electronic Health Records (EHR) and telemetry monitoring.
- Government Administration and E-Governance:
- Centralized citizen registries, automated taxation platforms, biometric national identification systems.
- Nepali Implementation Context: The Nagarik App integration linking national identity cards, passport issuance, Inland Revenue Department (IRD) PAN tracking, and vehicle licensing.
- Telecommunications and Media Distribution:
- Software-Defined Networking (SDN), packet routing across national fiber backbones, 4G/5G base transceiver station scheduling, and digital audio/video streaming.
- Industrial Manufacturing and Robotics:
- Computer-Aided Design (CAD), Computer-Aided Manufacturing (CAM), Supervisory Control and Data Acquisition (SCADA) systems regulating hydroelectric turbine operations in Nepal's river basins.
Key Terms (Unit 1)
- Stored-Program Concept: Architecture where executable program instructions and operative data share internal memory address space.
- GIGO (Garbage In, Garbage Out): The fundamental principle that computational results are directly bounded by input integrity.
- Microcode: Lowest-level hardware translation layer executing native processor register transfers for machine instructions.
- VLSI (Very Large Scale Integration): Technology consolidating hundreds of thousands of transistors onto a single silicon substrate.
Unit 1 Summary
Unit 1 establishes that a computer is an electronic, programmable, stored-program information processing machine characterized by high speed, accuracy, diligence, and versatility. Structurally decomposed into input, CPU (ALU, CU, registers), memory, and output subsystems, its machine cycle continuously fetches, decodes, and executes instructions. Computation systems are classified across physical size, underlying operational principles (analog, digital, hybrid), general vs. dedicated purposes, and architecture. The historical trajectory highlights five generations transitioning from thermionic vacuum tubes to transistors, integrated circuits, microprocessors, and contemporary AI/quantum frontiers.
Detailed Practice Questions and Answer Keys
1. Long Question: Diagrammatically explain the functional architecture of a digital computer. Differentiate between the functions of the Control Unit and the Arithmetic Logic Unit.
Answer Guide:
- Diagram: Provide the complete 5-box block diagram illustrating Input Unit, Central Processing Unit (subdivided into Control Unit, ALU, and Registers), Memory Unit (Primary and Secondary), and Output Unit, annotated with Data flow, Address assertions, and Control signal paths.
- Functional Breakdown:
- Input Unit: Performs analog-to-digital transcoding, buffering raw signals into bus-compatible binary frames.
- CPU: Executes instructions. Registers store immediate operands.
- Control Unit (CU): Acts as the nervous system. Fetches instruction bytes from memory, decodes opcodes using microcode instruction registers, generates clock synchronization pulses, and directs data movement along the internal CPU buses. It does not alter data values.
- Arithmetic Logic Unit (ALU): Acts as the mathematical engine. Accepts binary operands from internal registers or data buses, executes binary arithmetic (full addition, 2's complement subtraction, multiplication) and Boolean logic (
AND,OR,XOR, bit-shifting), and outputs resultant values alongside status condition flags (Carry, Overflow, Zero, Negative). - Memory Unit: Primary memory (RAM/ROM) interfaces directly via high-speed memory controllers for immediate execution. Secondary storage offers non-volatile capacity.
- Output Unit: Decodes binary result buffers into human-readable visual, physical, or auditory formats.
2. Short Question: Compare Second-Generation and Third-Generation computers on switching technology, processing speed, memory, and programming paradigms.
Answer Guide:
- Construct a 5-column table:
- Switching Technology: 2nd Gen used discrete bipolar transistors; 3rd Gen used Small/Medium Scale Integrated Circuits (SSI/MSI silicon IC chips containing dozens to hundreds of transistors).
- Speed: 2nd Gen operated in microseconds ($10^{-6}$ s); 3rd Gen operated in nanoseconds ($10^{-9}$ s).
- Memory: 2nd Gen relied on magnetic ferrite core memory; 3rd Gen utilized early semiconductor memory alongside dense magnetic cores.
- Programming: 2nd Gen introduced early high-level compiled languages (FORTRAN, COBOL); 3rd Gen saw the rise of structured programming (C, Pascal, BASIC) supported by multiprogrammed, time-sharing operating systems. \n---
Expanded chapter notes
Unit 1 — Introduction to computer
The transition from manual calculation to electronic computation represents one of the most significant leaps in human productivity. At its most fundamental level, a computer is not merely a machine that "calculates," but a system designed to process data according to a set of instructions. This unit establishes the groundwork for understanding what constitutes a computer, how it is structured, and how it has evolved from room-sized calculators into the ubiquitous, handheld devices of the modern era. We begin by defining the computer and the characteristics that distinguish it from a simple calculator. From there, we move into the anatomy of the system—the logical flow of data from input to output. We will then categorize computers based on their physical size, the principles of their operation, and their intended purpose. Finally, we will trace the chronological evolution of computing through its five generations and examine the diverse ways these machines are applied across various professional and social domains.
1.1 Definition, characteristics of computer
A computer is an electronic device that accepts raw data as input, processes that data using a set of programmed instructions (software), and produces a meaningful result as output. Unlike a basic calculator, which is designed for a specific set of mathematical operations, a computer is a general-purpose machine. This means its function is not hard-wired; instead, it can be repurposed to perform entirely different tasks—from simulating weather patterns to editing high-definition video—simply by changing the software it executes. The core of this capability lies in the ability to store both data and the instructions for processing that data in a digital format. The utility of a computer is defined by several key characteristics that allow it to outperform human cognition in specific tasks. The first is speed. Computers operate at electronic speeds, performing millions or even billions of instructions per second (MIPS/GIPS). This speed is governed by the internal clock of the processor, which synchronizes the movement of data. For example, a processor running at 3.0 GHz can execute cycles of operations billions of times every second, allowing for the real-time processing of complex graphics or massive datasets that would take a human lifetime to calculate manually. Accuracy is another defining trait. Computers are deterministic; given the same input and the same set of instructions, they will produce the exact same output every time. Errors in computing are rarely the fault of the machine itself but are typically the result of "garbage in, garbage out" (GIGO)—where incorrect data or flawed logic in the program leads to an incorrect result. This precision makes computers indispensable in fields like orbital mechanics or financial accounting, where a single decimal error could lead to catastrophic failure. Diligence refers to the computer's ability to perform repetitive tasks without the fatigue or boredom that affects human operators. A computer can execute the same loop of a million calculations with the same level of precision and speed from the first iteration to the last. This is coupled with versatility , the capacity of a single machine to perform completely unrelated tasks. A user can switch from a word processor to a complex database management system in seconds, as the hardware is designed to be agnostic to the type of data it processes. Finally, storage capacity allows computers to retain vast amounts of information in a very small physical space. This is divided into volatile memory for immediate processing and non-volatile storage for long-term retention. The ability to retrieve a specific piece of data from a terabyte of storage in milliseconds is a characteristic that transforms a computer from a mere processor into a comprehensive information management system.
1.2 Anatomy of computer
The anatomy of a computer refers to the logical and physical organization of its components and how they interact to process information. This is best understood as a linear flow of data, often referred to as the IPOS cycle : Input, Processing, Output, and Storage. Every operation a computer performs, regardless of complexity, follows this fundamental path. The process begins with the Input stage. This is the mechanism by which the computer receives data from the external world. Input devices, such as keyboards, mice, scanners, or microphones, act as translators. They take human-readable information (a keystroke, a voice command, or a physical image) and convert it into binary code—sequences of 0s and 1s—that the electronic circuits of the computer can understand. Without this translation layer, the computer would have no way of interacting with its environment. Once the data is internalized, it moves to the Processing stage. This occurs primarily within the Central Processing Unit (CPU), often described as the "brain" of the computer. Processing involves the manipulation of data according to the instructions provided by the software. This could involve arithmetic calculations (adding two numbers), logical comparisons (checking if one value is greater than another), or data movement (copying a file from one folder to another). The CPU fetches instructions from the memory, decodes what they mean, and executes them. The results of this processing are then sent to the Output stage. Here, the process of translation is reversed. The binary results generated by the CPU are converted back into a form that humans can perceive. An output device, such as a monitor, printer, or speaker, takes the digital signals and transforms them into visual images, printed text, or audible sound. For instance, when a user types a letter, the input is the keystroke, the processing is the CPU determining which character corresponds to that key, and the output is the appearance of that character on the screen. Parallel to this flow is the Storage function. Not all data is processed and discarded immediately; some must be kept for future use. Storage is categorized into primary storage (RAM), which holds data currently being used by the CPU for rapid access, and secondary storage (Hard Drives, SSDs), which keeps data permanently even when the power is turned off. The interaction between the CPU and storage is constant: the CPU pulls data from storage to process it and writes the results back to storage for later retrieval.
Unit 2: Computer Hardware
Teaching hours: 10
Topics in outline order
- 2.1 Basic computer organization and architecture
- 2.2 Components of computer (hardware, software, user, data and procedure)
- 2.3 Components of CPU (ALU, CU and registers)
- 2.4 Computer memory, memory hierarchy, primary and secondary memory
- 2.5 Motherboard and its parts, slots, ports, interface, processor, memory chips
- 2.6 BIOS, SMPS, CMOS and microprocessor chips
2.1 Basic computer organization and architecture
Architecture vs. Organization
In computer engineering, a strict technical distinction exists between architecture and organization:
- Computer Architecture: Refers to the abstract attributes of a computing system visible to the assembly/machine-language programmer—that is, the conceptual design and functional behavior. It encompasses the Instruction Set Architecture (ISA), addressing modes, instruction formats, data types, register set specifications, and interrupt handling mechanisms.
- Computer Organization: Refers to the physical, operational hardware realization of the architectural specification. It encompasses the internal signal interconnections, clock frequencies, memory technology, bus arbitration circuitry, cache configurations, and peripheral interface standards.
classDiagram
class Computer_System
class Architecture {
+Abstract ISA Specification
+Instruction Set (x86, ARM, RISC-V)
+Addressing Modes
+Register Set (Bit-width)
+Interrupt Interfaces
}
class Organization {
+Physical Hardware Realization
+Control Signals & Clocking
+Cache Implementation (L1/L2/L3)
+Bus Standards (PCIe, DDR5)
+Silicon Fabrication Node
}
Computer_System *-- Architecture
Computer_System *-- Organization
Figure 2.1: Conceptual Dichotomy between Computer Architecture and Computer Organization.
Comparison Table
| Attribute | Computer Architecture | Computer Organization |
|---|---|---|
| Focus | What the system does (logical interface) | How the system executes it (physical implementation) |
| Visibility | Directly visible to machine/assembly programmers | Transparent to high-level programmers |
| Design Lifespan | Endures across multiple hardware generations (e.g., x86) | Changes frequently with manufacturing silicon iterations |
| Key Parameters | Register bit-width, opcode encoding, branch logic | Cache line size, pipeline depth, bus clock latency |
2.2 Components of computer (hardware, software, user, data and procedure)
An enterprise computing system consists of an integrated five-part socio-technical ensemble:
- Hardware: The physical, electronic, magnetic, and mechanical silicon components of the system (chassis, PCB traces, semiconductor integrated circuits, power supplies, optical drives).
- Software: The programmed sequences of instructions written in machine, assembly, or high-level languages that govern hardware operations (operating system kernels, compilers, database engines, user applications).
- Data: Raw, unorganized alphanumeric characters, binary blobs, sensor readings, and facts devoid of contextual meaning. When parsed, validated, and structured by software, data transforms into actionable information.
- User (Peopleware): The human agents who interact with, configure, engineer, and operate computing platforms (systems administrators, software engineers, data analysts, end users).
- Procedure: The documented operational rules, protocols, business logic algorithms, and security guidelines dictating how hardware and software must be engaged to achieve institutional objectives (backup schedules, disaster recovery workflows, user onboarding policies).
2.3 Components of CPU (ALU, CU and registers)
The Central Processing Unit (CPU) constitutes the execution core of a computing system.
1. Arithmetic Logic Unit (ALU)
The ALU executes mathematical operations and relational evaluations. Modern ALUs are split into:
- Arithmetic Section: Incorporates fast binary full adders, half adders, hardware multipliers, and barrel shifters capable of executing addition, subtraction, multiplication, and two's-complement arithmetic.
- Logic Section: Performs bitwise Boolean evaluations including
AND,OR,XOR,NOT, bit rotation, and byte-clearing masks.
2. Control Unit (CU)
The CU serves as the orchestrator of instruction execution. Built either via Hardwired Control (fixed combinational logic gates yielding maximum clock speed) or Microprogrammed Control (micro-instructions stored in internal control ROM for design flexibility), the CU executes:
- Sequential instruction retrieval from primary memory.
- Decoding machine-language opcodes into control matrix assertions.
- Broadcasting gating pulses across data paths, multiplexers, and ALU inputs.
3. Dedicated CPU Internal Registers
Registers represent the fastest volatile memory storage locations within the computer hierarchy, operating at single-cycle processor clock frequencies:
- Program Counter (PC): Holds the physical memory address of the next sequential instruction waiting to be fetched.
- Instruction Register (IR): Holds the bit pattern of the operational code currently undergoing decoding.
- Memory Address Register (MAR): Holds the physical RAM address asserted directly onto the system address bus.
- Memory Buffer Register (MBR) / Memory Data Register (MDR): Holds the data word read from or primed to be written to memory.
- Accumulator (AC): Primary register that stores intermediate arithmetic and logical results output by the ALU.
- Program Status Word (PSW) / Flag Register: Contains discrete bit flags indicating the outcome of arithmetic evaluations (Zero Flag [Z], Carry Flag [C], Overflow Flag [O], Sign Flag [S], Parity Flag [P]).
sequenceDiagram
autonumber
participant PC as Program Counter
participant MAR as Memory Address Reg
participant RAM as Primary RAM
participant MBR as Memory Buffer Reg
participant IR as Instruction Reg
participant CU as Control Unit
participant ALU as ALU & Accumulator
PC->>MAR: Transfer next instruction address
MAR->>RAM: Assert address on Address Bus
CU->>RAM: Assert Memory Read Control Signal
RAM->>MBR: Place instruction opcode on Data Bus
MBR->>IR: Load instruction into IR
PC->>PC: Increment address counter
IR->>CU: Decode opcode bits
CU->>ALU: Trigger operand fetch and execution
ALU->>ALU: Execute arithmetic/logic and set PSW flags
Figure 2.2: Register Transfer Level (RTL) Sequence of the Instruction Fetch-Decode Cycle.
2.4 Computer memory, memory hierarchy, primary and secondary memory
The Memory Hierarchy
The memory hierarchy solves the fundamental engineering trade-off: fast memory is physically expensive and low-capacity, while inexpensive, high-capacity storage is physically distant and slow.
flowchart TD
REG["Level 0: CPU Internal Registers<br/>Latency: < 1 ns | Size: < 2 KB | Extremely Expensive"]
L1["Level 1: L1 Cache (On-Die SRAM)<br/>Latency: ~1 ns | Size: 32 KB - 512 KB"]
L2["Level 2: L2 Cache (SRAM)<br/>Latency: ~3-5 ns | Size: 1 MB - 16 MB"]
L3["Level 3: L3 Cache (Shared SRAM)<br/>Latency: ~10-20 ns | Size: 16 MB - 128 MB"]
RAM["Level 4: Main Memory (DRAM / DDR5)<br/>Latency: ~50-80 ns | Size: 8 GB - 128 GB"]
SSD["Level 5: Solid State Drives (NVMe / Flash NAND)<br/>Latency: ~20-100 µs | Size: 256 GB - 4 TB"]
HDD["Level 6: Secondary Storage (Mechanical HDD)<br/>Latency: ~5-15 ms | Size: 1 TB - 20 TB"]
TAPE["Level 7: Tertiary / Archive Storage (Magnetic Tape)<br/>Latency: Seconds to Minutes | Size: Petabytes | Very Cheap"]
REG --- L1 --- L2 --- L3 --- RAM --- SSD --- HDD --- TAPE
Figure 2.3: Structural Memory Hierarchy Illustrating Latency vs. Capacity Dynamics.
Primary Memory
Primary memory interfaces directly with the CPU memory controller:
- Random Access Memory (RAM): Directly addressable volatile working memory.
- Static RAM (SRAM): Uses 6-transistor (6T) flip-flop bistable latches. Does not require periodic capacitive refreshing. Extremely fast (~1 ns), low-density, highly expensive. Used for CPU L1/L2/L3 caches.
- Dynamic RAM (DRAM): Uses a single transistor and capacitor cell (1T-1C) per bit. Capacitors leak charge and require periodic electric recharging cycles (refreshing) hundreds of times per second. Highly dense, low cost, moderate speed. Used for system RAM (DDR4, DDR5).
- Read-Only Memory (ROM): Non-volatile semiconductor storage holding critical boot firmware:
- Mask ROM: Hardwired during factory silicon lithography; non-reprogrammable.
- PROM (Programmable ROM): Field-programmable once via electrical fuse burning.
- EPROM (Erasable PROM): Ultraviolet-light erasable via quartz window package.
- EEPROM (Electrically Erasable PROM): Byte-erasable via high-voltage pulses.
- Flash Memory: High-density block-erasable variant of EEPROM.
Secondary Memory
Non-volatile mass storage maintaining data persistently without electric power:
- Magnetic Storage (Hard Disk Drives - HDD): Employs spinning aluminum/glass platters coated with ferromagnetic thin films. Electromagnetic read/write heads flying on aerodynamic cushions seek concentric tracks to read magnetized domains. Slower access times constrained by mechanical seek latency and rotational delay (~5–12 ms).
- Solid-State Drives (SSD): Non-mechanical mass storage based on floating-gate or charge-trap NAND flash memory cells. Features zero mechanical latency, high shock resistance, and throughput reaching 7000+ MB/s over PCIe NVMe interconnects.
2.5 Motherboard and its parts, slots, ports, interface, processor, memory chips
The motherboard (system board) is the central printed circuit board (PCB) that provides electrical power, signal distribution, and high-speed data bus communications among all hardware components.
Critical Motherboard Subsystems
- Processor Socket: High-density mechanical zero-insertion-force (ZIF) or Land Grid Array (LGA) socket seating the microprocessor (e.g., LGA 1700, AM5) providing thousands of pin connections for memory channels and PCIe lanes.
- Chipset Architecture: High-speed hub controllers coordinating data movement:
- Historically: Split into Northbridge (interfacing CPU, RAM, and high-speed PCIe graphics) and Southbridge (managing slower legacy I/O, SATA, USB, BIOS).
- Modern Architecture: Northbridge functions are fully integrated directly inside the CPU die (Integrated Memory Controller and Root PCIe Complex), while the auxiliary chipset (Platform Controller Hub - PCH) manages secondary PCIe lanes, SATA, USB, and audio buses.
- Expansion Slots:
- PCI Express (PCIe): High-speed serial point-to-point interconnect configured in variable lane bandwidths ($ imes1$, $ imes4$, $ imes8$, $ imes16$), utilized by dedicated graphics cards, NVMe SSD riser cards, and 10GbE network interfaces.
- Memory Slots (DIMMs): Dual In-line Memory Module slots connected to multi-channel 64-bit DDR bus traces.
- Storage Interfaces:
- SATA (Serial ATA III): Legacy 6 Gbps bus utilizing standard storage data and power cables.
- M.2 Form Factor: Direct motherboard slot routing 4 lanes of PCIe bandwidth (NVMe) directly to the processor.
- I/O Ports & External Interfaces: USB (Type-A, Type-C, USB4), HDMI/DisplayPort, RJ-45 Gigabit/10G Ethernet jacks, analog/optical audio connections.
2.6 BIOS, SMPS, CMOS and microprocessor chips
1. BIOS / UEFI
The Basic Input/Output System (BIOS), modernized today as Unified Extensible Firmware Interface (UEFI), is non-volatile low-level firmware stored in a motherboard SPI flash chip:
- POST (Power-On Self-Test): Firmware routine that immediately inspects, diagnoses, and initializes critical hardware (tests CPU registers, RAM integrity, keyboard presence, and video controllers).
- Bootstrap Loader: Locates master boot records (MBR) or EFI system partitions (ESP) on bootable secondary media, reading the operating system kernel into RAM and transferring execution control.
- Runtime Abstraction: Historically provided low-level interrupt routines for keyboard and disk I/O (modern operating systems bypass legacy BIOS routines for native 64-bit drivers).
2. CMOS and CMOS Battery
Complementary Metal-Oxide-Semiconductor (CMOS) refers to the low-power volatile Static RAM chip that retains user BIOS setup configurations (boot priority orders, memory timings, hardware passwords) and powers the Real-Time Clock (RTC). A 3-volt lithium coin cell (CR2032) maintains this SRAM and clock counter when external AC power is disconnected.
3. Switched-Mode Power Supply (SMPS)
The SMPS converts hazardous high-voltage Alternating Current (AC) from utility wall sockets (220V @ 50 Hz in Nepal) into regulated, ripple-free direct current (DC) rails:
+12Vrail: Powers CPU voltage regulator modules (VRMs), discrete GPU cards, and spindle motors.+5Vrail: Powers logic boards of SSDs, SATA drives, and legacy optical media.+3.3Vrail: Powers low-voltage motherboard chipset logic and PCIe circuitry.- Modern SMPS designs employ high-frequency pulse-width modulation (PWM) switching transformers that yield 80-Plus efficiency (80% to 90%+ energy conservation).
4. Microprocessor Chips
The silicon microprocessor integrates millions to billions of nanometer-scale FinFET or Gate-All-Around (GAA) transistors onto a monolithic silicon die or multi-chiplet substrate, packing execution cores, multi-level caches, floating-point units, and hardware security extensions.
Key Terms (Unit 2)
- Instruction Set Architecture (ISA): The programmer-visible abstract machine interface defining instructions, registers, and memory models.
- SRAM vs. DRAM: Static RAM uses 6T flip-flops and requires no refresh; Dynamic RAM uses 1T-1C cells that leak charge and require periodic refreshing.
- NVMe (Non-Volatile Memory Express): An optimized, high-performance scalable host controller interface designed specifically for enterprise and client SSDs utilizing the PCIe bus.
- POST (Power-On Self-Test): Initial diagnostic routine executed by BIOS/UEFI firmware upon system startup.
Unit 2 Summary
Unit 2 explores the physical and microarchitectural foundation of computer hardware. Architecture establishes the logical instruction set interface, while organization specifies the physical hardware execution implementation. The CPU integrates an Arithmetic Logic Unit, a Control Unit (hardwired or microprogrammed), and low-latency internal registers that execute the machine cycle. The memory hierarchy resolves the latency-capacity dilemma by stacking CPU registers, multi-level SRAM caches, dynamic primary RAM, and non-volatile solid-state/magnetic secondary storage. At the system level, the motherboard interconnects the processor socket, chipset, memory DIMM slots, and expansion interfaces, supported by BIOS/UEFI initialization firmware, CMOS real-time clock memory, and SMPS power regulation.
Detailed Practice Questions and Answer Keys
1. Long Question: Analyze the Memory Hierarchy of a modern computer system. Why is such a hierarchical arrangement necessary in computer design?
Answer Guide:
- Necessity: Explain the "Memory Wall" dilemma—the principle that high-speed memory (SRAM) is constrained by exorbitant cost-per-bit and physical silicon surface area limitations, while high-capacity storage (NAND Flash, Magnetic Disks) suffers from severe physical propagation and rotational latencies. To achieve high overall system throughput at reasonable economic cost, systems exploit the Principle of Locality (Temporal and Spatial locality).
- Hierarchy Description: Sketch the pyramid:
- Registers: Single-cycle execution speed (<1 ns), small capacity (<2 KB).
- Caches (L1, L2, L3): On-die Static RAM buffering recently referenced instructions and data blocks (1 ns – 15 ns latency, 32 KB – 64 MB capacity).
- Main Memory (RAM): Dynamic RAM providing working storage for active processes (50 ns – 80 ns latency, 8 GB – 64 GB capacity).
- Secondary Mass Storage (NVMe SSD / HDD): Non-volatile block devices storing filesystems and operating system kernels (20 µs – 10 ms latency, 512 GB – 10 TB capacity).
- Offline Archive (Tape/Cloud Object): Low-cost cold storage.
- Mathematical Relationship: Effective Access Time ($T_{eff}$) can be presented: $T_{eff} = H \times T_{cache} + (1 - H) \times T_{memory}$, where $H$ represents Cache Hit Ratio.
2. Short Question: Differentiate between BIOS and CMOS. Explain what occurs when the CMOS battery fails.
Answer Guide:
- Distinction: BIOS (or modern UEFI) is the executable code/firmware stored permanently in a non-volatile ROM/Flash chip on the motherboard that executes the POST routine and bootstraps the operating system. CMOS is the small bank of volatile Static RAM that retains user configuration settings (hardware boot sequence, overclocking values, system date/time).
- Battery Depletion: When the coin-cell battery (CR2032) discharges completely and external mains power is cut, the volatile CMOS SRAM loses its electrical bias. All customized configuration parameters revert to factory defaults, and the Real-Time Clock (RTC) resets to epoch time (e.g., 00:00 01/01/2000). The user encounters a
CMOS Checksum Error - Defaults Loadedalert on startup and must manually reset clock parameters to prevent SSL/TLS certificate failures in web browsers. \n---
Expanded chapter notes
While Unit 1 established the conceptual framework of what a computer does, Unit 2 focuses on the physical reality of how it does it. Hardware is not merely a collection of plastic and silicon; it is a meticulously engineered environment designed to facilitate the movement and manipulation of electrons to represent logical states. To understand hardware is to understand the physical constraints of speed, heat, and distance that dictate how software is written and how systems are scaled. This unit moves from the macro-level organization of the system down to the microscopic components of the microprocessor. We begin by distinguishing between computer architecture and organization, establishing the theoretical model that governs almost every modern machine. We then examine the five essential components of a complete computer system, moving beyond the hardware to include the human and procedural elements. The core of the unit is a deep dive into the Central Processing Unit (CPU) and the memory hierarchy, explaining why a computer needs different types of storage to function efficiently. Finally, we explore the motherboard and the supporting electronic systems—such as the BIOS and SMPS—that provide the necessary infrastructure for the processor to operate.
2.1 Basic computer Organization and Architecture
In academic computing, a sharp distinction is made between computer architecture and computer organization. Computer architecture refers to the attributes of a system as seen by the programmer—the "logical" design. This includes the instruction set architecture (ISA), which defines the set of commands the CPU can execute, the number of bits used to represent data (e.g., 32-bit vs. 64-bit), and the addressing modes. If you think of a computer as a building, the architecture is the blueprint; it specifies that there must be a kitchen, three bedrooms, and a front door, but it does not specify what brand of pipes are used in the walls. Computer organization , conversely, is the operational realization of that architecture. It deals with the hardware components and their interconnections that realize the architectural specifications. This includes the physical design of the control unit, the type of memory technology used, and the specific circuitry of the data bus. Using the building analogy, organization is the actual construction process—the choice of copper versus PVC piping and the specific placement of electrical outlets to ensure the blueprint is functional. The dominant model for modern computer organization is the Von Neumann Architecture. Proposed by John von Neumann in 1945, this model introduced the "stored-program concept," where both the program instructions and the data are stored in the same read-write memory. Before this, computers had to be physically rewired to change their task. The Von Neumann model consists of a CPU, a memory unit, and input/output interfaces, all connected by a system bus. However, this architecture introduces a fundamental limitation known as the Von Neumann Bottleneck. Because there is only one bus connecting the CPU and memory, the CPU cannot fetch an instruction and read/write data at the same time. The processor, which operates at nanosecond speeds, often spends a significant amount of time idling while waiting for data to arrive from the relatively slower memory. This bottleneck is the primary reason why modern computers employ complex caching strategies and multi-level memory hierarchies, which we will examine in detail in section 2.4.
2.2 Component of computer (hardware, software, user, data and procedure)
A functioning computer is not defined by its hardware alone, but by the synergy of five interacting components. If any one of these is missing, the system cannot achieve its purpose of solving real-world problems. Hardware is the tangible, physical aspect of the system. This includes the circuitry, the chassis, the peripherals, and the semiconductors. Hardware provides the raw computational power and the means of interaction. However, hardware is inert; it is a set of switches and gates that cannot act without direction. Software provides the instructions that tell the hardware what to do. It is divided into system software (like the operating system), which manages the hardware resources, and application software (like a web browser), which performs specific tasks for the user. Software translates human intent into the binary signals that the hardware can process. Data is the raw material that the computer processes. Data consists of facts, figures, or symbols that have not yet been processed to reveal meaning. For example, a list of numbers is data; once the computer calculates the average of those numbers, the result is information. Data is the bridge between the real world and the digital environment. Users are the people who operate the computer and provide the goals for its operation. The user is not merely an operator but a critical component of the system loop. The user provides the input, defines the problem, and interprets the output. In an undergraduate context, users are categorized by their level of interaction: end-users, who use applications; power users, who configure systems; and developers, who create the software. Procedures are the set of rules or guidelines that people follow to use the software and hardware effectively. A procedure could be as simple as a manual on how to back up data or as complex as a corporate security policy for accessing a server. Without procedures, the interaction between the user, the software, and the hardware would be chaotic and prone to error. For instance, a database is useless if the procedure for entering data is inconsistent, leading to corrupted records.
Unit 3: Computer Software
Teaching hours: 10
Topics in outline order
- 3.1 Introduction to software, program
- 3.2 Types of software (system and application)
- 3.3 Operating system (function and types)
- 3.4 Utility software, virus and antivirus software
- 3.5 Programming language and types of language translator
3.1 Introduction to software, program
Conceptual Foundations
- Program: An ordered, syntactically correct sequence of instructions encoded in a programming language designed to direct a computer hardware processing unit to execute a specific task or calculation.
- Software: A comprehensive collection of computer programs, associated libraries, configuration files, operating system drivers, digital assets, and technical documentation designed to perform complex operations. Software constitutes the intangible intellectual logic that animates computer hardware.
flowchart TD
Raw["Algorithm / Logic Design"] --> Code["Source Code (Programmer-authored)"]
Code --> Comp["Compiler / Assembler Engine"]
Comp --> Bin["Binary Executable (.exe, ELF)"]
Bin --> Soft["Complete Software Package<br/>(Executables + Shared Libraries + Configs + Docs)"]
Figure 3.1: Relationship between Programs, Binaries, and Packaged Software.
3.2 Types of software (system and application)
Software falls into two major engineering divisions: System Software and Application Software.
graph TD
Software["Computer Software"]
Software --> System["System Software"]
Software --> App["Application Software"]
System --> OS["Operating Systems (Windows, Linux, macOS)"]
System --> Translators["Language Translators (Compilers, Interpreters, Assemblers)"]
System --> Drivers["Device Drivers (GPU, NIC, Audio)"]
System --> Utilities["Utility Programs (Disk Cleaners, Antivirus, Backup)"]
App --> General["General Purpose (Word Processors, Spreadsheets, Web Browsers)"]
App --> Customized["Custom / Bespoke (Banking Core, University Portals)"]
App --> UtilityApp["Specialized Domain (CAD, Video Editors, Accounting Tally)"]
Figure 3.2: Comprehensive Software Classification Hierarchy.
Comparative Matrix
| Feature | System Software | Application Software |
|---|---|---|
| Primary Role | Manages, virtualizes, and controls underlying hardware resources | Solves specific user, business, or operational tasks |
| Interaction Layer | Sits directly between hardware and user application layers | Sits on top of the operating system interface |
| Development Complexity | Low-level (C, C++, Assembly, Rust), direct hardware manipulation | High-level (Java, Python, C#, JavaScript, Go) |
| User Awareness | Often runs silently in background (daemons, services, kernels) | Explicit, interactive graphical or command-line interaction |
| Failure Impact | Crash can cause complete system failure (Kernel Panic, BSOD) | Crash typically terminates only the isolated user space process |
3.3 Operating system (function and types)
Definition and Architecture
An Operating System (OS) is system software that acts as an intermediary between computer hardware and user applications. It virtualizes bare-metal hardware resources, enforces access security boundaries, and manages concurrency.
flowchart LR
User["User Applications<br/>(Browsers, Word, DB Clients)"]
SysCall["System Call Interface<br/>(POSIX, Win32 APIs)"]
Kernel["OS Kernel<br/>(Process Scheduler, Memory Mgr, VFS, Drivers)"]
Hardware["Physical Hardware<br/>(CPU, RAM, Disks, NIC)"]
User <-->|User Space| SysCall
SysCall <-->|Privileged Transition| Kernel
Kernel <-->|Kernel Space| Hardware
Figure 3.3: Dual-Mode Operation and the OS System Call Boundary.
Core Functions of an Operating System
- Process Management: Allocates CPU execution time via scheduling algorithms (Round Robin, Shortest Job First, Multi-Level Feedback Queues), synchronizes threads, and resolves resource deadlocks.
- Memory Management: Dynamically allocates and deallocates address space in RAM, tracks free memory frames, and establishes Virtual Memory through page tables, swapping inactive memory pages to disk backing stores.
- File System Management: Abstracts raw physical storage blocks into hierarchical directory structures, managing access permissions, file allocation tables (FAT32, NTFS, ext4), inode pointers, and metadata.
- Device (I/O) Management: Mediates communication between CPU instructions and external peripheral controllers using specialized Device Drivers, buffering, spooling (e.g., print spooling), and interrupt service routines (ISRs).
- Security and Protection: Enforces user privilege isolation (Dual-mode operation: Ring 0 Kernel Mode vs. Ring 3 User Space), ensuring errant user processes cannot overwrite kernel memory or hijack peripheral controllers.
Major Operating System Types
- Single-User, Single-Tasking OS: Permits only one user to execute one process at any single moment. Example: MS-DOS.
- Single-User, Multi-Tasking OS: Allows a single user to run multiple concurrent processes (e.g., editing code while streaming media). Example: Modern Windows 11, macOS.
- Multi-User, Time-Sharing OS: Allocates processor time-slices among hundreds of concurrent users authenticated via remote terminals. Example: Linux, UNIX, z/OS.
- Real-Time Operating System (RTOS): Guarantees process completion within strict, deterministic microsecond deadlines. A missed deadline constitutes complete system failure. Example: VxWorks, FreeRTOS (utilized in avionics, automotive engine management, medical pacemakers).
- Distributed Operating System: Orchestrates a network of physically independent compute nodes so that they appear to end users as a unified, coherent computing environment.
3.4 Utility software, virus and antivirus software
Utility Software
Utilities are system software tools designed to analyze, configure, optimize, and maintain computer performance:
- Disk Management Utilities: Partitioning tools (Fdisk, GParted), defragmentation engines, disk cleanup utilities.
- Data Compression Utilities: Algorithms (LZW, Deflate) reducing disk footprints (ZIP, RAR, 7z).
- Backup and Restore Tools: System imaging and snapshot tools ensuring business continuity.
Malicious Software (Malware) & Viruses
- Computer Virus: A self-replicating programmatic parasite that attaches its executable payload to legitimate host executable files (
.exe,.dll, boot sectors). When the infected host executes, the virus code runs, corrupting system files or modifying memory. - Worm: A standalone malicious program that exploits network security vulnerabilities to self-replicate across networked nodes without human intervention or host file attachment.
- Trojan Horse: Malware masked as legitimate, desirable software (e.g., a cracked utility) that opens unauthorized backdoor ports for remote administrative access.
- Ransomware: Malware that systematically encrypts victim documents using asymmetric/symmetric cryptography, demanding payment for decryption keys.
Antivirus Software Architecture
Antivirus software operates using three defensive tiers:
- Signature-Based Detection: Scans files against a database of known cryptographic hashes or byte-pattern sequences (signatures) extracted from documented malware samples. Fast, but blind to zero-day variants.
- Heuristic Analysis: Analyzes instruction code patterns and control flow paths to detect suspicious characteristics commonly found in malware (e.g., unauthorized attempts to modify the Master Boot Record or inject code into other process threads).
- Behavioral Sandboxing: Executes untrusted executables inside an isolated virtual memory container, monitoring runtime system call activities (registry modifications, outbound socket binds) before granting bare-metal host clearance.
3.5 Programming language and types of language translator
Evolution of Programming Languages
- First-Generation (1GL - Machine Language): Raw binary sequences (
01001000 01100101) directly decoded by CPU logic. Highly efficient, but platform-specific and error-prone to author. - Second-Generation (2GL - Assembly Language): Replaces raw binary opcodes with human-readable alphanumeric mnemonics (
MOV,ADD,SUB,JMP). Architecture-specific, requiring hardware-level register awareness. - Third-Generation (3GL - High-Level Procedural/Object-Oriented): Machine-independent languages featuring English-like keywords, algebraic expressions, and structured data types (C, C++, Java, Pascal, Python).
- Fourth-Generation (4GL - Declarative/Domain-Specific): Emphasizes what outcome is required rather than explicitly coding procedural control loops (SQL, MATLAB, R).
- Fifth-Generation (5GL - Constraint/Logic-Based): Solves problems by establishing logical constraints and deduction rules rather than manual algorithms (Prolog, Mercury).
Language Translators
Language translators convert human-authored source code into machine-executable binary bitstreams.
flowchart TD
subgraph Assembler_Flow ["Assembly Translation"]
ASM["Assembly Code (Mnemonics)"] --> ASS["Assembler"] --> M1["Machine Code Object"]
end
subgraph Compiler_Flow ["Compilation Translation (Ahead-of-Time)"]
SRC1["High-Level Source Code (C / C++)"] --> COMP["Compiler"] --> M2["Direct Machine Code Executable"]
end
subgraph Interpreter_Flow ["Interpreted Execution"]
SRC2["High-Level Source Code (Python / JS)"] --> INT["Interpreter Engine"]
INT -->|Instruction-by-instruction execution| OUT["Runtime Output"]
end
Figure 3.4: Comparative Translation Pipelines for Assemblers, Compilers, and Interpreters.
Comparison: Compiler vs. Interpreter
| Metric | Compiler | Interpreter |
|---|---|---|
| Input Transformation | Translates entire source file into a standalone object/binary module before execution | Translates and executes source statements line-by-line in real time |
| Execution Speed | Extremely fast; direct bare-metal CPU execution without translation overhead | Slower; execution loop continuously parses and evaluates source text |
| Intermediate Object | Generates persistent .obj or .exe files |
Does not generate machine code files; requires interpreter at runtime |
| Error Reporting | Compiles full diagnostics list for all syntactic errors across the entire codebase | Halts execution immediately upon encountering the first error encountered |
| Portability | Target binary is architecture-specific (must recompile for different OS/CPU) | Source code runs unmodified on any host possessing the target interpreter engine |
| Examples | C, C++, Rust, Go, Fortran | Python, Ruby, PHP, classical JavaScript |
Key Terms (Unit 3)
- Kernel: The central core of an operating system retaining complete control over all hardware resources.
- Virtual Memory: Memory management technique that abstracts secondary storage as extensions of primary RAM via paging.
- Assembler: Language translator converting assembly mnemonics into discrete machine-level binary code.
- Zero-Day Vulnerability: A software security flaw known to attackers before software authors develop a protective patch.
Unit 3 Summary
Unit 3 establishes the software layer that animates computing hardware. Software partitions into System Software (operating systems, language translators, device drivers, maintenance utilities) and Application Software (general-purpose productivity packages and bespoke domain applications). The operating system acts as the hardware supervisor, providing process scheduling, virtual memory management, structured filesystem access, and device I/O abstraction. Security defense relies on multi-tiered antivirus engines combining signature scanning, heuristics, and sandboxing to counter viruses, worms, and ransomware. Finally, programming languages evolved from machine binary and assembly up to structured 3GLs and declarative 4GLs, translated into executable formats via compilers, interpreters, or assemblers.
Detailed Practice Questions and Answer Keys
1. Long Question: What is an Operating System? Explain its role as an extended machine and a resource manager. Detail any four of its primary functions.
Answer Guide:
- Definition: An operating system is the core system software that manages physical hardware, provides common services for user programs, and presents an abstracted, safe runtime environment.
- Two Conceptual Views:
- Extended Machine (Top-Down): Bare hardware is difficult to program (dealing with raw disk head step-timings, interrupt masks). The OS provides clean, standardized abstractions (files, processes, sockets, GUI windows) via the System Call interface, extending bare silicon into a usable virtual machine.
- Resource Manager (Bottom-Up): The computer contains multiple competing processes requesting CPU time, memory space, and I/O access. The OS acts as an impartial controller, arbitrating resource requests, optimizing hardware utilization, and preventing deadlocks.
- Four Primary Functions:
- Process Management: Creation, scheduling, preemption, and inter-process communication (IPC).
- Memory Management: Virtual memory paging, protection boundaries between processes, dynamic allocation.
- File Management: Organizing raw storage blocks into logical files, directories, access permissions (read/write/execute).
- Device I/O Management: Buffering, caching, spooling, and loading hardware device drivers to expose uniform interfaces.
2. Short Question: Differentiate between a Compiler and an Interpreter with respect to execution cycle, error diagnostics, memory usage, and execution speed.
Answer Guide:
- Construct a 4-point comparison:
- Execution Cycle: A compiler processes the complete source program ahead-of-time (AOT), generating a standalone executable binary file (
.exe, ELF). An interpreter evaluates source statements line-by-line at runtime, executing actions dynamically. - Error Diagnostics: A compiler scans the entire codebase during compilation passes, providing a comprehensive list of all syntax and type errors before any code runs. An interpreter stops execution abruptly the moment it encounters the first erroneous statement.
- Memory Usage: Compiled code requires substantial memory during the compilation phase, but the resulting executable runs leanly. Interpreted execution requires the full interpreter engine, symbol tables, and runtime parser to remain memory-resident throughout execution.
- Execution Speed: Compiled binaries execute at near-native CPU speeds (often 10x to 100x faster). Interpreted execution is inherently slower due to the continuous overhead of line-by-line runtime parsing and dispatch. \n---
- Execution Cycle: A compiler processes the complete source program ahead-of-time (AOT), generating a standalone executable binary file (
Expanded chapter notes
If hardware is the physical body of a computer, software is its mind. While Unit 2 detailed the electronic pathways and silicon gates that allow a computer to function, those components are inert without a set of instructions to direct them. Software is the bridge between human intent and electronic execution. It transforms a general-purpose machine into a specialized tool, whether that tool is a scientific simulator, a financial ledger, or a communication portal. This unit explores the layers of abstraction that allow us to interact with hardware without needing to understand the physics of electrons. We begin by defining the relationship between a single program and the broader concept of software. We then categorize software into system and application types, examining how they differ in purpose and proximity to the hardware. A significant portion of this unit is dedicated to the Operating System, the most critical piece of system software, analyzing its functions and the various types of OS architectures. We will also examine utility software and the ongoing conflict between malicious software (viruses) and defensive tools (antivirus). Finally, we will analyze the evolution of programming languages and the translators—compilers, interpreters, and assemblers—that convert human-readable code into the binary language of the microprocessor.
3.1 Introduction to Software, program
In the strictest technical sense, software is a collection of data, programs, and documentation that tells a computer how to work. It is the intangible component of a computer system. Unlike hardware, which wears out physically over time, software does not "wear out"; instead, it becomes obsolete or "decays" as the environment it operates in (the hardware or the OS) evolves. Software provides the logical instructions that the CPU executes, acting as a layer of abstraction that hides the complexity of the hardware from the user. At the core of all software is the program. A program is a specific set of ordered instructions written in a programming language to perform a particular task. If software is a library, a program is a single book. For example, a simple calculator is a program; the entire suite of office productivity tools (including the calculator, word processor, and spreadsheet) constitutes software. A program follows a deterministic logic: it takes an input, processes it through a series of algorithmic steps, and produces an output. The relationship between a program and software is one of scale and complexity. A modern software package, such as a web browser, consists of millions of lines of code organized into thousands of individual programs and modules. These modules work in concert to handle different tasks—one module might handle the rendering of HTML, another handles network requests, and another manages the user's history. This modularity allows developers to update one part of the software without having to rewrite the entire system. The execution of software involves a transition from a passive state to an active state. When software is stored on a hard drive, it is passive data. When a user "runs" a program, the operating system loads the program's instructions from the secondary storage into the primary memory (RAM). Once in RAM, the CPU can fetch these instructions one by one, executing them at billions of cycles per second. This transition is what allows a single piece of hardware to switch instantaneously from being a gaming console to being a professional accounting tool.
3.2 Types of Software (System and Application)
Software is broadly categorized based on its purpose and its relationship with the hardware. The primary distinction is between system software and application software. System Software is designed to provide a platform for other software to run on and to manage the computer's internal resources. It operates at a low level, meaning it has direct access to the hardware. System software is essential for the computer to function; without it, the hardware would be a collection of useless parts. The most prominent example is the Operating System, but system software also includes Device Drivers , which are specialized programs that allow the OS to communicate with specific hardware, such as a printer or a graphics card. For instance, when you install a new printer, you install a driver that translates the OS's general "print" command into the specific electronic signals that the printer's hardware understands. Application Software is designed to perform specific tasks for the end-user. Unlike system software, application software does not interact with the hardware directly; instead, it makes requests to the system software, which then handles the hardware interaction. This is a critical security and stability feature: if an application like a word processor had direct access to the RAM or the CPU, a single bug in the program could crash the entire computer. By forcing applications to go through the system software, the OS can act as a gatekeeper. Application software can be further divided into two categories: General-Purpose and Customized (Bespoke) software. General-purpose software, such as Google Chrome or Microsoft Excel, is designed for a wide audience and can be used for a variety of tasks. Customized software is written for a specific organization to meet unique needs. For example, a bank's internal core-banking system is bespoke software; it is designed specifically to handle that bank's unique account structures and regulatory requirements and is not available for purchase by the general public. The boundary between these two types is sometimes blurred by Utility Software , which performs maintenance tasks on the system. While utilities are often bundled with the operating system, they serve a purpose that feels like an application (helping the user) but operates at a level of depth typical of system software (optimizing the disk or managing memory).
Unit 4: Database Management System
Teaching hours: 5
Topics in outline order
- 4.1 Introduction to data, database and DBMS
- 4.2 Database system architecture
- 4.3 Database models, database application
- 4.4 SQL and NoSQL concepts
- 4.5 Introduction to data warehousing
- 4.6 Data mining and concept of big data
4.1 Introduction to data, database and DBMS
Data vs. Information
- Data: Unorganized, raw facts, observations, numeric values, or alphanumeric symbols lacking context (e.g.,
45,"BCA","2025"). - Information: Data that has been processed, structured, contextualized, and presented so that it carries semantic meaning and actionable value (e.g., "Roll number 45 is enrolled in BCA for the 2025 academic session").
- Database: A logically coherent, organized collection of related data structured to minimize redundancy and facilitate efficient querying, updating, and administrative governance.
- Database Management System (DBMS): A sophisticated software suite that provides an interface between the physical database storage and application programs or end users. It governs data storage, query execution, access permissions, crash recovery, and multi-user transactional integrity.
Limitations of Traditional File-Processing Systems vs. DBMS
| Challenge | File-Processing System (CSV, Text) | Database Management System (DBMS) |
|---|---|---|
| Data Redundancy | Identical data duplicated across multiple independent department files | Centralized schema enforces controlled normalization, minimizing duplication |
| Data Inconsistency | Updating an address in one file leaves stale data in other unlinked files | Single logical update propagates across all dependent views automatically |
| Data Isolation | Data scattered across disparate proprietary file formats; difficult to join | Unified structured query language (SQL) joins diverse entities seamlessly |
| Atomicity Problems | Partial failure during file writes leaves records corrupted | ACID transaction guarantees ensure all-or-nothing execution |
| Concurrent Access | Naive file-level locking blocks concurrency or causes race conditions | Fine-grained row-level locks and multiversion concurrency control (MVCC) |
| Security Enforcement | Relies on rudimentary OS file read/write permissions | Granular role-based access control down to table, row, and column levels |
4.2 Database system architecture
The standard architectural framework for database systems is the ANSI-SPARC Three-Level Architecture, engineered to achieve Data Independence (shielding user applications from changes in physical storage or logical schemas).
flowchart TD
subgraph External_Level ["External Level (User Views)"]
V1["View 1: Student Portal<br/>(Reads Grades, Attendance)"]
V2["View 2: Account Dept<br/>(Reads Fees, Payment Status)"]
V3["View 3: Faculty View<br/>(Edits Marks, Enters Scores)"]
end
subgraph Conceptual_Level ["Conceptual Level (Logical Schema)"]
CS["Unified Logical Schema<br/>(Entities, Relationships, Constraints, Integrity Rules)<br/>Logical Data Independence"]
end
subgraph Internal_Level ["Internal Level (Physical Storage Schema)"]
IS["Physical Storage Schema<br/>(B-Tree Indexes, Block Sizes, Compression, File Offsets)<br/>Physical Data Independence"]
end
subgraph Database ["Physical Media"]
DB[(Underlying Physical Data Blocks on Storage Media)]
end
V1 <--> CS
V2 <--> CS
V3 <--> CS
CS <--> IS
IS <--> DB
Figure 4.1: ANSI-SPARC Three-Level Database Architecture.
The Three Schema Levels
- External Level (View Level): The highest abstraction layer. Individual users interact only with specialized, tailored views of the database, concealing irrelevant columns or restricted data fields (e.g., masking employee salary figures from academic staff).
- Conceptual Level (Logical Level): Defines the global logical schema for the entire organization. It describes what data is stored, entity relationships, data types, and semantic integrity constraints (e.g., Foreign Keys, Uniqueness rules).
- Internal Level (Physical Level): The lowest technical abstraction layer. It defines how data is physically arranged on disk blocks, indexing schemes (B+ Trees, Hashing), file access paths, data compression formats, and storage encryption.
Data Independence
- Logical Data Independence: The capacity to modify the conceptual schema (adding a new table, adding an optional attribute) without requiring changes to existing external views or user applications.
- Physical Data Independence: The capacity to modify internal physical storage schemas (reorganizing disk partitions, rebuilding indexes, migrating from HDD to NVMe SSD) without modifying the conceptual schema or application code.
4.3 Database models, database application
Core Database Models
- Hierarchical Model: Organizes data into an inverted tree structure with single-parent and multiple-child nodes ($1:N$ relationships only). Rigid and difficult to query across lateral branches. Historical example: IBM IMS.
- Network Model: Extends the hierarchical approach by allowing records to possess multiple parent nodes, establishing complex graph-like structures ($M:N$ relationships) via pointer sets. Historical example: CODASYL DBTG.
- Relational Model (RDBMS): Founded by Edgar F. Codd in 1970, it represents all data logically in two-dimensional tables called relations. Columns represent attributes and rows represent tuples. Tables relate through matching shared attributes (keys). Modern examples: PostgreSQL, MySQL, Oracle, SQLite, Microsoft SQL Server.
- Object-Oriented / Object-Relational Model: Blends traditional relational persistence with object-oriented programming concepts (encapsulation, inheritance, complex types, stored methods).
Real-World Database Applications
- Enterprise Resource Planning (ERP): Coordinating inventory, procurement, and payroll ledgers across commercial supply chains.
- Telecommunications Billing: Processing billions of Call Detail Records (CDRs) and data packet billing sessions daily for mobile network operators (NTC, Ncell).
- Core Banking Systems: Managing financial transactions with rigorous compliance to ACID properties (Atomicity, Consistency, Isolation, Durability).
4.4 SQL and NoSQL concepts
Relational Databases and SQL
Structured Query Language (SQL) is the standardized declarative language used to manage, query, and manipulate relational databases. SQL comprises sub-languages:
- DDL (Data Definition Language): Defines schema structures (
CREATE,ALTER,DROP,TRUNCATE). - DML (Data Manipulation Language): Manipulates entity rows (
SELECT,INSERT,UPDATE,DELETE). - DCL (Data Control Language): Manages access permissions (
GRANT,REVOKE). - TCL (Transaction Control Language): Manages atomic transactions (
COMMIT,ROLLBACK,SAVEPOINT).
-- DDL: Creating a normalized Students table
CREATE TABLE Students (
StudentID INT PRIMARY KEY,
FullName VARCHAR(100) NOT NULL,
Semester INT CHECK (Semester BETWEEN 1 AND 8),
EnrolledDate DATE DEFAULT CURRENT_DATE
);
-- DML: Inserting sample data
INSERT INTO Students (StudentID, FullName, Semester)
VALUES (101, 'Aayush Shrestha', 1),
(102, 'Pooja Thapa', 1);
-- DQL: Querying with filtering and projection
SELECT StudentID, FullName
FROM Students
WHERE Semester = 1
ORDER BY FullName ASC;
NoSQL Database Paradigms
NoSQL ("Not Only SQL") architectures emerged to resolve horizontal scalability bottlenecks, massive unstructured data volumes, and rigid schema constraints inherent in traditional monolithic RDBMS engines.
mindmap
root((NoSQL Families))
Document Stores
JSON / BSON format
MongoDB, Couchbase
Hierarchical semi-structured data
Key-Value Stores
Simple dictionary hash lookup
Redis, Memcached, DynamoDB
Ultra-low-latency caching & sessions
Column-Family Stores
Wide-column sparse matrices
Apache Cassandra, ScyllaDB, HBase
High-write time-series & analytics
Graph Databases
Nodes, Edges, Properties
Neo4j, Amazon Neptune
Social networks, fraud detection, routing
Figure 4.2: Four Major NoSQL Architectural Taxonomies.
Comparison: RDBMS vs. NoSQL
| Dimension | Relational Databases (RDBMS) | NoSQL Databases |
|---|---|---|
| Data Structure | Rigid, normalized two-dimensional tables with strict schemas | Dynamic, flexible, schema-less (Document, Key-Value, Graph, Column) |
| Scaling Model | Vertical Scaling (Scale-up: adding faster CPU, more RAM to one server) | Horizontal Scaling (Scale-out: sharding across clusters of commodity nodes) |
| Guarantees | ACID (Atomicity, Consistency, Isolation, Durability) | BASE (Basically Available, Soft-state, Eventual consistency) / CAP theorem |
| Query Mechanism | Structured Query Language (SQL) with complex joins | Specialized object APIs, RESTful queries, document selectors |
| Best Used For | Financial transactions, ERP, systems requiring absolute data consistency | Big data streaming, social feeds, rapid mobile backends, high-velocity clickstreams |
4.5 Introduction to data warehousing
Definition and Conceptual Goal
A Data Warehouse (DWH) is a centralized, integrated, time-variant, non-volatile database engineered specifically for management decision-support, statistical analysis, and business intelligence (BI) rather than rapid day-to-day transactional processing.
Four Defining Characteristics (Inmon's Model)
- Subject-Oriented: Optimized around critical institutional analytical themes (sales, admissions, revenue, churn) rather than day-to-day operations.
- Integrated: Ingests disparate, inconsistently formatted data from multiple heterogeneous transactional sources (legacy CSVs, internal ERPs, external web feeds) and cleanses them into a unified schema standard.
- Time-Variant: Retains historical operational records across long horizons (5 to 10+ years) timestamped to permit longitudinal trend evaluations.
- Non-Volatile: Historical records are append-only. They are never altered or deleted during normal reporting operations; updates occur via batched periodic ETL synchronizations.
The ETL Architecture
- Extract: Raw transactional data is pulled from production operational databases.
- Transform: Raw records are cleansed, deduplicated, mapped, type-cast, and structured into analytical schemas.
- Load: The consolidated output is loaded into the Data Warehouse for analytical querying.
flowchart LR
O1["Operational DB<br/>(PostgreSQL)"] --> ETL
O2["Legacy Billing<br/>(Flat Files)"] --> ETL
O3["Web Server Logs<br/>(JSON)"] --> ETL
subgraph Pipeline ["ETL Integration Pipeline"]
ETL["Extract -> Transform -> Load<br/>(Cleansing, Standardization, Dedup)"]
end
Pipeline --> DWH[(Centralized Data Warehouse)]
DWH --> OLAP["OLAP Cubes & Star Schemas"]
OLAP --> BI["Business Intelligence Dashboards & Executive Reports"]
Figure 4.3: Enterprise Data Warehouse and ETL Data Pipeline Architecture.
4.6 Data mining and concept of big data
Data Mining
Data Mining is the computational process of analyzing massive historical data repositories to discover previously unknown, valid, actionable patterns, correlations, and anomalies using statistical algorithms, machine learning models, and database management heuristics.
Key Data Mining Techniques
- Classification: Categorizes records into predefined discrete target classes (e.g., predicting whether a loan applicant will default:
High Riskvs.Low Risk). - Clustering: Unsupervised grouping of data points into natural clusters based on mathematical multidimensional distance metrics (e.g., segmenting mobile banking customers by usage behavior).
- Association Rule Mining: Uncovers affinities between co-occurring events (e.g., Market Basket Analysis identifying that users buying milk frequently purchase bread simultaneously).
Big Data and the 5 V's
Big Data refers to datasets whose scale, complexity, and generation velocity exceed the storage, management, and processing capacities of traditional relational database architectures.
mindmap
root((The 5 V's of Big Data))
Volume
Terabytes to Zettabytes
Distributed file systems (HDFS, Cloud S3)
Velocity
Real-time streaming ingestion
Kafka, Apache Flink, IoT sensor arrays
Variety
Structured (RDBMS), Semi-structured (JSON, XML), Unstructured (Audio, Video, PDF)
Veracity
Data quality, noise, bias, trustworthiness
Value
Extraction of actionable business insight
Figure 4.4: The Five Architectural V's of Big Data.
Key Terms (Unit 4)
- Data Independence: Separation of data structures across architectural levels such that changes to one level do not impact higher levels.
- ACID Properties: Set of guarantees (Atomicity, Consistency, Isolation, Durability) ensuring reliable database transactions.
- NoSQL: Non-relational distributed database systems designed for horizontal scalability and schema flexibility.
- ETL: Extract, Transform, Load pipeline transferring data from operational systems to an analytical data warehouse.
Unit 4 Summary
Unit 4 outlines modern database management systems, contrasting their centralized schema control and ACID transactional safety with the redundancy and inconsistency problems of legacy file systems. The ANSI-SPARC three-level architecture (External, Conceptual, Internal) guarantees both logical and physical data independence. While the relational model structures data into normalized tables queried via SQL, NoSQL systems (Document, Key-Value, Columnar, Graph) offer horizontal scaling and schema flexibility for distributed workloads. Finally, analytical data architectures transition from day-to-day OLTP toward Data Warehouses through ETL pipelines, enabling Data Mining pattern extraction across high-Volume, high-Velocity, and high-Variety Big Data environments.
Detailed Practice Questions and Answer Keys
1. Long Question: Describe the ANSI-SPARC three-level database architecture. Explain how this architecture accomplishes logical and physical data independence with concrete examples.
Answer Guide:
- Architecture Breakdown: Sketch the three-tiered structure:
- External Level: Multiple custom user views tailored to specific job roles, hiding unauthorized fields.
- Conceptual Level: The single comprehensive logical blueprint of the database containing all entities, relations, data types, and enterprise constraints.
- Internal Level: Low-level physical disk storage specification detailing record layouts, file offsets, compression, and index structures.
- Logical Data Independence: The capacity to alter the conceptual schema without breaking external views. Example: Adding an optional attribute
EmergencyContactto theStudentstable does not require rewriting the existingExaminationFeePortalview, which continues reading unchanged columns seamlessly. - Physical Data Independence: The capacity to change physical storage arrangements without modifying the conceptual schema or application queries. Example: Moving the
Transcriptstable from an unindexed magnetic spinning disk array to a B-Tree indexed NVMe SSD partition with block-level encryption changes storage files, but application SQL queries (SELECT * FROM Transcripts WHERE StudentID = ?) remain entirely identical.
2. Short Question: Differentiate between OLTP (Online Transaction Processing) and OLAP (Online Analytical Processing).
Answer Guide:
- Construct a 4-point comparison table:
- Primary Objective: OLTP manages day-to-day real-time transactional operations (inserting orders, debiting bank balances); OLAP enables strategic decision-making and business intelligence trend analysis.
- Data Characteristics: OLTP contains current, up-to-the-second operational data organized in highly normalized schemas (3NF) to minimize write overhead; OLAP contains consolidated historical data organized in denormalized star or snowflake schemas to maximize read throughput.
- Query Complexity: OLTP executes short, simple, high-frequency read/write operations affecting individual rows; OLAP executes complex, long-running read-only queries that aggregate millions of rows (e.g., calculating annual revenue growth by region).
- Users: OLTP is accessed concurrently by thousands of clerks, customers, and online web clients; OLAP is queried selectively by business analysts, data scientists, and executives. \n---
Expanded chapter notes
Up to this point, we have examined how computers process instructions and manage system resources. However, the ultimate purpose of most computing systems is the management of information. While a simple program can store data in a variable or a text file, these methods fail when the volume of data grows or when multiple users need to access the same information simultaneously. This unit introduces the Database Management System (DBMS), a specialized software layer designed to handle the complexities of data storage, retrieval, and integrity. We begin by distinguishing between raw data and meaningful information, and by exploring why traditional file-based storage is insufficient for modern needs. We then analyze the architecture of a DBMS, specifically how it separates the physical storage of data from the way a user perceives it. We will examine the various models used to structure data—from the rigid hierarchies of the past to the flexible relational and NoSQL models of today. Finally, we move into the realm of large-scale data analysis, exploring how data warehousing, data mining, and the concept of "Big Data" allow organizations to extract strategic intelligence from massive datasets.
4.1 Introductions to data, database and DBMS
To understand a database, one must first understand the distinction between data and information. Data consists of raw, unorganized facts—numbers, characters, or symbols—that have no inherent meaning on their own. For example, the number "42" is data; it tells us nothing until it is given context. When that data is processed, structured, and presented in a meaningful context—such as "The temperature in the server room is 42 degrees Fahrenheit"—it becomes information. The goal of any data management system is to efficiently transform raw data into actionable information. Before the advent of the DBMS, organizations used File-Based Systems , where data was stored in separate flat files (like .txt or .csv files). This approach suffered from several critical flaws. The first was data redundancy , where the same piece of information was stored in multiple files. For instance, a student's address might be stored in both the "Library" file and the "Tuition" file. This led to data inconsistency ; if the student moved, the address might be updated in the Library file but not in the Tuition file, leaving the system with conflicting truths. Furthermore, file systems lacked security and concurrency control, meaning two users could not update the same file at once without risking data corruption. A database is a structured collection of related data organized in a way that minimizes redundancy and maximizes accessibility. To manage this collection, we use a Database Management System (DBMS). A DBMS is a software suite that acts as an intermediary between the user and the database. Instead of the user writing a program to open a file and search for a line of text, the user sends a high-level request to the DBMS, which then handles the physical task of locating the data on the disk. The DBMS provides several essential services. It ensures data integrity by enforcing rules (e.g., a "Birth Date" field cannot contain text). It provides concurrency control , allowing thousands of users to access the same database simultaneously through a process called locking. It also manages security , ensuring that a payroll clerk can see employee salaries while a receptionist cannot. By decoupling the data from the applications that use it, the DBMS ensures that the data remains a consistent, single source of truth for the entire organization.
4.2 Database system Architecture
The architecture of a DBMS is designed to hide the technical complexity of data storage from the end-user. This is achieved through the Three-Schema Architecture (also known as the ANSI-SPARC architecture), which divides the system into three distinct levels of abstraction. The lowest level is the Internal Level (Physical Schema). This describes how the data is actually stored on the physical storage media. It deals with the most granular details: the size of the data blocks, the indexing methods used to speed up searches, and the compression techniques employed to save space. The internal level is concerned with efficiency and hardware optimization. The middle level is the Conceptual Level (Logical Schema). This describes what data is stored in the database and the relationships between those data points. It defines the tables, the fields within those tables, and the constraints that apply to them. For example, the conceptual schema would define that a "Customer" table exists and that every "Customer" must have a unique "Customer ID." This level is the "blueprint" of the database and is typically managed by the Database Administrator (DBA). The highest level is the External Level (View Schema). This is the level the end-user interacts with. Since different users need different views of the data, the external level provides "views." A salesperson might see a view of the database containing customer contact info and order history, while an accountant sees a view containing invoices and payment statuses. Neither user sees the entire database; they only see the subset of data relevant to their role. The primary advantage of this three-tiered approach is Data Independence. There are two types: Physical Data Independence , which allows the DBA to change the physical storage (e.g., moving the database from an HDD to an SSD) without needing to change the conceptual schema; and Logical Data Independence , which allows the conceptual schema to be modified (e.g., adding a new field to a table) without affecting the external views used by the end-users.
Unit 5: Computer Network and Internet
Teaching hours: 5
Topics in outline order
- 5.1 Introduction to network, intranet, internet
- 5.2 Types of networks, LAN topologies
- 5.3 Transmission media, network devices
- 5.4 Data communication, transmission modes
- 5.5 OSI reference model, network protocols
- 5.6 Concept of web and WWW, URL, DNS, client-server
5.1 Introduction to network, intranet, internet
Conceptual Definitions
- Computer Network: An interconnected collection of autonomous computing nodes (servers, workstations, network switches, mobile devices, IoT sensors) linked via transmission media and standardized communication protocols that enable resource sharing, distributed computing, and data exchange.
- Intranet: A strictly gated, private internal network owned and administered by an enterprise or institution. It employs standard Internet protocols (TCP/IP, HTTP, SMTP) but restricts access exclusively to authenticated internal employees or authorized on-premise terminals behind perimeter firewalls.
- Extranet: A controlled extension of an enterprise Intranet that securely exposes designated internal services and databases to trusted external stakeholders (suppliers, vendors, business partners, affiliated campuses) via encrypted tunnels or Virtual Private Networks (VPNs).
- Internet: The globally decentralized public "network of networks" interconnecting billions of autonomous private, public, academic, and governmental networks bound together by the TCP/IP protocol suite and coordinated globally via the Internet Assigned Numbers Authority (IANA) and ICANN.
flowchart TD
subgraph Enterprise ["Enterprise Perimeter"]
Intranet["Intranet<br/>(Internal Staff Only, Private IP Space)"]
DMZ["Extranet / DMZ<br/>(Authorized Partners, Suppliers, Campuses)"]
end
FW["Perimeter Firewall & NAT Gateway"]
PublicInternet["Public Internet<br/>(Global Network of Networks)"]
Intranet <--> DMZ
DMZ <--> FW
FW <--> PublicInternet
Figure 5.1: Network Boundary Relationships: Intranet, Extranet, and the Public Internet.
5.2 Types of networks, LAN topologies
Network Classifications by Geographical Span
- PAN (Personal Area Network): Spans the immediate workspace of an individual ($<10$ meters). Built primarily on short-range wireless protocols (Bluetooth, Zigbee, NFC, Ultra-Wideband). Use case: Wearable fitness tracker syncing biometrics to a smartphone.
- LAN (Local Area Network): Confined to a geographically localized area such as a single computer laboratory, corporate office floor, or university campus building ($<1$ km). Characterized by high data transfer rates (1 Gbps to 10 Gbps Ethernet / Wi-Fi 6) and low propagation delay.
- MAN (Metropolitan Area Network): Covers an entire municipality or urban geographic district ($10$ to $50$ km). Often operated by cable television consortia, municipal utilities, or regional telecommunications carriers utilizing metro Ethernet and dark fiber rings.
- WAN (Wide Area Network): Spans regional, national, or intercontinental geographic expanses ($>100$ km). Relies on transmission facilities provided by common telecommunications carriers, submarine transoceanic fiber cables, and satellite orbital links. The Internet is the world's largest public WAN.
LAN Topologies
Topology dictates the geometric and logical arrangement of network nodes and links.
graph TD
subgraph Star_Topology ["Star Topology (Central Hub/Switch)"]
SW((Central Switch))
A[Node A] --- SW
B[Node B] --- SW
C[Node C] --- SW
D[Node D] --- SW
end
subgraph Ring_Topology ["Ring Topology (Token Passing)"]
R1[Node 1] --> R2[Node 2] --> R3[Node 3] --> R4[Node 4] --> R1
end
subgraph Bus_Topology ["Bus Topology (Shared Trunk Line)"]
T1((Terminator)) --- B1[Node] --- B2[Node] --- B3[Node] --- T2((Terminator))
end
Figure 5.2: Classical Local Area Network Physical Topologies.
Comparative Evaluation of Topologies
| Topology | Cabling Complexity | Fault Tolerance | Installation Cost | Typical Application |
|---|---|---|---|---|
| Bus | Minimal (single shared coaxial trunk) | Poor (break in central trunk collapses entire network) | Very Low | Legacy Ethernet (10Base2); industrial CAN bus |
| Star | Moderate (dedicated run per node) | High (single cable failure isolates only that node) | Moderate | Modern twisted-pair Ethernet office deployments |
| Ring | Low (point-to-point ring loop) | Low (break in loop halts token propagation unless dual-ring) | Moderate | FDDI token networks, SONET telecommunications rings |
| Mesh | High ($N(N-1)/2$ links for full mesh) | Extreme (multiple redundant alternate routing paths) | Very High | Core ISP routing backbones, mission-critical datacenters |
| Tree / Hybrid | Hierarchical tiered layout | High (failures isolated to local branches) | High | Enterprise multi-floor campus network designs |
Swipe to see all columns
5.3 Transmission media, network devices
1. Guided (Bounded / Wired) Transmission Media
- Twisted-Pair Cable: Composed of color-coded copper conductor pairs twisted helically around each other to cancel out electromagnetic interference (EMI) and mutual crosstalk.
- Unshielded Twisted Pair (UTP): Standard Category 6 (Cat6) supports 1 Gbps up to 100 meters; Cat6a supports 10 Gbps. Terminated via standardized 8-pin RJ-45 modular connectors.
- Shielded Twisted Pair (STP): Encased in conductive foil shielding to mitigate intense industrial RF noise.
- Coaxial Cable: Features a solid central copper core surrounded by dielectric insulation, a braided metal grounding shield, and an outer insulating jacket. Offers higher noise immunity than UTP. Used in broadband cable television networks and legacy 10Base5 Ethernet.
- Fiber-Optic Cable: Transmits data as modulated optical light pulses through microscopic cylindrical cores of ultra-pure silica glass or plastic utilizing the physical principle of Total Internal Reflection.
- Single-Mode Fiber (SMF): Narrow core diameter (~9 µm) carrying a single laser beam path. Extremely low attenuation, enabling 100 Gbps+ transmissions across tens of kilometers without repeaters.
- Multi-Mode Fiber (MMF): Wider core diameter (~50–62.5 µm) accommodating multiple light angles emitted by inexpensive LEDs. Used for campus inter-building backbones ($<500$ meters).
2. Unguided (Wireless) Transmission Media
- Radio Waves: Omnidirectional frequencies (3 kHz to 1 GHz). Capable of penetrating building walls. Used for FM broadcasting, cellular wireless networks, and Wi-Fi.
- Microwaves: Unidirectional, line-of-sight frequencies (1 GHz to 300 GHz). Requires focused parabolic dish antennas mounted on high towers. Susceptible to atmospheric rain attenuation. Widely used for inter-city telecommunications trunks in mountainous terrains like Nepal.
- Infrared: Extremely high frequencies (300 GHz to 400 THz). Cannot penetrate physical walls, making it secure against eavesdropping. Used in short-range remote controls and device transceivers.
3. Core Network Interconnection Devices
- Repeater (Physical Layer 1): Regenerates and amplifies attenuated electrical or optical signals over extended physical cable runs.
- Hub (Physical Layer 1): Multi-port repeater. Naively broadcasts all incoming frames out to every connected port, creating a single massive collision domain. Obsolete in modern networks.
- Bridge (Data Link Layer 2): Connects two distinct LAN segments, filtering traffic based on MAC hardware addresses.
- Switch (Data Link Layer 2): High-speed intelligent multi-port bridge. Inspects destination MAC addresses in Ethernet frames, maintaining an internal Content Addressable Memory (CAM) table to forward frames exclusively to the specific physical destination port. Eliminates packet collisions.
- Router (Network Layer 3): Inspects logical Network layer destination IP addresses. Maintains dynamic routing tables (OSPF, BGP) to determine optimal paths for routing packets across disparate networks.
- Gateway: A protocol converter operating across all layers of the OSI stack, translating communication structures between fundamentally incompatible network architectures.
5.4 Data communication, transmission modes
Fundamental Components of a Communication System
- Message: The operational data payload undergoing transmission.
- Sender (Transmitter): The node orchestrating and transmitting the signal.
- Receiver: The destination target accepting the transmission.
- Medium: The physical guided cable or wireless pathway linking sender and receiver.
- Protocol: The mutually agreed-upon formal rules governing data encoding, timing, handshaking, error detection, and flow control.
Directional Transmission Modes
- Simplex Mode: Unidirectional data transmission. Channel capacity is dedicated to one direction only; the receiver can never transmit responses back. Examples: Television and radio broadcasting, computer-to-monitor HDMI feeds, keyboard-to-CPU signals.
- Half-Duplex Mode: Bidirectional transmission, but only one party can transmit at any given instant. When one node transmits, the other must listen. Examples: Walkie-talkie radio transceivers, legacy shared-hub Ethernet (CSMA/CD).
- Full-Duplex Mode: Simultaneous bidirectional data transmission. Both nodes can transmit and receive data frames concurrently over isolated channels or frequency divisions. Examples: Switched modern Ethernet, mobile cellular phone conversations.
flowchart LR
subgraph Simplex ["Simplex (Unidirectional)"]
S1[Transmitter] -->|One Direction Only| R1[Receiver]
end
subgraph Half_Duplex ["Half-Duplex (Alternating Bidirectional)"]
S2[Station A] <-->|Either Transmits OR Receives| R2[Station B]
end
subgraph Full_Duplex ["Full-Duplex (Simultaneous Bidirectional)"]
S3[Station A] ===|Concurrent Simultaneous TX/RX| R3[Station B]
end
Figure 5.3: Comparative Architectural Flow of Data Transmission Modes.
5.5 OSI reference model, network protocols
The ISO/OSI 7-Layer Reference Model
The International Organization for Standardization (ISO) established the Open Systems Interconnection (OSI) reference model to standardize vendor-neutral inter-computer communications.
flowchart TD
L7["Layer 7: Application Layer<br/>(HTTP, HTTPS, FTP, DNS, SMTP, SSH) | PDU: Data"]
L6["Layer 6: Presentation Layer<br/>(Encryption, Compression, ASCII/Unicode Encoding) | PDU: Data"]
L5["Layer 5: Session Layer<br/>(Dialog Control, Session Token Checkpoints, RPC) | PDU: Data"]
L4["Layer 4: Transport Layer<br/>(End-to-End Reliability, Port Addressing: TCP, UDP) | PDU: Segment / Datagram"]
L3["Layer 3: Network Layer<br/>(Logical IP Addressing, Path Determination, Routing: IPv4, IPv6, ICMP) | PDU: Packet"]
L2["Layer 2: Data Link Layer<br/>(Physical MAC Addressing, Framing, Flow & Error Control: Ethernet, Wi-Fi) | PDU: Frame"]
L1["Layer 1: Physical Layer<br/>(Raw Bitstreams, Signaling Volts, Cables, Connectors: RJ-45, Fiber) | PDU: Bits"]
L7 --- L6 --- L5 --- L4 --- L3 --- L2 --- L1
Figure 5.4: The ISO/OSI 7-Layer Model Hierarchy and Protocol Data Units (PDUs).
Detailed Layer Responsibilities
- Physical Layer (Layer 1): Transmits unstructured raw bitstreams over physical media. Defines pin layouts, voltages, line impedances, signal pulses, and cable specifications.
- Data Link Layer (Layer 2): Groups raw bits into structured Frames. Handles physical hardware MAC addressing (48-bit hex addresses), channel access arbitration (CSMA/CD, CSMA/CA), and error detection via Cyclic Redundancy Checks (CRC).
- Network Layer (Layer 3): Packages frames into Packets. Manages logical IP addressing (IPv4 32-bit, IPv6 128-bit) and executes optimal path selection (routing) across interconnected subnets.
- Transport Layer (Layer 4): Ensures end-to-end transport integrity across network boundaries. Breaks data streams into Segments, tracks process-to-process delivery using Port numbers (e.g., Port 80 for HTTP, Port 443 for HTTPS), enforces flow control via sliding windows, and handles segment reassembly.
- TCP (Transmission Control Protocol): Connection-oriented, reliable 3-way handshake (
SYN,SYN-ACK,ACK), guarantees sequenced delivery with retransmissions. - UDP (User Datagram Protocol): Connectionless, best-effort lightweight datagram protocol prioritizing low latency over reliability (used in VoIP, DNS, video streaming).
- TCP (Transmission Control Protocol): Connection-oriented, reliable 3-way handshake (
- Session Layer (Layer 5): Establishes, maintains, synchronizes, and terminates communication sessions (dialogues) between remote applications. Inserts recovery checkpoints into long data transfers.
- Presentation Layer (Layer 6): Translates data formats between application syntax and standardized network wire formats. Manages data serialization, character transcoding (EBCDIC to ASCII), data compression, and cryptographic encryption/decryption (SSL/TLS).
- Application Layer (Layer 7): Sits directly beneath user software interfaces, exposing standardized network communication services (HTTP/HTTPS for web browsing, SMTP/IMAP for email, FTP for file transfers, DNS for domain lookups).
5.6 Concept of web and WWW, URL, DNS, client-server
Web vs. Internet
A critical conceptual error among beginners is conflating the Internet with the World Wide Web:
- The Internet: The underlying physical and logical telecommunication infrastructure (cables, routers, switches, IP packets) providing global connectivity.
- The World Wide Web (WWW): An application-layer information service built on top of the Internet. Invented by Sir Tim Berners-Lee in 1989 at CERN, the Web is a global collection of hyperlinked multimedia documents formatted in HTML and navigated via HTTP.
Anatomy of a Uniform Resource Locator (URL)
A URL is a standardized string address identifying the location of a specific resource on the World Wide Web:
$$ ext{https://www.tu.edu.np:443/academic/bca/syllabus.html?year=2025\#unit5}$$
- Protocol Scheme (
https://): Declares the application protocol (Hypertext Transfer Protocol Secure). - Subdomain (
www.): Identifies the host web server alias. - Domain Name (
tu.edu.np): The registered human-readable hostname resolved by DNS. - Port Number (
:443): Explicit target TCP socket port (default for HTTPS is 443; HTTP is 80). - Path (
/academic/bca/syllabus.html): The logical hierarchical filesystem path locating the resource on the host server. - Query String (
?year=2025): Parameter key-value pairs passed to server-side scripts. - Fragment Identifier (
#unit5): Internal anchor bookmark scrolling to a specific heading in the document.
Domain Name System (DNS) Resolution Process
DNS acts as the distributed internet directory, translating human-friendly domain names (bca.tu.edu.np) into machine-routable 32-bit IPv4 or 128-bit IPv6 addresses (103.10.235.12).
sequenceDiagram
autonumber
participant Browser as Client Browser
participant Resolver as Recursive DNS Resolver (ISP)
participant Root as Root DNS Server (.)
participant TLD as TLD Server (.np)
participant Auth as Authoritative Server (tu.edu.np)
Browser->>Resolver: Resolve "bca.tu.edu.np"
Resolver->>Root: Query "." root for ".np"
Root-->>Resolver: Referral to .np TLD Name Server
Resolver->>TLD: Query ".np" server for "tu.edu.np"
TLD-->>Resolver: Referral to Authoritative Server for tu.edu.np
Resolver->>Auth: Query "bca.tu.edu.np"
Auth-->>Resolver: Returns A Record: 103.10.235.12
Resolver-->>Browser: Returns resolved IP: 103.10.235.12
Browser->>Browser: Establishes TCP connection to 103.10.235.12
Figure 5.5: Step-by-Step Recursive DNS Resolution Lifecycle.
Client-Server Architecture
In this networking computing model:
- Client: The requesting agent (web browser, mobile app) that initializes an outbound connection, sends structured request headers, and renders returned payloads.
- Server: A high-availability listening host that binds to a static network port, accepts incoming concurrent connections, validates authentication tokens, executes business logic, queries database storage, and responds with standardized status codes (e.g.,
200 OK,404 Not Found,500 Internal Error).
Key Terms (Unit 5)
- MAC Address: A globally unique 48-bit hexadecimal hardware identifier burned into a Network Interface Card (NIC).
- Collision Domain: A physical network segment where data packets can collide with one another when transmitted simultaneously.
- TCP 3-Way Handshake: Connection setup sequence utilizing
SYN,SYN-ACK, andACKcontrol flags to establish reliable communications. - DNS (Domain Name System): The distributed hierarchical lookup system mapping domain names to numerical IP addresses.
Unit 5 Summary
Unit 5 covers computer networking and telecommunications architectures. Beginning with network classifications by geographical span (PAN, LAN, MAN, WAN) and topological structures (Star, Mesh, Bus, Ring), it contrasts guided copper and fiber media with unguided wireless transmission frequencies. Interconnection hardware operates across distinct layers, from physical repeaters and Layer 2 intelligent switches to Layer 3 packet routers. The ISO/OSI 7-layer reference model standardizes network communications, establishing clear functional abstraction from physical signaling up to transport reliability (TCP vs. UDP) and application protocols. Finally, the World Wide Web is contextualized as a client-server hypertext application riding over the underlying Internet, coordinated through structured URLs, recursive DNS lookups, and HTTP transactions.
Detailed Practice Questions and Answer Keys
1. Long Question: Compare the OSI 7-Layer Reference Model with the TCP/IP Protocol Architecture. Explain the functional responsibilities of the Transport and Network layers.
Answer Guide:
- Architectural Comparison:
- The OSI model is a theoretical 7-layer vendor-neutral framework developed by ISO that strictly separates services, interfaces, and protocols.
- The TCP/IP model is a practical 4-layer (or 5-layer) implementation suite that emerged from ARPANET and forms the operational foundation of the modern Internet.
- OSI's Application, Presentation, and Session layers map directly into the single consolidated Application layer of TCP/IP.
- OSI's Data Link and Physical layers correspond to TCP/IP's Network Access / Link layer.
- Transport Layer Responsibilities:
- Manages process-to-process delivery using 16-bit Port numbers.
- Segment segmentation and reassembly.
- Provides connection-oriented, reliable delivery with flow control (sliding window) and error recovery (TCP), or connectionless, low-overhead best-effort datagram transport (UDP).
- Network Layer Responsibilities:
- Logical host addressing through IPv4 and IPv6 protocols.
- Routing: Running shortest-path algorithms to forward packets across intermediate subnets and autonomous systems.
- Packet fragmentation and handling Time-to-Live (TTL) hop counts to prevent endless routing loops.
2. Short Question: Differentiate between a Network Switch and a Network Router.
Answer Guide:
- Construct a 4-point comparison table:
- OSI Operating Layer: A switch operates primarily at the Data Link layer (Layer 2); a router operates at the Network layer (Layer 3).
- Addressing Schemes: Switches examine physical 48-bit MAC hardware addresses; routers examine logical 32-bit (IPv4) or 128-bit (IPv6) IP network addresses.
- Domain Scope: A switch isolates collision domains but forwards all broadcast packets within a single local subnet; a router breaks up both collision domains and broadcast domains, filtering inter-subnet traffic.
- Forwarding Mechanism: Switches maintain a Content Addressable Memory (CAM) table populated by source MAC learning; routers maintain routing tables populated via static routes or dynamic routing protocols (OSPF, BGP). \n---
Expanded chapter notes
The utility of a computer is exponentially increased when it is connected to other computers. In isolation, a machine is limited to the data stored on its own disks and the processing power of its own CPU. However, when computers are networked, they can share resources, synchronize data, and communicate across vast distances. This unit examines the architecture of connectivity, moving from the physical cables and hardware that link two machines to the complex, global protocols that govern the internet. We begin by defining the fundamental nature of networks and the distinction between private and public connectivity. We then explore the physical layout of networks—how they are categorized by scale and how their geometric arrangement (topology) affects their reliability. From there, we analyze the hardware of transmission, including the cables and devices that route data. We will then move into the logical side of networking, studying the OSI reference model, which provides a universal language for how different systems communicate. Finally, we examine the World Wide Web and the client-server architecture that enables the modern browsing experience.
5.1 Introductions to Network. Intranet, Internet
A computer network is a collection of interconnected computing devices that can communicate with one another and share resources. These resources can be hardware (such as a shared printer or a centralized storage server) or software (such as a shared database or a collaborative application). At its simplest, a network consists of two computers connected by a cable; at its most complex, it is a global web of billions of devices. The primary goal of any network is to facilitate the movement of data from a source to a destination with minimum error and maximum speed. To understand the scope of networking, we must distinguish between different levels of access and ownership. An Intranet is a private network accessible only to an organization's staff. It uses the same protocols as the internet (such as TCP/IP and HTTP) but is protected by firewalls to prevent external access. A company might use an intranet to host internal employee directories, policy documents, and private collaboration tools. The primary advantage of an intranet is security and control; the organization can manage exactly who sees what data without exposing that data to the public. The Internet , by contrast, is a global "network of networks." It is a public, decentralized system that connects millions of private, public, academic, business, and government networks. Unlike an intranet, the internet has no single owner or central governing body. Instead, it relies on a set of standardized protocols that ensure a computer in Tokyo can communicate seamlessly with a server in New York. When a private intranet allows limited access to authorized external users (such as partners or vendors), it is referred to as an Extranet. The transition from isolated computing to networked computing shifted the paradigm of data storage. In a non-networked environment, data is centralized on a single machine. In a networked environment, data can be distributed. This allows for redundancy—where data is mirrored across multiple sites to prevent loss—and scalability, where the processing load can be shared across multiple machines to handle a surge in traffic.
5.2 Types of networks, LAN Topologies
Networks are categorized primarily by their geographic scale, which dictates the hardware used and the speed of transmission. The smallest scale is the Personal Area Network (PAN) , which typically covers a range of a few meters. A PAN is used for connecting personal devices, such as a smartphone connecting to a wireless earbud or a smartwatch. These networks usually rely on short-range wireless technologies like Bluetooth. A Local Area Network (LAN) covers a small geographic area, such as a single home, an office, or a building. LANs are characterized by high data transfer speeds and low latency because the distance the signal must travel is short. They are typically owned and managed by a single person or organization and often use Ethernet cables or Wi-Fi. Above the LAN is the Metropolitan Area Network (MAN) , which spans a city or a large campus. A MAN often connects several LANs together, such as a city's public library system connecting various branches to a central municipal server. The largest scale is the Wide Area Network (WAN). A WAN covers a vast distance, such as a country or a continent. Because of the distance, WANs often rely on leased telecommunication lines, fiber-optic undersea cables, or satellite links. The internet is the ultimate example of a WAN. Because the signal must travel thousands of miles, WANs typically have higher latency (delay) and lower speeds than LANs. While "type" refers to scale, Topology refers to the geometric arrangement of the devices. The choice of topology determines the network's cost, its ease of installation, and its resilience to failure.
- Bus Topology: All devices are connected to a single central cable called the "backbone." Data travels along the cable, and each device checks if the data is addressed to it. If the backbone cable breaks, the entire network fails.
- Star Topology: Every device is connected to a central hub or switch. All communication passes through this center. This is the most common modern LAN topology because if one cable breaks, only that specific device is disconnected; the rest of the network continues to function.
- Ring Topology: Devices are connected in a closed loop. Data travels in one direction from one device to the next. While orderly, a single break in the ring can crash the entire network unless a dual-ring (redundant) system is used.
- Mesh Topology: Every device is connected to every other device. This provides the highest level of redundancy; if one path fails, there are dozens of other routes the data can take. However, the cabling cost is prohibitively high for large networks.
- Hybrid Topology: This is a combination of two or more topologies. For example, a company might use a star topology in each department but connect those stars via a bus backbone to create a "Tree" topology.
Unit 6: Computer Security
Teaching hours: 8
Topics in outline order
- 6.1 Introduction: security threats and security attacks
- 6.2 Malicious software and types of viruses
- 6.3 Security mechanisms (cryptography, digital signature)
- 6.4 Firewall, user authentication, intrusion detection system
- 6.5 Security awareness and security policy
6.1 Introduction: security threats and security attacks
The CIA Security Triad
Computer security centers on preserving three fundamental security goals known as the CIA Triad:
- Confidentiality: Preventing unauthorized disclosure of sensitive data. Access is restricted exclusively to authenticated, authorized principals via encryption, access controls, and data classification.
- Integrity: Protecting data from unauthorized, undetected alteration, fabrication, or deletion. Guarantees that information remains authentic and mathematically verifiable via cryptographic hashing and checksums.
- Availability: Ensuring computing systems, network communication channels, and databases remain accessible and operational for authorized users whenever demanded, mitigated through redundancy, failover clusters, and DDoS defenses.
mindmap
root((CIA Triad & Non-Repudiation))
Confidentiality
Encryption (AES, RSA)
Access control lists (ACL)
Data masking
Integrity
Cryptographic hashing (SHA-256)
Digital signatures
Versioned audit logs
Availability
High-availability clustering
DDoS mitigation
Redundant power (SMPS/UPS)
Non-Repudiation
Asymmetric signing
Irrefutable provenance
Figure 6.1: Foundational Information Security Pillars.
Threats vs. Vulnerabilities vs. Attacks
- Vulnerability: An inherent flaw, weakness, or misconfiguration in software logic, operating system kernels, hardware designs, or physical procedural security (e.g., an unpatched buffer overflow bug in a web server).
- Threat: Any circumstance, event, or adversarial entity possessing the potential to exploit a vulnerability and compromise the CIA triad.
- Attack: An intentional, deliberate action executed by a threat actor to compromise, exploit, or disrupt an information asset.
Attack Classifications: Passive vs. Active Attacks
| Parameter | Passive Attacks | Active Attacks |
|---|---|---|
| Objective | Eavesdrop on and observe communication payloads without altering data | Systematically alter, disrupt, inject, or forge data streams and system states |
| System State | System resources and files remain completely unmodified | File systems corrupted, services taken down, or fraudulent transactions posted |
| Detection | Extremely difficult to detect in real-time (no anomalous telemetry spikes) | Readily detected through service outages, integrity alarms, and crash dumps |
| Primary Defense | Preventative Strong End-to-End Encryption (TLS, IPsec) | Detection and Recovery (Firewalls, IPS, Backups, Multi-factor Authentication) |
| Examples | Packet sniffing, wiretapping, traffic analysis | Denial of Service (DoS), Man-in-the-Middle (MitM), SQL Injection, Replay attack |
6.2 Malicious software and types of viruses
Malware is umbrella terminology representing hostile, intrusive, or intentionally damaging software designed to compromise host integrity.
Malware Taxonomy
- File-Infector Virus: Parasitic code that prepends or appends its machine code payload to legitimate executable files (
.exe,.com). When executed, the virus payload executes first before transferring control back to the host program. - Boot Sector Virus: Overwrites the Master Boot Record (MBR) or partition boot sector of secondary storage media, executing before the operating system kernel is loaded into RAM.
- Macro Virus: Encoded within document macros (Microsoft Word, Excel) exploiting embedded scripting languages (VBA) to propagate across documents.
- Polymorphic / Metamorphic Virus: Employs built-in encryption routines and mutation engines to alter its underlying binary byte sequences with each propagation cycle, evading naive static signature-based antivirus scanners.
- Worm: A network-borne autonomous program that actively scans for unpatched open network ports, self-propagating across subnets without user intervention.
- Spyware & Keyloggers: Covertly records keyboard keystrokes, browser histories, credentials, and microphone audio, transmitting exfiltrated data to adversary command-and-control servers.
- Ransomware: Encrypts user files with military-grade symmetric keys (AES-256) and encrypts the symmetric key with a public asymmetric key, presenting a ransom demand screen.
6.3 Security mechanisms (cryptography, digital signature)
Cryptography Foundations
Cryptography is the scientific discipline of transforming intelligible plain text into unintelligible cipher text to ensure confidentiality and integrity across untrusted communication channels.
- Plaintext ($P$): The original, legible data message.
- Ciphertext ($C$): The encrypted, obfuscated output representation.
- Encryption Algorithm ($E$): The mathematical function that maps $P$ to $C$ using a key $K$: $C = E(K, P)$.
- Decryption Algorithm ($D$): The inverse mathematical function that recovers $P$ from $C$: $P = D(K, C)$.
Symmetric vs. Asymmetric Cryptography
flowchart TD
subgraph Symmetric_Key ["Symmetric Key Cryptography (Single Shared Secret)"]
P1["Plaintext"] --> ENC1["Encryption Engine (AES)"]
KEY1["Shared Secret Key (K)"] --> ENC1
ENC1 --> C1["Ciphertext"]
C1 --> DEC1["Decryption Engine (AES)"]
KEY1 --> DEC1
DEC1 --> P1_Out["Recovered Plaintext"]
end
subgraph Asymmetric_Key ["Asymmetric Key Cryptography (Public/Private Pair)"]
P2["Plaintext"] --> ENC2["Encryption Engine (RSA)"]
PUB["Recipient Public Key (Open)"] --> ENC2
ENC2 --> C2["Ciphertext"]
C2 --> DEC2["Decryption Engine (RSA)"]
PRIV["Recipient Private Key (Confidential)"] --> DEC2
DEC2 --> P2_Out["Recovered Plaintext"]
end
Figure 6.2: Comparative Cryptographic Pipelines: Symmetric vs. Asymmetric Schemes.
Comparative Cryptographic Matrix
| Dimension | Symmetric Cryptography (Secret Key) | Asymmetric Cryptography (Public Key) |
|---|---|---|
| Key Architecture | Single shared secret key for both encryption and decryption | Mathematically linked key pair: Public Key (encrypts) & Private Key (decrypts) |
| Computational Speed | Extremely fast; executed via hardware CPU instructions (AES-NI) | Computationally expensive; 1000x slower due to complex modular exponentiation |
| Key Distribution | High vulnerability: how to safely share the secret key over untrusted channels? | Simple: Public key can be broadcast openly to the world; Private key remains secure |
| Primary Standard | Advanced Encryption Standard (AES-128, AES-256), ChaCha20 | RSA (2048/4096-bit), Elliptic Curve Cryptography (ECC / Ed25519) |
| Primary Usage | Bulk payload encryption for files, databases, and active TLS streams | Key exchange handshakes, digital identity certificates, digital signatures |
Digital Signatures and Non-Repudiation
A Digital Signature is a cryptographic mathematical mechanism that binds a digital document to an identity, providing:
- Authenticity: Verifies that the sender genuinely authored the transmission.
- Integrity: Cryptographically proves the document was not altered in transit.
- Non-Repudiation: The signer cannot later dispute the authenticity of their signature because only they hold the private signing key.
sequenceDiagram
autonumber
participant Sender as Alice (Signer)
participant Channel as Untrusted Network
participant Recipient as Bob (Verifier)
Sender->>Sender: Hash message with SHA-256 -> Digest D1
Sender->>Sender: Encrypt Digest D1 with Alice's PRIVATE Key -> Digital Signature
Sender->>Channel: Transmit Message + Digital Signature
Channel->>Recipient: Deliver Message + Digital Signature
Recipient->>Recipient: Hash received Message with SHA-256 -> Digest D2
Recipient->>Recipient: Decrypt Digital Signature with Alice's PUBLIC Key -> Recovered Digest D1
alt Digest D1 == Digest D2
Recipient->>Recipient: Signature Valid (Authenticity & Integrity Confirmed)
else Digest D1 != Digest D2
Recipient->>Recipient: Signature Invalid (Message Tampered or Key Forged)
end
Figure 6.3: Step-by-Step Cryptographic Workflow of Digital Signature Generation and Verification.
6.4 Firewall, user authentication, intrusion detection system
1. Firewalls
A Firewall is a network security defense appliance or software layer that monitors and filters incoming and outgoing network traffic based on predefined security rules, acting as a barrier between a trusted internal network and an untrusted external network.
- Packet-Filtering Firewall (Layer 3/4): Evaluates incoming packets in isolation based on source/destination IP addresses, protocol types, and port numbers without tracking connection state. Fast, but vulnerable to IP spoofing.
- Stateful Inspection Firewall (Layer 3/4/5): Tracks the operational state of active transport connections (TCP handshake states). Permits incoming response packets only if they belong to an established outbound session.
- Application-Level Gateway (Proxy Firewall - Layer 7): Inspects actual application payload contents (HTTP headers, SQL commands), blocking attacks concealed inside standard web ports.
2. User Authentication Paradigms
Authentication verifies that an entity claiming an identity is indeed authentic. Formal security relies on Three Authentication Factors:
- Something You Know (Knowledge Factor): Passwords, PINs, security passphrases. Vulnerable to shoulder-surfing, brute-force dictionaries, and phishing.
- Something You Have (Possession Factor): Physical hardware security keys (YubiKey), Time-based One-Time Password (TOTP) mobile authenticators, smart cards.
- Something You Are (Inherence Factor): Physiological and behavioral biometrics (fingerprint minutiae, retinal scans, facial geometry, voice acoustics).
- Multi-Factor Authentication (MFA): Requires presenting credentials from at least two distinct factors to grant clearance.
3. Intrusion Detection (IDS) and Prevention (IPS) Systems
- Intrusion Detection System (IDS): Passive monitoring sensor placed out-of-band via a network switch SPAN/mirror port. It passively inspects packet flows, comparing telemetry against attack signatures or baseline behavioral anomalies. Upon detecting an intrusion attempt, it issues administrative alerts.
- Intrusion Prevention System (IPS): Active security appliance placed in-line directly in the network traffic path. It not only detects malicious signatures (e.g., port scans, buffer overflow shellcodes) but actively drops offending packets in real time and reconfigures firewall drop rules automatically.
6.5 Security awareness and security policy
The Human Factor in Security
Social engineering exploits human cognitive biases rather than technical software bugs:
- Phishing: Deceptive emails mimicking legitimate institutions (e.g., banks) designed to harvest credentials.
- Spear Phishing: Highly targeted phishing campaigns customized with personal biographical details to deceive high-level executives.
- Baiting: Leaving infected physical USB flash drives in public areas to lure unsuspecting users into plugging them into secure corporate machines.
Information Security Policies
An enterprise Security Policy is a formal administrative document outlining mandatory protocols, operational standards, and disciplinary guidelines governing asset usage:
- Acceptable Use Policy (AUP): Dictates allowed behaviors on company-owned computing hardware.
- Password Complexity & Expiration Guidelines: Mandates multi-character entropy, multi-factor usage, and lockout thresholds.
- Incident Response & Disaster Recovery Plans: Explicit playbooks outlining escalation paths, communication trees, forensic analysis, and data restoration procedures following a cybersecurity breach.
Key Terms (Unit 6)
- CIA Triad: The foundational triad of Confidentiality, Integrity, and Availability.
- Non-Repudiation: Inability of a party to dispute the validity of a contract or digitally signed transmission.
- MFA (Multi-Factor Authentication): Authentication scheme requiring credentials from two or more distinct factors.
- Zero-Trust Architecture: Security framework enforcing continuous verification regardless of user network perimeter location.
Unit 6 Summary
Unit 6 examines principles of cybersecurity and information defense. The core mission centers on safeguarding the CIA Triad (Confidentiality, Integrity, Availability) and ensuring non-repudiation against both passive eavesdropping and active tampering. Malicious software threatens systems through host-infecting viruses, network-borne worms, trojans, spyware, and ransomware. Defensive countermeasures rely on cryptographic engineering, utilizing fast symmetric algorithms (AES) for bulk payload protection and asymmetric key pairs (RSA, ECC) for digital signatures and secure key exchange. Network perimeter defense deploys stateful firewalls, in-line Intrusion Prevention Systems (IPS), and multi-factor authentication (MFA), paired with organizational security awareness to counteract social engineering and phishing vectors.
Detailed Practice Questions and Answer Keys
1. Long Question: What is Cryptography? Differentiate between Symmetric and Asymmetric Key Cryptography. Explain how a Digital Signature ensures authenticity, integrity, and non-repudiation.
Answer Guide:
- Definition: Cryptography is the mathematical discipline of encrypting plaintext into unreadable ciphertext to prevent unauthorized disclosure, tampering, and forgery.
- Symmetric vs. Asymmetric Comparison:
- Symmetric: Employs a single shared secret key for encryption and decryption. Very high processing throughput (AES). Suffers from the key distribution problem.
- Asymmetric: Employs a mathematically linked key pair: a publicly broadcast Public Key and a closely guarded Private Key. Resolves key distribution, but is computationally slower (RSA, ECC).
- Digital Signature Mechanics:
- Creation: Sender passes the message through a cryptographic hash function (SHA-256) to produce a unique, fixed-size Message Digest. The sender encrypts this digest using their own Private Key. The resulting ciphertext is the Digital Signature, attached to the message.
- Verification: The recipient hashes the received message using the identical hash function, generating Digest 1. The recipient decrypts the digital signature using the sender's Public Key, recovering Digest 2. If Digest 1 matches Digest 2, three properties are proven:
- Authenticity: Decrypting successfully with the sender's public key proves only the sender's private key could have created it.
- Integrity: If even a single character in the message was modified in transit, Digest 1 would diverge completely from Digest 2.
- Non-Repudiation: The sender cannot deny authoring the document because their private key is uniquely bound to their identity.
2. Short Question: Explain the working of a Stateful Inspection Firewall versus a Stateless Packet-Filtering Firewall.
Answer Guide:
- A Stateless Packet-Filtering Firewall inspects network packets in complete isolation against static access control rules (examining Source IP, Destination IP, Protocol, and Port Number). It possesses zero contextual awareness of ongoing sessions. Consequently, it cannot verify whether an incoming TCP packet is a legitimate response to an internal user request or an unsolicited probing attack.
- A Stateful Inspection Firewall maintains an internal dynamic State Table tracking all active, outgoing TCP connections and UDP dialogues. It monitors the complete TCP 3-way handshake (
SYN,SYN-ACK,ACK). When an external packet arrives, the firewall validates whether its sequence numbers, IP addresses, and ports correlate with an existing session in the state table. Unsolicited inbound packets attempting to bypass the perimeter are dropped immediately. \n---
Expanded chapter notes
As computers have evolved from isolated calculators into the backbone of global infrastructure, the stakes of their failure have shifted from mere inconvenience to systemic risk. In the previous units, we focused on the functionality of hardware, software, and networks—essentially, how to make a system work. Unit 6 addresses the inverse: how to prevent a system from being made to work against the owner's interests. Computer security is not a single product or a piece of software, but a continuous process of managing risk. We begin by establishing the theoretical framework of security, focusing on the "CIA Triad" and the distinction between potential threats and active attacks. We then analyze the diverse landscape of malicious software, detailing the specific mechanisms different types of malware use to infiltrate and disable systems. From there, we move into the mathematical defenses of cryptography and digital signatures, which ensure that data remains secret and authentic. We will then examine the perimeter and internal defenses—firewalls, authentication systems, and intrusion detection—that form a layered defense strategy. Finally, we address the most volatile element of any security system: the human user, and the policies required to govern human behavior.
6.1 Introduction: security Threat and security attacks
The foundation of all security strategies is the CIA Triad , which stands for Confidentiality, Integrity, and Availability. Confidentiality ensures that sensitive information is accessed only by authorized parties; a breach occurs when a private password or a medical record is leaked. Integrity guarantees that data has not been altered by an unauthorized party; a breach occurs if a hacker changes the amount of a bank transfer from $10 to $10,000. Availability ensures that systems and data are accessible when needed; a breach occurs during a Denial-of-Service (DoS) attack that crashes a government website. A secure system is one that successfully balances these three competing priorities. To protect these pillars, we must distinguish between a security threat and a security attack. A threat is a potential danger—a vulnerability in the system that could be exploited. For example, an outdated operating system with a known bug is a threat. An attack, however, is the actual realization of that threat; it is the deliberate action taken to bypass security controls and compromise the CIA triad. Threats are the "what could happen," while attacks are the "act of happening." Security attacks are further categorized by their impact on the system. Passive attacks are those where the attacker aims to learn or make use of information from the system but does not affect system resources. The most common passive attack is eavesdropping or "packet sniffing," where an attacker intercepts data as it travels across a network. Because passive attacks do not alter data or crash systems, they are incredibly difficult to detect; the victim has no way of knowing that their information is being stolen. Active attacks , conversely, involve the modification of the data stream or the creation of a false stream. These are more disruptive and easier to detect but more damaging. Examples include Masquerading , where an attacker pretends to be a legitimate user to gain access to a system, and Modification of Messages , where a legitimate communication is intercepted and altered before being sent to the receiver. Another common active attack is the Denial-of-Service (DoS) , where an attacker floods a server with so many requests that it becomes overwhelmed and crashes, destroying the "Availability" pillar of the CIA triad.
6.2 Malicious Software and types of viruses
Malicious Software , or Malware , is a broad term for any program written to perform unauthorized actions on a computer. While the term "virus" is often used as a catch-all, it actually describes a specific type of malware with a specific behavior: it must attach itself to a legitimate host file and requires human action (like opening an email attachment) to spread. The diversity of malware is a response to the evolving defenses of operating systems. To understand the threat, we must examine the distinct mechanisms used by different types of malicious code:
- Viruses: These are code fragments that insert themselves into existing executable files. When the user runs the infected program, the virus executes first, infecting other files on the system and often delivering a "payload" that deletes data or displays messages.
- Worms: Unlike viruses, worms are standalone programs that do not need a host file or human intervention to spread. They exploit vulnerabilities in network protocols to "crawl" from one machine to another automatically, often consuming massive amounts of network bandwidth.
- Trojan Horses: These disguise themselves as useful software, such as a free game or a system optimizer. Once installed, they create a "backdoor" that allows a remote attacker to control the computer without the user's knowledge.
- Ransomware: This malware encrypts the user's files using strong cryptography and demands a payment (usually in Bitcoin) in exchange for the decryption key. It targets the "Availability" pillar of the CIA triad.
- Spyware: This software secretly monitors user activity, recording keystrokes, browsing history, and login credentials. It then transmits this data to a remote server for identity theft or corporate espionage.
- Adware: While less destructive, adware automatically delivers unwanted advertisements to the user. It often bundles itself with free software and can slow down system performance by consuming RAM and CPU.
- Rootkits: These are designed to hide deep within the operating system, often replacing core kernel files. They allow an attacker to maintain administrative access while remaining invisible to standard antivirus software.
- Keyloggers: A specialized form of spyware that records every single keystroke made on a keyboard. This is the primary method used to steal passwords and credit card numbers from secure websites.
- Logic Bombs: This is a piece of code intentionally inserted into a software system that remains dormant until a specific condition is met, such as a specific date or the deletion of a specific employee's record from a payroll database.
- Fileless Malware: This modern threat does not write any files to the disk; instead, it resides entirely in the computer's RAM. It uses legitimate system tools (like PowerShell) to execute its attack, making it nearly invisible to traditional file-scanning antivirus tools.
Unit 7: Contemporary Technology
Teaching hours: 5
Topics in outline order
- 7.1 Introduction to AI and its applications
- 7.2 Machine learning, neural network (basic concepts)
- 7.3 Blockchain technology and Bitcoin
- 7.4 IoT, cloud computing and their use
- 7.5 Virtual and augmented reality
7.1 Introduction to AI and its applications
Definition and Conceptual Foundations
Artificial Intelligence (AI) is the branch of computer science dedicated to engineering software systems and autonomous agents capable of performing cognitive tasks that traditionally require human intelligence. These tasks include sensory perception, natural language understanding, deductive reasoning, automated planning, decision-making, and pattern abstraction.
mindmap
root((Artificial Intelligence))
Narrow AI / Weak AI
Specialized single-domain tasks
Siri, AlphaGo, LLMs, Medical Imaging
Present State of Technology
General AI / AGI / Strong AI
Human-level generalized cognition
Autonomous cross-domain transfer
Theoretical / Frontier Research
Superintelligence / ASI
Cognition surpassing all human intellect
Hypothetical Future Speculation
Figure 7.1: The Three Theoretical Evolutionary Stages of Artificial Intelligence.
Major Application Domains
- Natural Language Processing (NLP): Large Language Models (LLMs), machine translation systems (Google Translate), sentiment analysis, automated customer support agents.
- Computer Vision: Real-time object detection in autonomous vehicles (Tesla, Waymo), facial recognition security gates, medical radiography analysis (detecting pulmonary nodules on chest X-rays).
- FinTech and Algorithmic Trading: High-frequency trade execution, automated credit scoring, real-time credit card fraud anomaly detection.
- Robotics and Autonomous Navigation: Warehouse logistics automation, agricultural automated drone spraying, unmanned aerial vehicles.
7.2 Machine learning, neural network (basic concepts)
Machine Learning (ML)
Machine Learning is a subset of AI where systems automatically learn patterns, extract predictive features, and improve operational performance directly from empirical data without being explicitly hand-coded with rigid procedural rules.
flowchart TD
subgraph Traditional_Programming ["Traditional Procedural Programming"]
D1["Data"] --> P1["Engine"]
R1["Hand-crafted Rules"] --> P1
P1 --> A1["Answers / Output"]
end
subgraph Machine_Learning ["Machine Learning Paradigm"]
D2["Data"] --> P2["ML Training Algorithm"]
A2["Answers / Labels"] --> P2
P2 --> R2["Learned Predictive Model (Rules)"]
end
Figure 7.2: Traditional Programming vs. the Machine Learning Paradigm.
The Three Core Machine Learning Paradigms
- Supervised Learning: The model is trained on fully labeled datasets containing input features ($\mathbf{x}$) and corresponding ground-truth target outputs ($y$). The model learns an approximating mapping function: $y = f(\mathbf{x})$.
- Classification: Output is a discrete categorical class (e.g.,
Spamvs.Not Spam). - Regression: Output is a continuous numerical value (e.g., predicting housing prices based on square footage).
- Classification: Output is a discrete categorical class (e.g.,
- Unsupervised Learning: The model is presented with unlabeled datasets lacking prior target values. It discovers underlying geometric patterns, natural cluster groupings, or low-dimensional structures.
- Clustering: Segmenting customers based on purchasing affinities (k-Means, DBSCAN).
- Dimensionality Reduction: Principal Component Analysis (PCA) compressing feature spaces.
- Reinforcement Learning (RL): An autonomous software agent interacts with an external dynamic environment. It learns optimal behavioral policies through trial-and-error by executing actions, observing state changes, and maximizing cumulative scalar rewards while minimizing penalties. Used in autonomous robotics and game playing (AlphaZero).
Artificial Neural Networks (ANN)
An Artificial Neural Network is an architectural model inspired by biological neuronal processing in the human cerebral cortex.
- The Perceptron (Artificial Neuron): Computes the weighted sum of its inputs, adds an internal bias term, and routes the scalar value through a non-linear activation function to produce an output:
$$y = \sigma\left(\sum_{i=1}^{n} w_i x_i + b\right)$$
- Where $x_i$ represents input features, $w_i$ represents tunable synaptic weights, $b$ represents bias, and $\sigma$ represents an activation function (e.g., ReLU, Sigmoid).
- Deep Learning: Neural network architectures comprising many intermediate ("deep") hidden layers capable of hierarchical feature extraction (learning edges in early layers, textures in middle layers, and complete facial structures in deep layers).
flowchart LR
subgraph Input_Layer ["Input Layer"]
X1["x₁"]
X2["x₂"]
X3["x₃"]
end
subgraph Hidden_Layer ["Hidden Layer (Weights + Bias + ReLU)"]
H1["h₁"]
H2["h₂"]
H3["h₃"]
H4["h₄"]
end
subgraph Output_Layer ["Output Layer (Softmax)"]
Y1["y (Prediction)"]
end
X1 --> H1 & H2 & H3 & H4
X2 --> H1 & H2 & H3 & H4
X3 --> H1 & H2 & H3 & H4
H1 & H2 & H3 & H4 --> Y1
Figure 7.3: Structural Topology of a Multi-Layer Feedforward Neural Network.
7.3 Blockchain technology and Bitcoin
Blockchain Architectural Fundamentals
A Blockchain is a distributed, decentralized, immutable, append-only cryptographic ledger replicated across a peer-to-peer (P2P) network of independent validator nodes.
- Block Structure: Each block bundles together verified transactions, a Unix timestamp, a cryptographic nonce, the current block's hash, and critically, the cryptographic hash of the immediately preceding block.
- Hash Chaining & Immutability: Because each block references the parent block's hash, altering a historical transaction in an older block alters its hash. This immediately breaks all downstream hash pointers across subsequent blocks. Tampering is instantly rejected by the network consensus.
- Consensus Mechanisms: Algorithmic voting protocols that eliminate the need for a trusted central clearinghouse (like a central bank):
- Proof of Work (PoW): Miners race to solve computationally intensive cryptographic puzzles (finding a block hash starting with leading zeroes). Requires immense electrical energy. Used by Bitcoin.
- Proof of Stake (PoS): Validators commit and "stake" their own cryptocurrency tokens as collateral to earn the right to propose and validate new blocks. Highly energy-efficient. Used by Ethereum.
flowchart LR
subgraph Block_1 ["Block #1 (Genesis)"]
H1["Current Hash:<br/>0000a4b7..."]
P1["Prev Hash:<br/>00000000..."]
T1["Tx Ledger Root"]
end
subgraph Block_2 ["Block #2"]
H2["Current Hash:<br/>00008f3c..."]
P2["Prev Hash:<br/>0000a4b7..."]
T2["Tx Ledger Root"]
end
subgraph Block_3 ["Block #3"]
H3["Current Hash:<br/>0000c19e..."]
P3["Prev Hash:<br/>00008f3c..."]
T3["Tx Ledger Root"]
end
Block_1 -->|Linked by Hash| Block_2 -->|Linked by Hash| Block_3
Figure 7.4: Cryptographic Block-Hash Chaining Enforcing Ledger Immutability.
Bitcoin
Invented in 2008 by the pseudonymous entity Satoshi Nakamoto, Bitcoin is the first successful decentralized peer-to-peer digital cryptocurrency. It operates entirely without central bank oversight, using a fixed algorithmic supply cap of 21 million Bitcoins to enforce programmatic scarcity.
Real-World Non-Currency Applications
- Supply Chain Traceability: Tracking the provenance of agricultural produce or pharmaceuticals from factory to consumer to eliminate counterfeiting.
- Land Title Registries: Recording property deeds on an immutable public ledger to prevent fraudulent duplicate sales or administrative tampering.
- Digital Academic Credentials: Emitting tamper-proof university diplomas cryptographically signed and independently verifiable without contacting registrar offices.
7.4 IoT, cloud computing and their use
The Internet of Things (IoT)
The Internet of Things (IoT) refers to a massive global network of physical devices ("things") embedded with sensors, microcontrollers, actuators, and communication transceivers that connect to the Internet to continuously aggregate, exchange, and act upon environmental telemetry.
flowchart LR
S["Sensors & Actuators<br/>(Temperature, Soil Moisture, Cameras)"] -->|Bluetooth / Zigbee / LoRa| GW["Edge Gateway"]
GW -->|Cellular 4G/5G / Fiber| Cloud["Cloud IoT Platform<br/>(Data Ingestion & Analytics)"]
Cloud --> App["Enterprise Dashboard & Mobile Control Apps"]
Figure 7.5: Architectural Tiering of an IoT Ecosystem.
- Practical Use Cases:
- Smart Agriculture: Soil humidity sensors triggering automated drip-irrigation pumps across tea plantations in rural Nepal.
- Smart Energy Grids: Automated smart meters dynamically adjusting municipal power distribution based on regional load.
Cloud Computing Architecture
Cloud Computing delivers on-demand computing services—including compute processing power, databases, storage, and networking—over the Internet on an elastic, pay-as-you-go commercial basis.
flowchart TD
subgraph SaaS ["Software as a Service (SaaS)"]
S1["End-user Applications: Google Workspace, Office 365, Salesforce"]
end
subgraph PaaS ["Platform as a Service (PaaS)"]
P1["Development Environments & Runtimes: Heroku, AWS Elastic Beanstalk, Firebase"]
end
subgraph IaaS ["Infrastructure as a Service (IaaS)"]
I1["Virtual Machines, Raw Storage, Software-Defined Networks: AWS EC2, Azure VMs, Google Compute"]
end
SaaS --> PaaS --> IaaS
Figure 7.6: The Cloud Computing Service Delivery Model Hierarchy.
Cloud Service Models
- Infrastructure as a Service (IaaS): The cloud provider supplies fundamental bare-metal virtualized computing infrastructure (VMs, block storage, virtual routers). The client installs and configures the operating system, database, and applications.
- Platform as a Service (PaaS): The cloud provider manages the underlying operating system, server hardware, and runtime environments. Developers focus exclusively on deploying application code.
- Software as a Service (SaaS): The vendor manages the entire stack, delivering fully functional applications accessible directly via web browsers.
Cloud Deployment Models
- Public Cloud: Infrastructure is owned by a commercial multi-tenant hyperscaler (AWS, Microsoft Azure, Google Cloud) and shared among global customers.
- Private Cloud: Cloud infrastructure provisioned exclusively for single-tenant use by a single enterprise, often hosted in an on-premises datacenter.
- Hybrid Cloud: Combines private cloud infrastructure with public cloud elastic capacity, connected via encrypted site-to-site VPNs or dedicated interconnects.
7.5 Virtual and augmented reality
Immersive Technologies Spectrum
- Virtual Reality (VR): Completely immerses the user inside a computer-generated synthetic 3D environment, entirely blocking out the physical real world. Requires head-mounted displays (HMDs like Meta Quest, HTC Vive) equipped with stereoscopic lenses, low-latency inertial motion-tracking gyroscopes, and spatial 3D audio.
- Augmented Reality (AR): Overlays interactive computer-generated graphics, alphanumeric annotations, or 3D digital objects onto the user's view of the physical real world in real time. Can be experienced via smartphones (camera and screen) or optical see-through smart glasses (Microsoft HoloLens).
- Mixed Reality (MR): Advanced hybrid environment where real-world physical objects and synthetic digital elements co-exist and interact dynamically in real time (e.g., a virtual ball bouncing off a real physical table).
Comparative Matrix: VR vs. AR
| Dimension | Virtual Reality (VR) | Augmented Reality (AR) |
|---|---|---|
| Environmental Context | 100% synthetic, fully occluded digital environment | Real-world physical environment augmented with contextual overlays |
| Hardware Required | Dedicated opaque Head-Mounted Display (HMD) with optical tracking | Standard smartphone camera, tablet screen, or optical waveguide glasses |
| User Presence | Sensory isolation from the immediate physical surroundings | Maintained physical awareness and interactive engagement with surroundings |
| Bandwidth/Latency | Demands extreme frame rates (90+ FPS) and low latency to avert motion sickness | Demands real-time computer vision tracking and spatial anchor registration |
| Primary Use Cases | Flight simulation training, high-immersion gaming, virtual surgery practice | Industrial maintenance repair overlays, retail furniture preview (IKEA), navigation |
Key Terms (Unit 7)
- Deep Learning: Machine learning based on deep artificial neural networks with multiple hidden layers.
- Consensus Protocol: Algorithm enabling distributed blockchain nodes to agree on a single source of truth without central authority.
- Edge Computing: Processing telemetry data physically close to the edge sensor origin rather than sending all raw data to distant cloud datacenters.
- HMD (Head-Mounted Display): Wearable display device creating stereoscopic immersive visual fields for Virtual Reality.
Unit 7 Summary
Unit 7 surveys modern technological innovations shaping the computing landscape. Artificial Intelligence enables cognitive automation across NLP, computer vision, and predictive analytics, driven by Supervised, Unsupervised, and Reinforcement Machine Learning models and Deep Artificial Neural Networks. Blockchain provides decentralized, immutable transactional ledgers secured by cryptographic hash chaining and consensus algorithms, giving rise to cryptocurrencies (Bitcoin) and decentralized verification systems. The Internet of Things links physical sensors and edge controllers with cloud platforms, which provide scalable on-demand compute, storage, and application services across IaaS, PaaS, and SaaS delivery models. Finally, immersive computing technologies bridge physical and digital spaces through fully immersive Virtual Reality and context-aware Augmented Reality.
Detailed Practice Questions and Answer Keys
1. Long Question: What is Cloud Computing? Critically analyze the three major cloud service models (IaaS, PaaS, SaaS). Detail the advantages and security challenges of adopting cloud infrastructure.
Answer Guide:
- Definition: Cloud Computing is the delivery of on-demand computing resources (compute engines, storage, databases, networks) over the Internet on an elastic, meter-based utility model.
- Service Models Breakdown:
- Infrastructure as a Service (IaaS): Provider provisions virtualized bare infrastructure (VMs, storage arrays, networks). The enterprise customer retains full responsibility for configuring the OS kernel, middleware, runtime environments, and application logic. Examples: Amazon EC2, Google Compute Engine.
- Platform as a Service (PaaS): Provider manages hardware, operating systems, and runtime engines. The customer focuses solely on authoring, deploying, and maintaining application code. Examples: AWS Elastic Beanstalk, Heroku.
- Software as a Service (SaaS): Provider owns and operates the entire operational stack, delivering end-user software applications via web browsers. Examples: Google Workspace, Microsoft 365, Salesforce.
- Advantages: Rapid elastic scaling, elimination of upfront capital expenditure (CapEx to OpEx shift), high availability across geographically redundant zones, automated patching.
- Security Challenges: Shared multi-tenant risks, vendor lock-in, data residency and national sovereignty compliance requirements, potential data leakage due to client misconfigurations of cloud storage access policies.
2. Short Question: Explain how a Blockchain guarantees that historical transaction data cannot be modified or forged.
Answer Guide:
- A blockchain enforces immutability through Cryptographic Hash Chaining paired with Distributed Peer-to-Peer Consensus:
- Hash Chaining: Every individual block contains a cryptographic hash of all internal transactions (Merkle root) plus the exact 256-bit cryptographic hash of the preceding block.
- Avalanche Effect: If an attacker modifies even a single transaction in an older block (e.g., Block 50), the hash of Block 50 changes completely due to the avalanche property of cryptographic hashing (SHA-256).
- Pointer Breakage: Because Block 51 stores the original hash of Block 50, the pointer link between Block 50 and Block 51 is instantly broken. All subsequent blocks (Block 52, 53, etc.) become invalid.
- Consensus Enforcement: To force the network to accept this modified history, the attacker would have to re-mine and re-calculate the Proof of Work for Block 50 and every subsequent block faster than all other honest nodes combined (the computationally impossible 51% attack threshold). Consequently, the distributed network immediately rejects the tampered ledger. \n---
Expanded chapter notes
The final unit of this course shifts focus from the established foundations of computing to the technologies currently redefining the boundary between human intelligence and machine execution. While the previous units dealt with the "how" of computing—how a CPU processes a bit, how a database stores a record, or how a packet travels a network—contemporary technology focuses on the "what next." We are moving away from computers as passive tools that follow rigid instructions and toward systems that can learn, perceive, and autonomously interact with the physical world. This unit explores the convergence of intelligence, decentralization, and immersion. We begin with Artificial Intelligence, tracing the path from simple rule-based systems to the complex, data-driven world of Machine Learning and Neural Networks. We then examine Blockchain, a technology that challenges the need for centralized trust in digital transactions. From there, we analyze the "Internet of Things" and Cloud Computing, which together extend the reach of the computer from the desk to every object in our environment. Finally, we explore Virtual and Augmented Reality, which transform the user interface from a flat screen into a three-dimensional experience.
7.1 Introduction to AI, AI and Its applications
Artificial Intelligence (AI) is the branch of computer science dedicated to creating systems capable of performing tasks that would typically require human intelligence. These tasks include visual perception, speech recognition, decision-making, and language translation. At its core, AI is not a single technology but a collection of different approaches to solving problems. The most basic form is "Narrow AI" (or Weak AI), which is designed to excel at one specific task—such as playing chess or recommending a movie. Every AI currently in existence is Narrow AI. The theoretical goal of "General AI" (or Strong AI) is a machine that possesses the ability to apply intelligence to any problem, much like a human being, though this remains a subject of research and speculation. The mechanism of AI has evolved from "symbolic AI"—which relied on complex sets of "if-then" rules written by humans—to "connectionist AI," which allows the machine to find its own rules by analyzing massive amounts of data. In a rule-based system, a programmer might tell a computer, "If the animal has whiskers and meows, it is a cat." In a modern AI system, the computer is shown ten thousand images of cats and identifies the mathematical patterns that define a "cat" without being told what a whisker is. The applications of AI are now pervasive, touching almost every professional field:
- Healthcare: AI is used for early cancer detection by analyzing medical images with greater precision than human radiologists. It also assists in "drug discovery," simulating how different chemical compounds interact with proteins to find new medicines.
- Finance: Algorithmic trading systems use AI to analyze market trends and execute trades in milliseconds. AI also powers fraud detection systems that flag a credit card transaction as "suspicious" if it deviates from a user's typical spending pattern.
- Transportation: Self-driving cars use a combination of computer vision and sensor fusion to navigate roads, recognize stop signs, and avoid pedestrians in real-time.
- Customer Service: AI-powered chatbots and virtual assistants (like Siri or Alexa) use Natural Language Processing (NLP) to understand human intent and provide relevant answers.
- Agriculture: AI-driven drones monitor crop health via multispectral imaging, allowing farmers to apply fertilizer or pesticides only to the specific areas that need it, reducing waste.
- Cybersecurity: AI systems monitor network traffic for anomalies that indicate a zero-day attack, reacting and blocking the threat faster than a human operator could.
- Manufacturing: Predictive maintenance uses AI to analyze vibrations and heat in factory machinery to predict exactly when a part will fail, preventing costly unplanned downtime.
- Education: Adaptive learning platforms analyze a student's performance in real-time and adjust the difficulty of the material to match their specific learning pace.
- Entertainment: Recommendation engines (used by Netflix or Spotify) use collaborative filtering to predict what a user will enjoy based on the behavior of millions of other similar users.
- Legal Services: AI tools can scan thousands of legal documents to find relevant case law or identify inconsistencies in contracts, a task that would take human paralegals weeks to complete.
7.2 Machine Learning, Neural network (basic concepts)
Machine Learning (ML) is a subset of AI that provides the systems the ability to automatically learn and improve from experience without being explicitly programmed. While traditional software is a set of instructions, ML is a set of algorithms that creates a mathematical model based on data. There are three primary types of machine learning. Supervised Learning is the most common; the algorithm is trained on a "labeled" dataset, meaning the input comes with the correct answer. For example, a spam filter is trained on millions of emails labeled as "spam" or "not spam" until it learns the characteristics of junk mail. Unsupervised Learning deals with unlabeled data. The algorithm looks for hidden patterns or structures on its own. A common use is "customer segmentation," where a business asks the AI to group its customers into clusters based on purchasing habits without predefined categories. Reinforcement Learning is based on a system of rewards and punishments. An agent (the AI) takes an action in an environment and receives a reward for a correct move or a penalty for a mistake. This is how AI learns to play complex games like Go or navigate a robotic arm in a warehouse. The most powerful tool in modern ML is the Artificial Neural Network (ANN). An ANN is a computational model inspired by the biological structure of the human brain. It consists of interconnected nodes called "neurons" organized into layers. The process begins at the Input Layer , where raw data (such as the pixels of an image) enter the system. This data then passes through one or more Hidden Layers. Each connection between neurons has a Weight , which determines the importance of that specific input. As the data moves through the layers, the neurons apply a mathematical function (an activation function) to decide whether to "fire" a signal to the next layer. Finally, the result emerges at the Output Layer (e.g., "This image is a dog"). The "learning" part of a neural network happens through a process called Backpropagation. When the network makes a mistake—for example, labeling a dog as a cat—the system calculates the error (the difference between the predicted output and the actual output). It then works backward through the layers, adjusting the weights of the connections to reduce the error. After millions of these adjustments, the network's weights are optimized, and it can identify patterns with incredible accuracy.
Exam Strategy
- Diagram First: Begin answers for computer anatomy, memory hierarchy, OSI model, DBMS three-level architecture, and blockchain with clear, labeled diagrams. In the TU examination system, examiners frequently allocate 40–50% of an answer's marks to structural schematics.
- Use Comparative Tables: When asked to "differentiate" between concepts (SRAM vs. DRAM, Compiler vs. Interpreter, Symmetric vs. Asymmetric, RDBMS vs. NoSQL, VR vs. AR), always present comparisons in a structured table across clear technical parameters rather than writing loose, unstructured paragraphs.
- Emphasize Exact Technical Terminology: Avoid vague, colloquial phrasing. Use precise computing terminology: use stored-program architecture instead of stores tasks, preemptive time-slicing instead of does multiple things, and volatile semiconductor latches instead of temporary memory.
- Local Nepali Context: When citing applications in enterprise and governance questions, reference real domestic platforms: connectIPS for banking, Nagarik App for e-governance, and Nepal Telecom / Ncell for telecommunications.
References
- Goel, A. (2010). Computer Fundamentals. Pearson Education India.
- Leon, A. & Leon, M. (2010). Fundamentals of Information Technology. Leon TechWorld.
- Norton, P. (2017). Introduction to Computers (7th Edition). McGraw Hill Education.
- Sinha, P. K. & Sinha, P. (2003). Computer Fundamentals. BPB Publications.
- Tribhuvan University, Faculty of Humanities and Social Sciences. (2025). Bachelor of Computer Applications (BCA) Curriculum 2025: Semester I. TU Central Portal.