0795 CSC - Lower Sixth Notes
0795 CSC - Lower Sixth Notes
Outline
Module 3: Software
1. Application Software
2. System Software
3. Operating System Functions
Module 1: Computer Organisation and Architecture 2. The Functional Setup of Computer System
A modern computer can be defined as a machine that
can accept instructions and perform computations
1.1. Basic Computer Architecture
based on those instructions. A computer takes data as
Lesson 1: Introduction to Computer Organisation
input from the user and processes this data under the
1. Definitions control of a set of instructions called program, and
Computer architecture refers to the abstract design gives the result as output and can save the data for
and functional behavior of a computer system. It future use. The machine part of the computer consists
includes the instruction set architecture, data of physical components called the hardware, while the
formats, and addressing modes. Defining the program part consists of intangible components called
instruction set, the number of bits used for the software.
representing various data types, and techniques for
addressing memory are examples of architectural There are four main components in the functional setup
Computer organisation refers to the operational unit, the Input/Output Unit and the Buses.
units and their interconnections that realize the The Central Processing Unit (CPU)
architectural specification. This includes the high- Function: Executes program instructions and process
level aspects of a computer’s design such as the data.
CPU, memory types, I/O devices, and buses. Main components:
Describing the layout of a CPU, memory hierarchy - Control Unit
and data paths are examples of computer - Arithmetic Logic Unit
organisational attributes. - Registers
1
Memory type of computer architecture in which instructions and
Function: Stores data and instructions that the CPU data are stored together in a common memory. It is a
needs during processing stored-program computer model based on the
Types: following three concepts:
- Random Access Memory (RAM) - Data and instructions are stored in a single read-
- Read Only Memory (ROM) write memory.
- Secondary storage - The contents of this memory are addressable by
location, without regard to the type of data
Input/Output (I/O) Devices
contained there.
Input devices: allow users to input data into the
- Execution occurs in a sequential fashion (unless
computer.
explicitly modified) from one instruction to the
Examples:
- Keyboards next.
The architecture of a computer system defines its structure Some key applications of the Von Neumann
and behavior, detailing how hardware components interact. architecture are:
Computer architectures can be classified into several types - Personal computers and laptops.
based on different criteria. The most common types are - Some microcontrollers
Von Neumann, Harvard, parallel processing, distributed - Supercomputers and high-performance clusters.
and dataflow architectures. - Video game consoles
2
Instruction Memory Multiple Instruction, Single Data
MISD machines are multiprocessor machines capable
ALU
of executing different instructions on different
Input Unit Output Unit processors, but all of them operating on the same data
Control Unit set. They have n processors, each with its own control
unit, that share a common memory. Each processor
Data Memory
receives a distinct instruction stream but all operate on
Block diagram of Harvard Computer the same data stream. Such machines no longer exist.
3
Simplified Instruction Set: RISC architectures Shorter Design Cycle: RISC processors can be
use a small, highly optimized set of instructions. designed more quickly, and can take advantage of
Each instruction typically performs a single task. other technological developments sooner than
Load/Store architecture: RISC architectures corresponding CISC designs, leading to greater
often follow a load/store model, where arithmetic leaps in performance between generations.
and logical operations can be performed only on
operands that are in processor registers. Complex Instruction Set Computers
CISC is a CPU design with a large number of different
Fixed Instruction Length: RISC instructions and complex instructions. CISC instructions are
have a uniform instruction length where each microprogrammed. This means that the control unit
instruction fits in a single word. The restriction uses a microcode to execute instructions. The
reduces the complexity and the number of microcode is a set of instructions that can be modified
different types of instructions that may be included or update, allowing for greater flexibility and ease of
in the instruction set of a computer. modification.
CISC style characteristics are:
Large Number of Registers: RISC designs often
include a larger set of general-purpose registers to Complex Instruction Set: CISC architectures
have a larger set of instructions, some of which
minimize memory access.
can perform complex operations in a single
Simple Addressing Modes: RISC architectures instruction.
employ a limited number of addressing modes,
simplifying instruction decoding and execution. Memory Operations: CISC instruction sets are
not constraint to the load/store architecture. Many
Pipelining: RISC instructions are optimized for instructions can directly operate on memory,
pipelining, allowing multiple instructions phases allowing for fewer load/store instructions
(fetch, decode, execute) to occur simultaneously, compared to RISC.
improving performance.
Variable Instruction Length: Instructions can
Advantages of RISC architecture: vary in length, which can complicate the decoding
Higher Performance: A simplified instruction set but allows for more flexibility in instruction
allows for a pipeline processing. This allows for design.
faster execution and improved performance.
Fewer Registers: CISC architectures typically use
Lower Per-Chip Cost: The instruction set of a fewer registers, relying on memory for temporary
RISC processor is so simple that it uses up much storage more than RISC architectures.
less chip space. Smaller chips allow a
semiconductor manufacturer to place more parts Complex Addressing Modes: CISC instructions
on a single silicon wafer, which can lower the per- support a wide variety of addressing modes,
4
computer contains a superset of the instructions of Applications of distributed computer architecture are:
the earlier computers. Web services: many web applications use distributed
Efficient Use of Memory: As each instruction is architectures to balance load and provide redundancy.
more capable, fewer instructions can be used to Examples are Amazon S3, Google Drive, Dropbox.
implement a given task. This makes more efficient Data processing: big data applications often utilize
use of the relatively low main memory. distributed computing frameworks like Apache Hadoop
and Apache Spark.
Compiler Simplicity: Because microprogrammed
Collaborative applications: systems that require
instruction sets can be written to match the
simultaneous input from multiple users, such as online
constructs of high-level languages, compilers do
gaming or collaborative tools.
not have to be as complicated.
6. Dataflow Architecture
5. Distributed Architecture
Dataflow computer architecture is designed to optimize the
Distributed computer architecture refers to a system
flow of data between processing units, allowing for high
where multiple independent computers work together
levels of parallelism and efficient execution of tasks. In
to achieve a common goal. These systems can be
dataflow architectures, execution is determined by the
geographically dispersed and communicate over a
availability of data rather than a predetermined sequence of
network. Components of distributed computer
instructions. Operations are triggered by the arrival of their
architecture are:
input data. The architecture is often represented as a graph
Nodes: individual computers or servers that
where:
participate in the distributed system.
Nodes: represent operations like addition,
Network: the communication medium (e.g. LAN,
multiplication, …
WAN, Internet) that connects the nodes.
Edges: represent data dependencies between these
Middleware: software that facilitates
operations.
communication and management of distributed
resources. --------------------------------------------------------------------------------
Common types of distributed architectures are: Lesson 3: The Processor and Its Components
Cluster computing: a set of interconnected The Central Processing Unit (CPU), also called processor,
computers that work together as a single system. is the part of the computer that controls the operation of the
Clusters are often used for high-performance computer and performs its data processing functions by
Grid computing: a distributed architecture that representing programs. Modern CPUs are microprocessors,
connects multiple computers system across various meaning that they are contained on a single integrated
locations to perform large-scale computations. circuit (IC) chip. An integrated circuit is semiconductor
Cloud computing: a form of distributed material on which thousands or millions of tiny electronic
computing where resources (servers, storage, components (transistors, resistors, capacitors, and diodes)
applications) are provided over the internet on a are connected together as a circuit. This technology of
5
other CPU components include registers, cache memory, - Program Counter (PC): holds the memory
clock and buses. address of the next instruction to be executed.
- Instruction Register (IR): holds the
1. Arithmetic Logic Unit
instruction that is currently being executed by
The ALU is responsible for performing arithmetic
the processor.
operations (addition, subtraction, multiplication,
- Memory Address Register (MAR): holds
division) and logical operations (AND, OR, NOT).
the memory address where data is to be read
Bitwise logical operations and shift operations are also
(fetched) or written (stored).
performed by the ALU to manipulate individual bits.
- Memory Data/Buffer Register
These are essential operations that need to be done on
(MDR/MBR): holds data that has been read
almost any data that is being processed by the CPU.
in from memory or data produced by the ALU
2. Control Unit and waiting to be written to memory.
The Control Unit is responsible for coordinating and - Status Register(SR): holds information about
controlling all the operations of the computer. It does the state of the processor. Status register bits
this by issuing timing and control signals to the other are called flag bits or flags and each flag has a
units, instructing them on how to respond to a unique purpose. For example, there are flag
program’s instructions. By locating and retrieving bits for negative, zero, overflow, and carry.
(fetching) program instructions from memory, Negative bit (N): Set to 1 if the result is
interpreting (decoding) them and ensuring that they are negative; otherwise, cleared to 0
Zero bit (Z): Set to 1 if the result is 0;
executed in proper sequence, the control unit acts like
otherwise, cleared to 0
supervisor seeing that things are done the way they Carry bit (C): Set to 1 if a carry-out results
ought to. from the operation; otherwise, cleared to 0
Overflow bit (V): Set to 1 if arithmetic
3. Registers overflow occurs; otherwise set to 0.
Registers are small, fast storage locations within the
- Accumulator (ACC): holds results of
CPU used to hold temporary data and instructions.
computations performed by the ALU. When
Each register typically holds a word of data, often 32
the ALU carries out an operation like
or 64 bits, depending on the word size of the computer.
addition, subtraction and multiplication, it
The word size refers to the maximum number of bits
stores the result in the accumulator either for
that the processor can manipulate at a time. Since the
reuse by the ALU or before it is sent to a
CPU uses registers for the processing of data, the
destination register.
number of registers in a CPU and the size of each
register, affect the power and speed of the CPU.
4. Buses
Registers can be grouped into two:
(i) General-purpose registers: store data and
addresses according to the need of the program
being executed.
(ii) Special-purpose registers: dedicated to specific
tasks and have special names. They include:
program counter, instruction register, memory
address register, memory data/buffer register, and
status register.