Processor
(CPU):
Controls computer operations
Performs data processing functions
Runs under direction of the Operating System
Can only communicate via memory (registers)
Main
Memory (RAM):
Stores data and programs
Typically volatile (loses contents when power removed)
Read-Write
"Real Memory" (as opposed to Virtual Memory)
"Primary Storage"
Cache
Memory (internal & external):
memory between systems
a form of buffering
holds most recently used data
holds most frequently used data
holds data likely to be used next
I/O
Modules (Input/Output):
Move data between CPU and external environment
Usually have internal buffers
Buffers are temporary storage for data pending release or processing
System
Interconnection:
Structures and mechanisms to provide communications between processors,
main memory, cache and I/O modules
REGISTERS
Registers are high-speed storage
memory within the CPU itself, a level of memory that is much faster and smaller
than Main Memory
The primary purpose of registers
fall into 4 categories:
INPUT: holds data pending CPU processing (buffer)
OUTPUT: holds data the CPU has finished with (buffer)
PROCESS: data being processed, operational
ADDRESS: memory
location or I/O device
Typically, a CPU makes use of 2
internal types of Registers.
MAR Memory Address Register
Contains ADDRESS for next read/write operation
MBR Memory Buffer Register
Contains actual data to be written (flushed) back to main memory, or
Receives (read operation) data from main memory
I/O AR I/O Address Register
Specifies particular I/O device to read from/write to
I/O BR I/O Buffer Register
For exchange of data between I/O modules and CPU
A memory module consists of a set of locations defined by sequentially
numbered addresses.
Each location contains a binary number
-
could be data or instructions
|
|
|
|
|
|
|
|
|
|
CPU |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MAR |
|
|
|
|
PC |
|
|
|
|
|
|
|
|
MBR |
|
|
|
|
|
|
|
|
|
|
|
|
|
I/O AR |
|
|
|
|
IR |
|
|
|
|
|
|
|
|
I/O BR |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PROCESS
REGISTERS
There are 2 categories of these registers ..
USER
VISIBLE Registers
Assembly language
Machine language (native code)
Programmers able to control the system
Debug style programs
CONTROL
& STATUS Registers
Used by processor to control system
Some priviledged O/S routines can access these to control execution of
programs
Programmers unable to access to control the system
Not always clearly defined - there
are different implementations on different CPUs
USER VISIBLE REGISTERS
DATA
Registers
Can be assigned to a variety of functions
Often available for general use by the O/S and programmers
Some may be dedicated for use by the CPU (eg: for FP - floating point -
results)
ADDRESS
Registers
Main Memory addresses of data and instructions
Can contain portions of addresses used in the calculation of complete
addresses, known as the Base Value
INDEX
Registers
Contains portions of addresses to add to the Base Value to get the
effective address
Known as the Offset to the Base
SEGMENT
Pointers
Used for segmented addresses
Could be multiple registers used to store addresses
STACK
Pointers
Initially points to top of the stack
Allows for instructions with no address field (eg: PUSH and POP)
FLAG
Pointers
Condition codes
Decisions will be made based on register state
Bit set by processor as a result of operations
Is result a signed number (+ve), (-ve) ?
Is there a register overflow ?
Loop control at zero ?
Should interrupts be serviced ?
CONTROL & STATUS Registers
These registers are usually not
visible to the user (programmers cannot access them to monitor state of
processes)
PROGRAM
Counter (PC)
Contains addresses of instructions to be fetched
INSTRUCTION
Register (IR)
Contains instructions most recently fetched
PROGRAM
Status Word (PSW)
Most systems contain registers that contain internal flag/condition
codes similar to the User-Visible Flag Register
These are registers to contain status information
Sign, Zero, Carry, Equal, Overflow, Interrupt Enable/Disable, Supervisor
There are 2 techniques used to enable the CPU to
determine whether a Device Controller has finished a task.
POLLING
-
The CPU regularly checks the Status Registers of each device to see if
it has completed an operation or needs attention (eg: if an error has occured).
INTERRUPTS
-
The Device Controller sends a signal to the CPU
Interrupt Service Routines are special purpose programs to
determine what should be done when an interrupt signal is received.
(Sometimes called an Interrupt Handler)
Using interrupts is more efficient because the CPU is
only involved when it is needed.
When an interrupt signal is detected, the CPU hardware
performs 2 main actions.
Automatically suspends the current process and saves its details in an
area of memory called the STACK
Loads the address of the interrupt handler and runs the service routine
The service routine takes control of
the CPU and could be implemented in software or firmware.
CLASSES of INTERRUPTS
There are 2 types of interrupts in
use within a system
HARDWARE
Mechanisms, usually tracks on the motherboard that can have voltages
applied, or other methods to signal the request to the CPU or its Interrupt
Controller
SOFTWARE
Operating System interrupts (may be a high number of them in use) that
enable programmers to request O/S action (eg: display on the screen, print,
storage requests, etc)
HARDWARE INTERRUPTS
PROGRAM
Generated as a result of instruction execution
Allows the processor to do a range of tasks, such as housekeeping and
making sure that quantums are not exceeded
I/O
(Input/Output)
Generated by I/O controllers
Enable external components to request the CPU to do something or supply
data
Usually the only method of communication by external devices
HARDWARE
Failure
Memory parity errors
Power problems