0% found this document useful (0 votes)
8 views41 pages

Basics of Computer Architecture Explained

This document provides an overview of computer architecture, including components like the CPU, memory, and input/output systems, as well as the instruction set architecture and assembly language. It explains memory hierarchy, cache, operating systems, and their functions such as process and memory management. The document uses analogies to simplify complex concepts, making it accessible for understanding how computers operate.

Uploaded by

mwizaceline27
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views41 pages

Basics of Computer Architecture Explained

This document provides an overview of computer architecture, including components like the CPU, memory, and input/output systems, as well as the instruction set architecture and assembly language. It explains memory hierarchy, cache, operating systems, and their functions such as process and memory management. The document uses analogies to simplify complex concepts, making it accessible for understanding how computers operate.

Uploaded by

mwizaceline27
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1

COMPUTER ARCHITECTURE

1 Prince Rukundo
0788317992
rukuprince@[Link]
University of Rwanda – CBE- BIT Department
I. Introduction to Computer Architecture

Computer architecture explains how a computer is built inside and how it works to
run programs, store information, and communicate with devices.

You can think of it like understanding how a car works:

 The engine = CPU

 Fuel system = memory

 Controls = instructions

 Dashboard = input/output

These notes break down the basics in the simplest possible way.

1. Overview of Computer Organization


Computer organization describes how all the parts of a computer work together to
perform tasks.

In simple words:
It explains how the computer receives data, processes it, and produces results, step
by step.

The basic flow is called the Input → Process → Output → Storage cycle.
Input (keyboard, mouse)

Process (CPU)

Output (screen, printer)

Storage (SSD/HDD)
2.

Components of a Computer System


Every computer-whether a smartphone, laptop, or ATM-has the same foundational
components.

2.1 Central Processing Unit (CPU) – “The Brain”


 Executes instructions

 Performs calculations

 Controls all other parts

Analogy: A chef in a kitchen coordinating everything.

2.2 Memory
Memory stores data temporarily or permanently.

A. RAM (Main Memory)


 Temporary working space

 Erased when power is off


 Used by programs currently running
Analogy: The kitchen table where ingredients are kept while cooking.

B. Cache (L1, L2, L3)


 Very fast small memory close to CPU

 Stores frequently used data


Analogy: Keeping salt and pepper right next to you while cooking.

Approximate speeds:

 L1 cache: ~1 nanosecond

 L2 cache: ~5 nanoseconds

 L3 cache: ~10–20 nanoseconds

 RAM: ~100 nanoseconds

C. Secondary Storage (SSD/HDD)


 Permanent storage

 Holds photos, documents, apps


Analogy: The refrigerator or pantry where food is kept long-term.

2.3 Input Devices


Tools you use to give data to the computer:

 Keyboard

 Mouse

 Microphone

 Camera

 Touchscreen

2.4 Output Devices


Tools the computer uses to show results:

 Monitor

 Printer

 Speakers
2.5 Motherboard
The main board that connects everything.

Analogy: The nervous system of the body.

2.6 Power Supply


Provides electricity to all components.

Analogy: The heart pumping blood in the body.

3. Instruction Set Architecture (ISA)

3.1 What is ISA in simple words?


The instruction set architecture is the “language” that the CPU understands.

It defines:

 The instructions the CPU can execute

 How data is stored and accessed

 How the processor communicates with memory

Analogy:
Just like a chef follows a recipe, a CPU follows a set of instructions.

3.2 Examples of ISA


 x86 → used in most PCs

 ARM → used in smartphones

 RISC-V → modern, open-source design

3.3 Types of Instructions


The ISA defines basic actions, such as:

 Arithmetic: add, subtract

 Logic: compare, AND, OR

 Data movement: load, store

 Control: jump, branch

These tiny instructions combine to create all the apps we use.


4. Assembly Language Programming
Assembly language is a very low-level programming language that directly controls
the CPU.

It uses simple English-like words instead of zeros and ones.

Example:
Machine code (computer language):
10110000 01100001

Assembly version (human-readable):


MOV AL, 61h
(Meaning: move the value 61 into a register called AL)

Why is Assembly important?


 It helps understand how the processor works

 Used in embedded systems, robotics, and firmware

 Helps optimize performance

Simple Real-Life Analogy


High-level languages (Python, Java) = speaking normal English.
Assembly = spelling every letter manually.
Machine code = describing words using 0s and 1s.

5. Processor Organization
Processor organization describes the internal structure of the CPU.

5.1 Inside the CPU

A. ALU (Arithmetic Logic Unit)


Performs calculations.
Analogy: A calculator inside the CPU.

B. Control Unit
Decides what to do next and controls all CPU operations.
Analogy: The manager telling workers what to do.

C. Registers
Tiny storage units inside the CPU.
Analogy: Tools in a chef’s hand-immediate access.
D. Cache
We explained earlier - very fast local memory.

5.2 The Instruction Cycle


The CPU follows the same three steps repeatedly:

1. Fetch
Get the next instruction from memory.

2. Decode
Understand what the instruction means.

3. Execute
Carry out the instruction.

This cycle happens billions of times per second.

5.3 Pipelining (Simple Explanation)


Pipelining allows the CPU to work on multiple instructions at once, similar to an
assembly line.

Analogy:
In a car factory:

 Worker A installs the engine

 Worker B installs the doors

 Worker C installs the seats

All at the same time, for different cars.

FINAL EASY SUMMARY

1. Computer Organization
How different parts of the computer work together (CPU, memory, input/output).

2. Components
CPU, RAM, cache (L1–L3), SSD/HDD, input/output devices, motherboard.

3. Instruction Set Architecture


The “language” the CPU understands.
Examples: ARM, x86, RISC-V.
4. Assembly Language
Low-level language close to machine code.
Used to control hardware directly.

5. Processor Organization
Inside the CPU: ALU, Control Unit, registers, cache.
Instruction cycle: fetch → decode → execute.

--------------------------------

II. Memory Hierarchy and Cache


Computers access different types of memory at different speeds.
To understand this, we use time units:

 1 second = what you feel normally

 1 millisecond (ms) = 1/1,000 of a second

 1 microsecond (µs) = 1/1,000,000 of a second

 1 nanosecond (ns) = 1/1,000,000,000 of a second

To imagine how small a nanosecond is:

 If 1 second was the distance from Kigali to Musanze,

 1 nanosecond would be less than the width of a sheet of paper.

Caches work in nanoseconds (extremely fast).


Hard drives work in milliseconds (very slow by comparison).

1. Memory Hierarchy (From Fastest to Slowest)


Below is the complete hierarchy with the L1, L2, L3 caches and realistic speeds:

Memory Type Everyday Analogy Speed Size


CPU Registers Information in your hand ~0.3 ns Very tiny
Spices on the cooking
L1 Cache ~1 ns Very small
table
L2 Cache Shelf beside the stove ~3–5 ns Larger
L3 Cache Kitchen cabinet ~10–20 ns Even larger
RAM (Main Memory) Pantry ~100 ns Much larger
~50–100
SSD Store room Very large
µs
HDD Warehouse ~5–10 ms Very large
Comparing Speeds (simple way)
Assume L1 cache = 1 second.
Then:

 L2 cache = 5 seconds

 L3 cache = 20 seconds

 RAM = more than 2 minutes

 SSD = about a whole day

 HDD = several days

So the CPU really needs fast memory close to it, otherwise it waits too long.

2. Secondary storage devices. What Are L1, L2, and L3 Cache?

L1 Cache (Level 1 Cache)


 Closest to the CPU

 Fastest memory

 Very small (usually 32 KB – 64 KB)

Analogy:
Like keeping salt and pepper right on your cooking table-immediate access.

L2 Cache (Level 2 Cache)


 A bit further from the CPU

 Slightly slower than L1

 Bigger (256 KB – 1 MB)

Analogy:
Like keeping oil and sugar on a nearby kitchen shelf-takes a little longer to reach.

L3 Cache (Level 3 Cache)


 Shared by all CPU cores

 Bigger but slower than L1/L2

 Size: 4 MB – 64 MB

Analogy:
Like a cabinet in the kitchen-slower to reach than the spices on the table.
Cache Overall Purpose
Caches reduce the time the CPU waits for data.

Example:
If the CPU needs a number:

 If that number is in L1 cache → it gets it almost immediately

 If not, it tries L2

 If not, it tries L3

 If not, it goes to RAM (much slower)

 Worst case: SSD/HDD (very slow)

This chain avoids the CPU “travelling far” for information.

3. RAM, SSD, HDD

RAM
 Medium-fast

 Stores programs currently being used

 Volatile (erases when computer turns off)

Analogy:
Like the pantry-you can reach it quickly but not instantly.

SSD
 Fast permanent storage

 No moving parts

Analogy:
Like a store room where you keep frequently used food but not on the table.

HDD
 Slow permanent storage

 Uses spinning disks

Analogy:
Like the warehouse-large but far.

4. Input/Output Subsystems (Simple Explanation)


Input/Output (I/O) = how the computer communicates with devices like:
 Keyboard

 Mouse

 Printer

 USB

 Internet (network card)

 Monitor

The I/O subsystem manages all these connections.

5. Interrupts (Simple Explanation)


Interrupt = a device telling the CPU “I need you now.”

Examples:

 Keyboard key pressed

 Printer is ready

 Network packet arrived

 A file has finished downloading

Just like your phone buzzing when a message arrives.

Without interrupts, the CPU would waste time checking devices repeatedly.

6. DMA – Direct Memory Access


DMA allows big amounts of data to move directly between memory and a device
without the CPU doing the work.

Simple Example:
Copying a 5 GB file from USB:

 Without DMA:
The CPU copies every small portion → slow, CPU is busy.

 With DMA:
DMA handles the transfer → CPU is free.

Analogy:
Instead of carrying all the boxes yourself,
you hire assistants to move the boxes while you do other work.
FINAL SIMPLE SUMMARY

Memory hierarchy
Like storage in a kitchen:

 L1: on the table

 L2: near the table

 L3: in cabinet

 RAM: pantry

 SSD/HDD: storeroom/warehouse

Speeds
 Caches: nanoseconds (super fast)

 RAM: 100 ns (slower)

 SSD: microseconds

 HDD: milliseconds (very slow compared to cache)

Interrupts
Devices notify the CPU (like a phone notification).

DMA
Moves large data by itself so CPU can do other work.

----------------------------------------------------------------------------------

III. Operating System Concepts and Functions


An Operating System (OS) is the main software that manages the entire computer.
Without an OS, a computer is just hardware that cannot do anything meaningful.

Examples of operating systems you already know:

 Windows

 macOS

 Linux

 Android

 iOS
Think of the OS as the manager of a hotel, coordinating guests, rooms, staff,
services, and security.

1. Introduction to Operating Systems

What is an Operating System?


An OS is software that:

 Controls computer hardware

 Runs programs

 Manages files, memory, and devices

 Provides security

 Makes the computer easy to use

Without an OS:

 You cannot open apps

 You cannot save files

 The computer would not know how to interact with a keyboard, mouse,
screen, or internet

Analogy:
The OS is like a government for the computer-organizing everything and ensuring
rules are followed.

2. Types of Operating Systems


Different systems are designed for different environments.

2.1 Single-User OS
One person uses the computer at a time.
Examples: Windows, macOS.

2.2 Multi-User OS
Many users access the same system simultaneously.
Examples: UNIX, Linux servers.

2.3 Real-Time OS (RTOS)


Used in systems where timing is critical:

 Medical devices
 Traffic lights

 Airplane control systems

Analogy: A system that must respond immediately, like a heartbeat monitor.

2.4 Embedded OS
Small OS running inside devices like:

 Smart TVs

 Washing machines

 ATMs

 Cars

2.5 Mobile OS
Designed for smartphones and tablets.
Examples: Android, iOS.

2.6 Distributed OS
Many computers working together as one system.
Used in cloud computing.

3. Process Management

3.1 What is a Process?


A process is simply a program that is currently running.

Examples:

 When you open WhatsApp → it becomes a process

 When you open Google Chrome → each tab may be a separate process

3.2 Why do we need process management?


 Many apps run at the same time

 The CPU must share time among processes

 The OS ensures fairness and smooth performance

3.3 Scheduling (Simple Explanation)


Scheduling decides which process gets the CPU, and for how long.
Analogy:
A teacher letting each student talk for a few seconds in turns during class.

Common scheduling methods:


 First Come, First Served (FCFS)

 Round Robin (each process gets a small time slice)

 Priority Scheduling (important tasks first)

3.4 Process States


A process moves through several states:

New → Ready → Running → Waiting → Terminated

Analogy:
Like a student:

 New = entering class

 Ready = waiting to speak

 Running = speaking

 Waiting = waiting for more instructions

 Terminated = finished speaking

4. Memory Management
The OS manages how memory (RAM) is shared among programs.

Main Functions:

Allocate memory to processes

Ensure processes do not overwrite each other

Free memory when a process finishes

Move data between RAM and secondary storage

4.1 Virtual Memory (Simple Explanation)


Virtual memory extends RAM using part of the SSD/HDD.

Analogy:
When your table is full of books, you put some on the floor temporarily to make
space.
This helps the computer run more apps than the actual RAM can hold.

4.2 Memory Protection


One program must not access another program’s memory.

Analogy:
Each student has their own desk-no one touches another student’s notes.

5. File Systems
The file system organizes and manages data stored on SSDs, HDDs, USBs, etc.

Key Functions
 Naming files

 Organizing files into folders

 Tracking free and used space

 Protecting files

 Ensuring fast search and retrieval

Analogy:
Like a librarian organizing books in a library.

6. Input/Output (I/O) Management


I/O devices include:

 Keyboard

 Mouse

 Printer

 Monitor

 USB

 Network card

The OS must coordinate all of them.

6.1 How the OS manages I/O


 Controls data exchange

 Ensures devices do not conflict

 Converts data formats


 Handles interrupts

 Manages drivers (software that helps devices communicate with OS)

Analogy:
The OS is like a translator between humans and machines.

6.2 Interrupt Handling (Simple Explanation)


Interrupts are signals from devices saying:

“I need your attention now!”

Examples:

 Key pressed

 Mouse moved

 Printer finished printing

The OS pauses its current task to respond, then resumes.

7. Security in Operating Systems


Security ensures:

 Only authorized users access the system

 Data is protected

 Malware cannot damage files

 Communications are safe

7.1 Authentication
Verifying identity using:

 Passwords

 PINs

 Fingerprint

 Face ID

Analogy:
Showing your ID before entering a secure building.

7.2 Access Control


Deciding what each user can do:
 Read

 Write

 Delete

 Execute

Analogy:
Keys that open certain rooms but not others.

7.3 Encryption
Turning readable data into unreadable code.

Used in:

 WhatsApp messages

 Online banking

 WiFi security

7.4 Malware Protection


OS helps defend against:

 Viruses

 Worms

 Trojans

 Ransomware

 Spyware

Using:

 Antivirus software

 Updates

 Firewalls

FINAL SIMPLE SUMMARY

Operating System Overview


Main software that manages hardware, files, memory, processes, and security.

Types of OS
Single-user, multi-user, real-time, embedded, mobile, distributed.
Process Management
Controls running programs, scheduling, and CPU time.

Memory Management
Allocates RAM, uses virtual memory, prevents conflicts.

File Systems
Organize data into files and folders.

I/O Management
Controls devices: keyboard, mouse, printer, display.

Security
Uses authentication, access control, encryption, and malware protection.

-----------------------------------------------------------------------------

IV. Process and Memory Management


Computers often run many programs at the same time:

 Browsing the web

 Playing music

 Downloading a file

 Running WhatsApp

 Background apps

The operating system (OS) must manage all these processes and ensure each gets fair
access to the CPU and memory.

These notes explain the most important concepts in simple terms.

1. Process Scheduling Algorithms

What is Scheduling?
Scheduling is how the OS decides which process runs next on the CPU.
Analogy:
You have many tasks to do (assignments, chores), but you can work on only one at a
time.
You must choose which to do first.

The CPU makes similar decisions billions of times per second.

1.1 First Come, First Served (FCFS)


 Processes are run in the order they arrive.

 Simple but not always fair.

Example:
People waiting in a supermarket queue.

1.2 Shortest Job First (SJF)


 The process that requires the least time runs first.

 Reduces waiting time.

Analogy:
Doing your quickest tasks first.

Limitation:
Large tasks may wait too long.

1.3 Round Robin (RR)


 Each process gets a small time slice (e.g., 10 milliseconds).

 After that, it goes to the back of the queue.

Analogy:
Each student in a group discussion gets 10 seconds to speak, then the next student
goes.

Good for:
Multitasking and fairness.

1.4 Priority Scheduling


 Each process is given a priority level.

 Higher priority processes run first.

Example:
Emergency patients treated before normal patients at a hospital.
Problem:
Low priority tasks might starve or be ignored.

2. Memory Allocation and Management


Memory management decides:

 Which process gets memory

 How much they get

 When they get it

 How to protect one process from another

Analogy:
Think of RAM as hotel rooms and processes as guests.
The OS is the hotel manager assigning rooms.

2.1 Contiguous Memory Allocation


Memory is given to a process in one continuous block.

Analogy:
Giving a guest a large room with no dividing walls.

Problem:
Creates spaces (holes) that are too small to use - called fragmentation.

2.2 Non-Contiguous Allocation


Memory for a process is split into smaller pieces across RAM.

Analogy:
Guest gets multiple smaller rooms instead of one big one.

Advantage:
Allows better use of space.

2.3 Allocation Methods

First Fit
Give memory to the first available block.

Best Fit
Find the smallest block that fits the process.
Worst Fit
Give the largest block, leaving larger leftover free space.

3. Virtual Memory Management

What is Virtual Memory?


Virtual memory extends RAM using part of the SSD/HDD.

Analogy:
When your study table is full, you move books to the floor temporarily.

The OS uses this trick to run more applications than the RAM can hold.

3.1 Why Virtual Memory?


 Allows larger programs to run

 Supports multitasking

 Keeps system smooth even when RAM is full

3.2 Swap Space


The area on SSD/HDD used to store additional data when RAM is full.

Analogy:
A temporary storage shelf when your main desk is full.

4. Paging and Segmentation


Paging and segmentation are methods of breaking memory into smaller, manageable
parts.

4.1 Paging

What is Paging?
Paging divides memory into fixed-size blocks:

 Pages → blocks used by processes

 Frames → blocks in physical RAM

Pages and frames have the same size, so data fits perfectly.

Analogy:
Bookshelf divided into equal-sized compartments.
Book sections (pages) fit exactly in these compartments.
4.2 Why Use Paging?
 Avoids fragmentation

 Makes memory allocation easier

 Supports virtual memory

4.3 Page Table


A table that maps which page of a process is stored in which frame.

Analogy:
A hotel guest list showing which room number each guest occupies.

4.2 Segmentation

What is Segmentation?
Segmentation divides memory based on logical units, such as:

 Code

 Data

 Stack

 Functions

 Modules

Each segment has different sizes depending on its purpose.

Analogy:
A house divided into rooms of different sizes (kitchen, bathroom, bedroom) based on
function, not equal size.

Differences Between Paging and Segmentation


Feature Paging Segmentation
Unit size Fixed-size Variable-size
Based on Physical blocks Logical divisions
Fragmentatio No internal Can have
n fragmentation external
Table used Page table Segment table
Simplified Summary

Scheduling Algorithms
Help decide which program runs on CPU:

 FCFS

 SJF

 Round Robin

 Priority

Memory Allocation
OS assigns memory like a hotel assigns rooms.

Virtual Memory
Allows computer to run more apps using SSD/HDD as extra memory.

Paging
Breaks memory into equal blocks (easy to manage).

Segmentation
Breaks memory into logical parts (code, data, stack).

-----------------------------------------------------------------

V. File Systems and Input/Output Management


Computers store your documents, videos, apps, and system files in an organized way
so they can be found quickly and safely.
This organization is handled by the File System and supported by I/O Management.

We will explain everything using everyday analogies beyond computer terms.


1. File Systems and File Organization

1.1 What is a File System?


A file system is the method a computer uses to store, organize, and retrieve files on
a storage device (SSD, HDD, USB, etc.).

Simple Analogy:
Think of a large office with:

 Filing cabinets (disk partitions)

 Folders (directories)

 Papers (files)

 Labels (file names and metadata)

Without a file system, everything would be a big mess of data, impossible to locate.

1.2 What Does a File System Do?


A file system is responsible for:

1. Naming files

2. Organizing files into folders

3. Tracking where each file is located on the disk

4. Managing space (which areas are free or used)

5. Protecting files from corruption or unauthorized access

1.3 Examples of Common File Systems


 NTFS → Windows

 FAT32 / exFAT → USB drives, memory cards

 ext4 → Linux

 APFS → Mac computers

1.4 File Organization Methods


File systems use different strategies to arrange files on the disk.

A. Contiguous Allocation
Files are stored in one continuous block, like a book stored on one shelf.
Pros: Fast access
Cons: Hard to find large empty spaces

B. Linked Allocation
Each file is a chain of small pieces scattered on the disk.
Each piece points to the next, like pages in a storybook with a “turn to page X”
note.

Pros: Flexible, no big empty space needed


Cons: Slower to read because scattered

C. Indexed Allocation
A special table lists all the pieces of a file.
Like a book index listing page numbers of chapters.

Pros: Fast, easy to manage


Cons: Needs extra space for the index

2. Disk Scheduling Algorithms


A hard disk has a moving read/write arm (like the arm of a record player).
Since it moves physically, we need smart ways to reduce movement and improve
speed.

These smart techniques are called disk scheduling algorithms.

Why do we need disk scheduling?


If many people request files at the same time:

 The disk arm may have to move back and forth a lot

 This wastes time

 The computer becomes slower

So, algorithms decide which file request to serve first.

Most Common Disk Scheduling Algorithms

1. FCFS (First Come, First Served)


Serve requests in the order they arrive.

Analogy: People standing in a queue at a supermarket.

Simple but slow, because the arm may travel long distances.
2. SSTF (Shortest Seek Time First)
Serve the request closest to the current arm position.

Analogy: A delivery person delivering to the nearest house first.

Faster than FCFS, but may starve far-away requests.

3. SCAN (Elevator Algorithm)


The disk arm moves in one direction (like an elevator going up), serving all requests
on the way.
Then reverses direction and serves requests in the other direction.

Analogy:
An elevator picks people going up, then down.

Very efficient and fair.

4. C-SCAN (Circular SCAN)


Arm moves in one direction, serves all requests,
then jumps back to the start without serving on the way back.

Analogy:
An elevator that only goes up, then instantly returns to the ground floor empty.

Good for uniform waiting times.

3. Input/Output Devices and Management


I/O devices include:

 Keyboard

 Mouse

 Printer

 Monitor

 Speakers

 USB devices

 Network cards (for internet)

 Camera

 Touchscreen

The operating system must manage all of them without confusion.


3.1 What Does the I/O Manager Do?

Controls access to devices


Only one program can use a device at a time (e.g., only one app uses the webcam).

Converts data
Devices speak different “languages.”
The OS translates information to a form each device understands.

Ensures safety
Prevents a faulty device from crashing the system.

Keeps track of device states


Example: Is the printer busy?
Is the mouse connected?

Manages speed differences


CPU is fast → devices like keyboards are slow.
OS helps them coordinate.

4. Input/Output Interrupt Handling


Devices must tell the CPU when they need attention.
They do this using interrupts.

4.1 What is an Interrupt? (Simple Definition)


An interrupt is a signal from a device telling the CPU:

“Stop for a moment, I need your attention!”

4.2 Real-Life Examples


 Keyboard sends an interrupt when a key is pressed

 Mouse sends interrupt when moved

 Printer sends interrupt when it finished printing

 Network card interrupts when a new email or packet arrives

4.3 How Interrupt Handling Works (Simple Steps)


1. Device raises an interrupt
(e.g., keyboard key pressed)
2. CPU stops what it was doing
Saves its current work.

3. CPU runs the Interrupt Handler


A small program that deals with the device request.

4. CPU returns to normal work


Continues exactly where it stopped.

4.4 Why Interrupts Are Important


 Avoids constant checking by CPU (saves time)

 Makes devices responsive

 Allows multitasking

 Improves efficiency

FINAL SIMPLE SUMMARY

File Systems
Organize files like folders in a cabinet.
Ensure storing, naming, and finding files.

File Organization
 Contiguous (continuous block)

 Linked (pieces connected)

 Indexed (table of addresses)

Disk Scheduling
Helps the disk decide which request to serve first:

 FCFS

 SSTF

 SCAN

 C-SCAN

I/O Devices
Everything that allows input and output: keyboard, mouse, printer, etc.
I/O Interrupt Handling
Devices notify the CPU when they need attention,
just like your phone gives notifications.

--------------------------------------------------------

VI. Security in Operating Systems


Modern computers store sensitive information: personal data, passwords, pictures,
work files, academic records, financial information, etc.
Security in operating systems ensures this information is protected from unauthorized
access, leaks, damage, or misuse.

We explain these topics using real-life analogies that anyone can understand.

1. Introduction to Security Concepts


Computer security is about protecting information and systems from:

1. Unauthorized access – people who should not see or use your data

2. Misuse – people who use your computer for harmful purposes

3. Damage – accidental or intentional destruction of data

4. Theft – stealing files, passwords, or computing power

The three main goals of security (CIA Triad):


Concept Meaning Real-Life Analogy
Confidentiality Only the right people can access data Lock on a diary
Data must not be changed by No one edits your school marks
Integrity
unauthorized people illegally
System must be available when A bank ATM should work when
Availability
needed you need cash
These three guide everything the operating system does in security.

2. Access Control and Authentication

2.1 What is Authentication?


Authentication is verifying who you are.

Examples you already use:


 Password to open a laptop

 PIN to open a phone

 Fingerprint unlock

 Face recognition

Analogy:
A security guard checking your ID before letting you enter a building.

2.2 What is Access Control?


Once the system knows who you are, it must decide what you are allowed to do.

Examples:

 A student can access Moodle courses but cannot access admin settings

 A guest cannot install software on your laptop

 A bank employee can view customer data but cannot disable servers

This protects the system from mistakes or misuse.

2.3 Types of Access Control

1. User-Level Access
Each user has a personal account.

2. File Permissions
Each file and folder has rules:

 Read

 Write

 Execute

Example:

 You can read a PDF but not delete it

 Only administrators can install apps

3. Role-Based Access Control (RBAC)


Permissions depend on your role:

 Student

 Teacher
 Manager

 System Administrator

Just like in a hospital:

 Nurses, doctors, cleaners, and administrators all have different access.

3. Cryptography and Encryption

3.1 What is Encryption?


Encryption is the process of turning readable information into unreadable code so
that only authorized users can understand it.

Real-life example:
Sending a message in a secret language that only your friend can read.

3.2 Why Encryption Is Needed


 Protects passwords

 Secures WhatsApp messages

 Protects bank transactions

 Secures stored files

 Protects online purchases

Even if someone steals the data, they cannot understand it.

3.3 How Encryption Works (Simple Explanation)


Imagine:

 You write a message: “Meet me at 5”

 You lock it in a box with a key

 Only the person with the matching key can open it

In computers:

 Plain text = normal data

 Cipher text = scrambled data

 Encryption key = the secret key that locks it

 Decryption key = the key that unlocks it


3.4 Types of Encryption

A. Symmetric Encryption
 Same key is used to encrypt and decrypt

 Fast

 Used for: files, backup data, disk encryption

Analogy:
One key opens and closes your room.

B. Asymmetric Encryption
 Two keys:

 Public key (everyone can have it)

 Private key (only you have it)

Used in:

 Online banking

 Secure websites (HTTPS)

 Digital signatures

Analogy:
A mailbox:

 Anyone can drop letters in (public key)

 Only the owner opens the box (private key)

4. Malware and Virus Protection

4.1 What is Malware?


Malware = malicious software
Software created to harm, steal, or spy on your system.

Types include:

 Virus

 Worms

 Trojans

 Spyware

 Ransomware
 Adware

4.2 Simple Definitions of Each

Virus
Attaches itself to files and spreads when files are shared.
Analogy: Like a cold virus spreading when people interact.

Worm
Spreads by itself over networks without user actions.
Analogy: A disease that spreads through the air.

Trojan Horse
A harmful program disguised as something useful.
Analogy: A thief hidden inside a gift box.

Spyware
Secretly monitors what you do.
Analogy: Someone secretly watching everything you type.

Ransomware
Locks your files and asks you to pay money to unlock them.
Analogy: Kidnapping your data.

4.3 How to Protect Against Malware

Install antivirus software


It scans and removes harmful software.

Keep software updated


Updates close security holes.

Do not download unknown attachments


Most viruses spread through emails or websites.

Use strong passwords


Avoid:

 123456

 ABCD
 Your name

Use:

 Mixture of letters, numbers, symbols

 At least 8–12 characters

Use firewalls
They block unwanted network access.

Backup your files


If ransomware attacks, you still have a copy.

FINAL SIMPLE SUMMARY

1. Security Concepts
Protect data using confidentiality, integrity, availability.

2. Authentication & Access Control


 Authentication: verifying identity

 Access control: what the user is allowed to do

 Uses passwords, biometrics, user roles, file permissions

3. Encryption
Scrambles data so only authorized people can read it.
Used in banking, messaging, and secure websites.

4. Malware Protection
Viruses, ransomware, trojans, worms, spyware-software designed to harm.
Protection includes antivirus, updates, strong passwords, and safe browsing.

---------------------------------------------------------------
VII. Review and Applications
This section helps students understand how all the concepts come together, how they
are used in real life, and what the future of computer systems looks like.

1. Review of Key Concepts and Theories


Here is a short, simple recap of the most important topics from computer architecture
and operating systems.

1.1 Computer Architecture Review (How a computer is built inside)

Key Components
 CPU (processor): The “brain” that processes instructions.

 Memory (RAM): Temporary workspace for programs.

 Cache (L1, L2, L3): Very fast memory close to the CPU.

 Secondary storage: SSD/HDD for long-term data.

 Input/output devices: Keyboard, mouse, printer, network, etc.

Hierarchy of Memory
 L1 cache → fastest (nanoseconds)

 L2 cache → slightly slower

 L3 cache → bigger but slower

 RAM → much slower

 SSD → microseconds

 HDD → milliseconds

This organization helps the computer run programs faster by keeping important data
close to the CPU.

1.2 Operating System Review (How a computer manages tasks)


The operating system (OS) does four major things:

1. Manages hardware (CPU, memory, devices)

2. Manages files (folders, permissions, storage)

3. Handles input/output (keyboards, printers, network)

4. Provides security (passwords, encryption, antivirus)


2. Applications of Computer Architecture and Operating System Design
These concepts directly impact everyday technologies.

2.1 Smartphones
 Use multi-level cache to run apps smoothly

 OS (Android/iOS) manages files, apps, security

 Uses encryption to protect photos and messages

 Uses scheduling to manage apps running in the background

2.2 ATMs and Banking Systems


 OS controls card readers, keyboards, and network connections

 Security mechanisms protect PINs and financial data

 Fast memory hierarchy ensures quick responses

2.3 Hospital Systems and Medical Devices


 MRI and ultrasound machines rely on CPUs, memory, and OS processes

 Need strict security for patient records

 Real-time OS ensures machines respond instantly

2.4 Self-Driving Cars


 Depend on powerful processors and memory

 OS manages camera input, radar, and safety systems

 Real-time decisions require efficient architecture

2.5 Video Games and Graphics


 Use powerful CPUs and GPUs

 Rely heavily on memory hierarchy

 OS helps manage controllers, network, and displays

2.6 Cloud Computing (Google Drive, OneDrive, AWS)


 Uses virtual machines managed by operating systems

 Encryption protects cloud data

 Cache improves speed of frequently accessed files


3. Case Studies and Practical Examples

Case Study 1: How WhatsApp Uses OS and Architecture


 Encryption: Messages protected using cryptography

 Memory hierarchy: Frequently accessed chats stored in cache for speed

 Network I/O: OS manages sending/receiving messages

 Notifications: Interrupts inform the user when a new message arrives

Case Study 2: Online Banking


 Hardware architecture ensures fast calculations

 OS security prevents unauthorized access

 Encrypted communication protects login and transactions

 Disk scheduling ensures large databases perform smoothly

Case Study 3: Netflix/YouTube Streaming


 Cache stores small parts of videos for smooth playback

 OS manages network I/O and buffering

 Disk scheduling on servers ensures millions of video requests are handled


efficiently

 Encryption protects user accounts

Case Study 4: Airport Security Systems


 Multiple cameras and scanners

 OS must process input quickly and reliably

 Cache helps in video processing

 Secure OS design protects sensitive passenger data

4. Emerging Trends and Future Directions


Technology continues to evolve. Here are the major trends shaping the future of
computer architecture and operating systems.

4.1 Multi-Core and Many-Core Processors


Instead of making one CPU faster, companies now put many CPUs in one chip:

 4-core
 8-core

 32-core

 Even 128-core for servers

This allows more apps to run at once.

4.2 AI-Accelerated Hardware


Modern computers now include:

 GPUs (for graphics and AI)

 TPUs (Google’s AI chips)

 NPUs (Neural Processing Units in smartphones)

Architecture is evolving to support AI at the hardware level.

4.3 Quantum Computing


Not in everyday use yet, but emerging.
Quantum computers will:

 Solve problems impossible for normal computers

 Require new operating systems and memory models

4.4 Cloud and Edge Computing


 Cloud = computing done in remote data centers

 Edge = computing done near where data is generated (e.g., on your phone, or
roadside cameras)

Both need secure, efficient OS design.

4.5 Stronger Security Models


More advanced security features:

 Biometric authentication (fingerprint, face unlock)

 Encrypted storage

 Secure boot (prevents tampering during startup)

 Sandboxing (protects apps from affecting each other)

4.6 Internet of Things (IoT)


Billions of devices (sensors, home appliances, wearables) need:
 Tiny processors

 Lightweight operating systems

 Efficient memory usage

 Strong security

4.7 Energy-Efficient Architecture


New processors designed to:

 Use less power

 Generate less heat

 Extend battery life for smartphones and laptops

Final Simple Summary

Review of Key Concepts


 CPU = brain

 Cache = very fast memory

 OS manages apps, hardware, files, security

 Protect data using access control and encryption

Applications
Used in smartphones, medical systems, online banking, video streaming, self-driving
cars, cloud systems, etc.

Case Studies
Real-life systems like WhatsApp, Netflix, ATMs, and airport security rely on OS and
computer architecture.

Future Trends
 More CPU cores

 AI chips

 Quantum computing

 Cloud & edge

 IoT

 Stronger security
 Energy-efficient systems

Computer devises

-------------------------------------END--------------------------------------

You might also like