Chapter 3 - Basic Operational Concepts
Chapter 3 - Basic Operational Concepts
Basic Operational
Concepts
1
Important Points to Remember
l Activity in a computer is governed by instructions.
l To perform a task, an appropriate program
consisting of a list of instructions is stored in the
memory.
l Individual instructions are brought from the memory
into the processor, which executes the specified
operations.
l Data to be used as operands are also stored in the
memory.
2
Instruction
l An Instruction consists of 2 parts:
1) Operation code (Opcode)
2) Operands.
OPCODE OPERANDS
3
A Typical Instruction
l Add LOCA, R0
l Add the operand at memory location LOCA to the
operand in a register R0 in the processor.
l Place the sum into register R0.
l The original contents of LOCA are preserved.
l The original contents of R0 is overwritten.
l Instruction is fetched from the memory into the
processor – the operand at LOCA is fetched and
added to the contents of R0 – the resulting sum is
stored in register R0.
4
Separate Memory Access and
ALU Operation
l The preceding Add instruction combined a
memory access operation to an ALU
operation.
l In Modern computers, these 2 types of
operations are performed separately.
l The earlier instruction can be realized by two-
instruction sequence:
Load LOCA, R1
Add R1, R0
5
6
Connection Between the
Processor and the Memory
7
Connections between the processor and the memory
Registers
l Instruction register (IR)
l Program counter (PC)
l General-purpose register (R0 – Rn-1)
l Memory address register (MAR)
l Memory data register (MDR)
8
Typical Operating Steps
l Programs reside in the memory through input
devices
l PC is set to point to the first instruction
l The contents of PC are transferred to MAR
l A Read signal is sent to the memory
l The first instruction is read out and loaded
into MDR
l The contents of MDR are transferred to IR
l Decode and execute the instruction
9
Typical Operating Steps
(Cont’)
l Get operands for ALU
Ø General-purpose register
Ø Memory (address to MAR – Read – MDR to ALU)
l Perform operation in ALU
l Store the result back
Ø To general-purpose register
Ø To memory (address to MAR, result to MDR – Write)
l During the execution, PC is
incremented to the next instruction
10
Interrupt
l Normal execution of programs may be preempted if
some device requires urgent servicing.
l The normal execution of the current program must
be interrupted – the device raises an interrupt
signal.
l Interrupt-service routine
l Current system information backup and restore (PC,
general-purpose registers, control information,
specific information)
11
Bus Structures
l There are many ways to connect different
parts inside a computer together.
l A group of lines that serves as a connecting
path for several devices is called a bus.
l An addition to the lines that carry the data,
the bus must have lines for Address and
control purposes.
12
Bus Structure
l There are 2 types of Bus structures:
1) Single Bus Structure and 2) Multiple Bus
Structure.
1) Single Bus Structure
l Because the bus can be used for only one
transfer at a time, only 2 units can actively
use the bus at any given time.
l Bus control lines are used to arbitrate
multiple requests for use of the bus.
13
Bus Structure
l Advantages: 1) Low cost &
2) Flexibility for attaching peripheral devices.
16