System Architecture and Programming
System Architecture and Programming
o The special routine executed to handle the interrupt is called an Interrupt Service
Routine (ISR) or Interrupt Service Procedure.
o When an interrupt occurs, the processor stops executing the current program and
services the interrupt.
o For example, it is important for the system to respond to devices like keyboards,
sensors, and other components when they request service.
o In this method, the processor tests each device in sequence to check if it needs
communication.
o Drawbacks:
o Processor continues with its main program and only stops when a device signals that
it needs service.
o The processor:
A. Internal Memory
These are located inside the computer and directly accessible by the processor.
Processor Registers
Cache Memory
B. External Memory
These are storage devices located outside the processor and used for long-term data storage.
Tape Drives
2. Unit of Transfer
Definition: refers to the amount of data that can be transferred to or from memory in a single
operation.
The unit of transfer is the number of bits or words read or written at one time.
Typically aligned with the word length of the system (e.g., 32-bit, 64-bit).
b. Internal Memory
The unit of transfer is determined by the number of electrical data lines to/from the
memory module.
c. External Memory
A block is the smallest chunk of data that can be read/written in one operation.
Memory capacity defines how much data a memory system can hold and access. It is measured using
the following parameters:
A. Number of Words
The word size is typically equal to the number of bits used to represent an integer or
instruction.
B. Number of Blocks
A block is a larger unit used for data transfer between memory and cache or storage.
Example:
C. Addressable Units
Addressable unit: The smallest chunk of memory that can be uniquely addressed by the
system.
This characteristic refers to how data is accessed or retrieved from a memory system.
A. Sequential Access
Examples:
B. Direct Access
Data is still accessed using a read/write mechanism, but you can move directly to a specific
block.
Examples:
o CDs, DVDs
C. Random Access
Each location has a unique address and can be accessed independently and directly.
A form of random access, but data is retrieved based on content rather than a specific
address.
The system compares the desired content with all words simultaneously.
Examples:
o Cache Memory
o Routers, Firewalls
Summary Table:
Access Type Access Method Speed Examples
Direct Access Block-level, movable head Moderate HDDs, SSDs, CDs, DVDs
Associative Access Content-based, parallel match Very Fast Cache, TLB, routers, firewalls
Two of the most important characteristics of a memory system are its capacity and performance.
A. Capacity
It is the interval from the moment an address is presented to the memory until the
requested data is available (for read) or written (for write).
Applies to: Mostly Random Access Memory (RAM) and similar memory types.
Definition: The total time required before a second memory operation (read or write) can
begin.
Includes:
o Access Time
Note: Even if a processor is fast, it must wait for memory to complete its current cycle
before performing another operation.
Memory Cycle Time Time before another operation can start Frequency of operations
3. Transfer Rate
Definition:
The transfer rate is the rate at which data can be moved into or out of a memory unit.
Purpose:
Indicates how fast memory can communicate with the CPU or other components.
Since each read/write operation takes one full cycle, the transfer rate is inversely
proportional to the cycle time.
PYQs
2. consider a system with three I/O devices: a printer, a disk, and a communications line, with
increasing priorities of 2,
When the communications ISR is complete (t =25), the previous processor state is restored,
which is the execution of the printer ISR. However, before even a single instruction in that
routine can be executed, the processor honors the higher priority disk interrupt and control
transfers to the disk ISR. Only when that routine is complete (t=35) is the printer ISR
resumed. When that routine completes (t=40), control finally returns to the user program.