Chapter 2
Basic Computer Organization and Design
Computer Instructions
• An instruction in plain English means authoritative detailed
directions given by someone to be obeyed on some procedure.
• Mapping it to computers, a computer instruction is an order
given to the processor of a computer by a computer program
to perform a physical operation such as addition etc.
• Each instruction is a sequence of 0’s and 1’s that describes the
specification on how to perform the corresponding operation.
Types of Computer Instructions
• Computer Instructions can be classified based on:
location of operand
memory reference instruction: carries out the operation using
data from a location in the computer’s memory.
Correspondingly,
register reference instruction: works on registers that may
contain data to be used in carrying out the instruction.
input-output instruction: does not specify any register or
memory location to be worked on; instead it specifies the type
of input-output operation.
Type of operation
Data Transfer Instruction: It is responsible for movement of
data from a specific location to another. The source and
destination locations, any or both, may be that of memory or
register.
Arithmetic Instruction: It is an instruction that is used to
perform operations like addition, subtraction, multiplication,
division etc.
Logical Instruction: an instruction that is used to perform a
logical operation like AND, OR, NOT, left shift, right shift,
left rotate, right rotate etc
Input / Output Instruction: It is an instruction that is used to
perform input or output from the peripheral devices connected
to the system.
Computer instruction addressing formats
• The operand may be specified in an instruction
using various possible addressing modes. The
main addressing modes are:
• Direct address the address field in the
instruction gives the address of the operand,
• Indirect address, the address in the address
field gives an address of the memory word in
which address operand is found
Stored programs
• A stored program is a set of instructions and data expressed in
binary language, stored in non-volatile (ie. disk storage) memory
• Programs can be executed only from Memory.
Thus, a program must be loaded from disk to RAM in order to
execute it.
Loaded programs are called processes.
Individual instructions must be transferred to the CPU where
they are executed, using data that must be obtained from either
CPU registers or RAM
• A process is executed by executing each individual instruction
that, collectively, fulfill the intentions of the programmer.
Computer Registers
• Data Register(DR) : hold the operand(Data) read from memory
• Accumulator Register(AC) : general purpose processing register
• Instruction Register(IR) : hold the instruction read from
memory
• Temporary Register(TR) : hold a temporary data during
processing
• Address Register(AR) : hold a memory address, 12 bit width
• Program Counter(PC) : hold the address of the next instruction
to be read from memory after the current instruction is executed.
• Input Register(INPR) : receive an 8-bit character from an input
device
• Output Register(OUTR) : hold an 8-bit character for an output
device
Effective Address
• It is the address of the actual operand.
• In direct address, content of the address field
gives the effective address which is 457 in the
given example.
• In indirect address, the word in the memory
address specified in the address field gives the
effective address which is 1350 in the given
example.
Timing and Control
• The timing for all registers in the basic computer
is controlled by the master clock generator.
• The clock pulsed are applied to all the flip flops
and registers in the system.
• The clock pulses do not change the state of
register unless enabled by control signals.
• These signals are generated in the control unit.
There are two major types of control organization:
hardwired control and micro programmed
control
• In hardwired control, the control logic is
implemented with gates, flip flops, decoders
and other digital circuits.
• In micro programmed organization, the control
information is stored in a control memory.
• The control memory is programmed to initiate
the required sequence of micro operation.
Hardwired Control Unit
• The output of counter decoder and decoded
opcode of the instruction causes the control
logic to generate a particular control word for
the operation.
• At the end of each instruction, counter is
cleared.
• For the next instruction, the opcode produces
different output on the opcode decoder and the
control will be different and the control unit
will perform the different tasks
Input Output Configuration
• A computer serves no useful purpose unless it
communicates with the external environment.
• Instruction and data stored in memory must
come from some input device.
• Computational results must be transmitted to the
user through some output device
Input Output Configuration
• Input Register(INPR) consist of eight bits and hold
alphanumeric input information.
• The one bit input flag(FGI) is control flip flop. It is 1
when information is available in INPR and cleared to 0
when information is accepted by computer.
• The output register(OUTR) works in similar manner.
• When computer found FGO is 1, the information from
AC is transferred to OUTR and FGO is cleared to 0.
• The output device receives the information and set
FGO to 1.
Program Interrupt
• The speed of the peripheral devices are very
slow in comparison to that of the computer.
• So during i/o operation computer will waste
time while checking the flag instead of doing
some useful tasks.
• One solution for this problem is that computer
won’t check the flag continuously but get
interrupted whenever the flag is set.
• Computer than deviates from what it was doing
and take care of the i/o operation.