2_chapter 2 Computer Organization
2_chapter 2 Computer Organization
Chapter 2
DNCS
I NT RODUCT ION TO COMPUT E R ORGANIZAT ION
Powered by Mr. Bulega Herbert Moses
Electronic Computers
Electronic computers use electronic circuits instead of mechanical or electromechanical parts. They rely on vacuum tubes, transistors, and integrated circuits
(ICs) to perform calculations at very high speeds. No moving mechanical parts. Use of electrical signals through semiconductors. Extremely fast, reliable, and efficient.
Divided into generations based on technology (Vacuum tubes → Transistors → ICs → Microprocessors). ENIAC (1946), EDVAC (1949), EDSAC (1949), UNIVAC
I (1951), IBM 701 (1952), IBM System/360 (1964), Apple I (1976), IBM PC (1981) First Generation (Vacuum Tubes):
Generations of Computers Huge in size; filled rooms. Programmed using machine language.
Limited reliability and speed.
The history of electronic computers is divided into five main generations, based on the
technology used in the processing unit. Second Generation (Transistors):
Smaller and more reliable than vacuum tubes.
Introduced assembly language programming.
Reduced heat generation and cost.
Third Generation (Integrated Circuits):
Enabled multiprogramming and time-sharing systems.
Faster processing, smaller size, lower cost.
High-level languages like COBOL and FORTRAN widely used.
Fourth Generation (Microprocessors):
Entire CPU on a single silicon chip.
Rise of personal computers and graphical interfaces.
Mass production led to widespread accessibility.
Fifth Generation (VLSI and AI):
Uses Very Large Scale Integration (VLSI) technology.
AI and neural networks integrated for intelligent computing.
© ISBAT UNIVERSITY – 2026. powered by Mr. B u l e g a H e r b e r t M o s e s 10/23/2025
Portable, low-power, high-performance devices with parallel and
distributed processing.
F u n c t i o n a l U n i t s o f a C o m p u t e r S ys t e m
6
[Link] Unit: The input unit is responsible for receiving data and instructions from
external sources (such as keyboards, mice, scanners) and converting them into a form
that the computer can process. Key Functions:
• Accepting data from the user or external devices.
• Converting input into binary code (machine-readable format).
• Sending data to the memory or processor for further processing.
Examples of Input Devices: Keyboard, Mouse, Scanner, Microphone, Barcode Reader.
o Touchscreens. Sensors, Stylus pens. Voice Assistants (e.g., Siri, Alexa).
o Biometric devices (face/fingerprint recognition). Iot-based inputs from smart devices
[Link] Unit: The output unit is responsible for presenting processed data to the
user in a human-readable or usable form. Key Functions:
• Receiving processed information from memory or CPU.
• Converting binary results into user-understandable formats.
• Displaying results through output devices.
Examples of Output Devices: Monitor, Printer, Speaker, Projector.
Improving System Performance: Computer organization Knowledge helps in computer system optimization, like tuning cache, scheduling processes, or improving
input/output operations. For example, Cache Tuning: Adjusting cache policies or sizes to improve data access speed in specific workloads.
Understand Instruction Execution: Learning instruction cycles, pipelining, and instruction set architecture (ISA) helps developers know how code is translated
into machine instructions, executed and debugged. E.g., Opcode Analysis: Writing assembly code that takes advantage of specific CPU instructions. Pipelining:
Designing software to reduce pipeline hazards in a multi-stage processor. CPU pipelining is a method used in computer processors to increase instruction amount,
allowing many instructions to overlap in execution. It divides the execution of instructions into separate stages, where each stage performs part of the work..
Exploring Emerging Technologies: Computer organization concepts are vital for exploring cutting-edge technologies such as quantum computing, neuromorphic
computing, and hardware acceleration. For example, Neuromorphic Chips: Developing chips inspired by neural networks for AI applications.
Understanding Memory Hierarchies: Learning about memory categories (e.g., cache, RAM, ROM, and secondary storage) and their hierarchies is important for
optimizing memory usage and performance. A very clear understanding of memory hierarchies helps in designing systems with balanced speed and cost. E.g., Cache
Hierarchy: Designing software to use205 L1 and L2 caches effectively. Memory Allocation: Using methods like memory pooling to reduce fragmentation in high-
performance apps. Memory fragmentation is a condition in computer memory management where available memory is divided into small, scattered blocks, making it
difficult or impossible to allocate memory efficiently. Fragmentation can reduce the performance of systems and lead to wastage of memory resources.
Preparing For Specialized Fields: Fields like embedded systems, robotics, and IoT need knowledge of PC organization to design and optimize low-level systems.
Such areas really rely on computer organization principles. Embedded Systems: Designing hardware-software co-designed solutions like automotive control units.
Robotics: Creating efficient systems for real-time sensor data processing. IoT Devices: Building low-power systems that optimize processing and communication.
[Link]-Decode-Execute Cycle
The CPU operates by repeatedly performing the instruction cycle, which consists of:
[Link]: CPU fetches the next instruction from memory (main memory/RAM) based on the Program Counter (PC).
[Link]: Control Unit interprets the instruction and determines what operation is required.
[Link]: ALU performs arithmetic or logical operations. Data is transferred to memory or output devices if required.
[Link] in Computer Organization: Timing determines when control signals are asserted and how long they remain active. It ensures that all devices operate in
harmony with each other.
[Link] System Clock: A clock is an electronic oscillator that generates regular pulses. These pulses define the timing intervals (called clock cycles or T-states)
that control signal operations. The frequency of the clock (measured in MHz or GHz) determines the speed of CPU operations.
[Link] Machine Cycle: A machine cycle is the basic unit of time required to execute one low-level operation, such as reading or writing data. Each instruction may
take one or more machine cycles to complete.
[Link] and Timing During Instruction Execution: Each instruction passes through phases managed by control signals and timing:
Phase Activity Control Signals
Fetch Instruction fetched from memory. MEMR, Address Enable
Decode Opcode is interpreted by control unit. Decode Enable
Execute ALU performs operation. ALU Control, Flag Set
Store Result written to memory or register. MEMW or Register Write
[Link] of Control Signals and Timing
Aspect Importance
Synchronization Ensures components act in correct sequence.
Coordination Controls interactions between CPU, memory, and I/O.
Accuracy Prevents data corruption during transfers.
Efficiency Optimizes CPU cycle utilization.
Reliability Guarantees correct instruction execution order.
[Link] Instructions: Purpose: Perform bitwise logical operations for decision-making or data manipulation.
Operation Description Examples
AND Bitwise AND between operands. AND A, B
OR Bitwise OR operation. OR A, B
XOR Bitwise exclusive OR operation. XOR A, B
NOT/COMPLEMENT Inverts all bits in operand. NOT A
Test (TEST) Perform AND operation but do not store result (used for checking flags). TEST A, B
Example in Action: Instruction AND A, B — the CPU performs a bitwise AND of A and B, stores result in A.
[Link] (Branching or Jump) Instructions: Purpose: Alter the sequence of program execution used for looping, conditional branching, and subroutine control.
Operation Description Examples
Jump (JMP) Unconditional transfer to another address. JMP 2050H
Conditional Jump (JZ, JNZ, JC, JNC) Transfer control if a certain flag condition is met. JZ 3050H
Call (CALL) Jump to a subroutine (procedure). CALL 4000H
Return (RET) Return from a subroutine. RET
Interrupt (INT) Call an interrupt service routine. INT 21H
Example in Action: Instruction JZ LABEL — if the Zero flag = 1, the CPU jumps to LABEL, else continues sequentially.
[Link] and Test Instructions: Purpose: Compare data values or test bit conditions to set CPU status flags.
Operation Description Examples
Compare (CMP) Subtract operands to set flags, without changing operands. CMP A, B
Test (TEST) Perform bitwise AND to set flags. TEST A, 01H
Example in Action: CMP A, B — if A == B → Zero flag set; if A < B → Carry flag set; if A > B → Carry cleared.
[Link] and Rotate Instructions: Purpose: Shift or rotate bits in a register or memory location for logical or arithmetic operations.
Operation Description Examples
Shift Left (SHL/SAL) Shift bits left (multiply by 2). SHL A, 1
Shift Right (SHR/SAR) Shift bits right (divide by 2). SHR B, 1
Rotate Left (ROL) Rotate bits left through carry flag. ROL A
Rotate Right (ROR) Rotate bits right through carry flag. ROR A
Example in Action: SHL A, 1 shifts bits in A left by one position — doubles the value.
[Link]/Output Instructions: Purpose: Facilitate communication between CPU and peripheral devices.
Operation Description Examples
IN Read data from an input port. IN 00H
OUT Send data to an output port. OUT 01H
Example in Action: IN 01H — CPU reads data from device connected to port address 01H.
[Link] and Subroutine Control Instructions: Purpose: Manage subroutines and stack memory (used for temporary storage of data and return addresses).
Operation Description Examples
PUSH Store register contents on stack. PUSH A
POP Retrieve data from stack to register. POP A
CALL Transfer control to a subroutine. CALL 2000H
RET Return from subroutine. RET
Example in Action: PUSH A saves the contents of A onto the stack memory.
[Link] Control Instructions: Purpose: Control overall system operation, power management, or interrupt handling.
NOP No operation; CPU does nothing for one cycle. NOP
HLT Stop CPU execution until reset or interrupt. HLT
DI / EI Disable or enable interrupts. DI, EI
RESET
© ISBAT UNIVERSITY – 2026. Reinitialize CPU and system state.
powered by Mr. B u l e g a H e r b e r t M o s e s
— 10/23/2025
Example in Action: HLT halts CPU execution until an interrupt or reset signal occurs.
Chapter Overview
25
[Link]/Output Operations
Input devices send data to memory or CPU. Output devices display processed results. I/O operations may be programmed, interrupt-driven, or DMA-based.
Input/Output (I/O) operations are vital processes that enable a computer system to communicate with external devices such as keyboards, mice, printers, displays, and
storage devices. These operations are responsible for transferring data between the CPU, memory, and peripheral devices, ensuring that input data can be
processed and output results can be delivered. Input/Output Operations are mechanisms and procedures by which a computer system receives data (input) from
external sources and sends data (output) to external devices. They form a bridge between the computer’s internal components (CPU, memory) and the external
environment. Basic Components of I/O Operations: CPU (Central Processing Unit): Controls and coordinates data transfer between memory and I/O devices.
Memory: Stores data temporarily during transfer amid a processor and peripheral devices. I/O Modules (Controllers): Act as intermediaries amid the CPU/memory
and peripheral devices. They handle device-specific operations such as data buffering, control signal generation, and status reporting. Peripheral Devices: External
devices such as keyboards, mice, printers, disks, and monitors that provide input or receive output.
[Link] in an I/O Operation
[Link] Initiates I/O Request: The CPU issues a command to an I/O controller to perform an operation (read/write). 2.I/O Device Performs the Task: The controller
translates CPU commands into device-specific actions. [Link] Transfer: Data is transferred between the device and memory (either directly or through the CPU).
[Link] Notification: The I/O controller signals the CPU that the operation is complete, often using an interrupt.
[Link] of I/O Operations
A. Programmed I/O (Polling): The CPU continuously checks the device status to see if it is ready to send/receive data. Simple but inefficient — the CPU is busy
waiting for I/O completion. Steps: CPU issues an I/O command. CPU polls the device until it is ready. Data is transferred. CPU resumes other tasks. Used in: Simple
embedded systems or low-speed devices.
B. Interrupt-Driven I/O: The device sends an interrupt signal to the CPU when it is ready for data transfer. The CPU can perform other tasks until interrupted.
Steps: [Link] issues I/O command and continues executing other instructions. [Link] signals interrupt when ready. [Link] temporarily suspends current task to
handle I/O via an interrupt service routine (ISR). Advantages: Efficient CPU utilization. Faster response to I/O readiness.
[Link] Memory Access (DMA): Allows data transfer directly between memory and I/O devices, bypassing the CPU after initialization. Steps: CPU sets up the
DMA controller with memory address and byte count. DMA controller transfers data directly between device and memory. CPU is interrupted only after the transfer
completes. Advantages: Reduces CPU overhead. Increases data throughput for high-speed devices (e.g., disk drives).
5.I/O Addressing Methods
[Link]-Mapped I/O: I/O devices share the same address space as memory. CPU uses regular memory instructions (LOAD/STORE) for I/O.
[Link] I/O (Port-Mapped I/O): Separate address space for I/O devices. Special instructions (IN, OUT) are used for I/O operations.
6.I/O Control Techniques
Synchronous I/O: CPU waits for I/O completion before proceeding. Asynchronous I/O: CPU continues execution and is later informed when I/O is complete.
Buffered I/O: Data is temporarily stored in a buffer to handle speed differences between CPU and devices.
[Link] and Multiprogramming
Interrupts: Signals the CPU to briefly stop current execution to service an urgent task. Multiprogramming: Allows many programs to run concurrently by managing
CPU and memory efficiently. Interrupts and multiprogramming are two vital concepts in computer organization and operating systems that enhance CPU efficiency,
responsiveness, and system throughput. They allow a computer to perform many tasks well and handle external or internal events without wasting processing time.
[Link]: Definition and Concept
An interrupt is a signal sent to a CPU that briefly halts the current execution so that the processor can attend to an urgent task or event. After handling the interrupt, the
CPU resumes the earlier task from where it was interrupted. Interrupts are mechanisms that allow the CPU to respond quickly to important or time-critical events.
[Link] of Interrupts: Interrupts can be classified in several ways:
A. Based on Source
Type Description Example
Hardware Interrupt Generated by external devices to signal the CPU. Keyboard press, Mouse click, Printer ready
Software Interrupt Generated intentionally by software or a program instruction. System calls, exceptions (e.g., divide by zero)
© ISBAT UNIVERSITY – 2026. powered by Mr. B u l e g a H e r b e r t M o s e s 10/23/2025
Chapter Overview
27
B. Based on Functionality
Type Description Example
Maskable Interrupt (IRQ) Can be enabled or disabled by software. Peripheral interrupts (timer, I/O device)
Non-Maskable Interrupt (NMI) Cannot be disabled; used for critical events. Hardware failure, Power failure
Internal Interrupt (Trap/Exception) Generated by CPU during instruction execution. Arithmetic overflow, Invalid opcode
C. Based on Priority
Vectored Interrupt Control is transferred to a specific address or vector associated with that interrupt.
Non-Vectored Interrupt Address of interrupt service routine (ISR) must be supplied externally or by software.
[Link] Handling Process: When an interrupt occurs, the CPU follows a sequence known as the Interrupt Cycle:
[Link] Signal Detection – CPU detects an interrupt request. [Link] Current Instruction – CPU completes the current instruction before servicing the
interrupt. [Link] Current Context – Contents of the CPU registers and program counter (PC) are stored. [Link] Control to ISR – CPU jumps to the Interrupt
Service Routine (ISR) address. [Link] ISR – The interrupt is handled (e.g., input is read, output is sent). [Link] Context – CPU restores saved register and PC
values. [Link] Normal Execution – Execution resumes from where it was interrupted.
[Link] of Interrupts
Increases efficiency: CPU doesn’t waste time polling devices. Improves responsiveness: Handles urgent events immediately. Supports multitasking: Many
devices or programs can signal the CPU. Facilitates error handling: Responds to faults like division by zero or invalid memory access.
[Link]: Definition and Concept
Multiprogramming is a method that allows multiple programs (jobs) to be loaded into memory and executed concurrently by the CPU. However, the CPU executes only
one program at a time, switching rapidly between programs to maximize utilization. When one program is waiting for I/O, another program uses the CPU.
[Link] Principle of Multiprogramming
[Link] programs are stored in main memory at once. [Link] executes one program, but when it encounters an I/O operation (e.g., reading from disk), it switches to
another program that is ready for execution. [Link] Operating System scheduler decides which job to run next based on priorities and availability. [Link] process
continues so that the CPU is never idle.
© ISBAT UNIVERSITY – 2026. powered by Mr. B u l e g a H e r b e r t M o s e s 10/23/2025
Chapter Overview
28
[Link] of Interrupts in Multiprogramming: Interrupts are the backbone of multiprogramming, enabling the CPU to switch between jobs efficiently.
Action Interrupt Role
Job Switching When a running program waits for I/O, an interrupt allows another program to run.
I/O Completion Device sends an interrupt to signal that I/O operation has finished.
Time Sharing Timer interrupts ensure fair CPU time distribution among programs.
System Calls Software interrupts allow programs to request OS services.
[Link] of Multiprogramming
[Link] CPU Utilization: No idle CPU time during I/O waits. [Link] Throughput: Multiple programs progress simultaneously. [Link] Waiting Time : Users
experience shorter response times. [Link] System Reliability: If one program fails, others continue. [Link] Multiuser Environments: Multiple users can
share the same system resources.
[Link] of Multiprogramming
[Link] Operating System: Requires sophisticated scheduling and memory management. [Link] Management Overhead: Many programs compete for
memory space. [Link] and Protection Issues: One program could affect another’s data. [Link] Overhead: Frequent context switching may slightly reduce
performance.
[Link] Between Interrupts and Multiprogramming
Aspect Interrupts Multiprogramming
Purpose Handles events that require immediate attention. Allows multiple programs to share CPU efficiently.
Function Temporarily halts current process and runs ISR. Switches between processes for better CPU use.
Dependency Essential for asynchronous I/O handling. Relies on interrupts for job switching and resource management.
Result Fast response to events. Maximized CPU and resource utilization.
Thank you
© ISBAT UNIVERSITY – 2026. powered by Mr. B u l e g a H e r b e r t M o s e s 10/23/2025