Haramaya University
College of Computing and Informatics
Department of Computer Science
Computer Organization and Architecture(COA)
04/05/2025 1
04/05/2025 2
Chapter - 5
Basic Computer Organization and Design
04/05/2025 3
Outline
Instruction Codes
Computer Registers
Computer Instructions
Timing and Control
Design of Basic Computer
04/05/2025
Instruction Codes
o A program is a set of instructions that
specify the operations, operands, and the
sequence by which processing has to occur.
o A computer instruction is a binary code
that specifies a sequence of micro-
operations for the computer.
o An instruction code is a group of bits
that instruct the computer to perform a
specific operation.
4
04/05/2025 5
Instruction Codes
The user of a computer can control the process by means
of a program
A program is a set of instructions that specify the
operations, operand, the sequence(control)
An instruction is a binary code that specifies a sequence
of micro operations.
Instruction codes together with data are stored in
memory(Stored Program Concept)
Instruction Cycle: The computer reads each instruction
from memory and places it in a control register. The
control then interprets the binary code of the instruction
and proceeds to execute it by issuing a sequence of
micro operations.
04/05/2025
Instruction Codes…
o Instruction format:
o Two major components of an instruction code:
o The operation code (opcode)
o Address
o An opcode specifies the operation for the instruction.
o An address specifies the registers and/or locations
in memory to use for that operation
Opcode
Fig: Instruction Format
11 0
15 14
I Address
12
Addressing
mode
6
04/05/2025
Instruction Codes…
o Address Mode:
o The address field of an instruction represents
o Direct address: the address in memory of the data to
use
(the address of the operand)
oIndirect address: the address in memory of the
address in memory of the data to use
7
04/05/2025
Basic Computer Registers
Fig: Basic Processor
registers
8
04/05/2025 9
Addressing Mode
Immediate operand address: The second part of an
instruction code(address field) specifies an operand
 Operand is specified in the instruction itself.
Direct operand address: The second part of an instruction
code specifies the address of an operand
Indirect operand address :The bits in the second part of the
instruction designate an address of a memory word in
which the address of the operand is found
one bit of the instruction code is used to distinguish
between a direct and an indirect address
Effective Address: The operand address in computation-
type instruction or the target address in a branch-type
instruction
04/05/2025 10
Computer Registers
Basic computer registers and memory
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.
04/05/2025 11
Cont…
Program Counter(PC) : Hold the address of the next
instruction to be read from memory after the current
instruction is executed.
Instruction words are read and executed in sequence
unless a branch instruction is encountered.
A branch instruction calls for a transfer to a
nonconsecutive instruction in the program.
The address part of a branch instruction is transferred to
PC to become the address of the next instruction.
To read instruction, memory read cycle is initiated, and
PC is incremented by one (next instruction fetch)
04/05/2025 12
Cont…
Input Register(INPR) : receive an 8-bit
character from an input device
Output Register(OUTR) : hold an 8-bit
character for an output device
04/05/2025
Basic Computer Registers…
Fig: Registers
Connected to
Common
Bus
13
04/05/2025 14
Cont…
Common Bus System
The basic computer has eight registers, a memory unit,
and a control unit
Paths must be provided to transfer information from one
register to another and between memory and registers
A more efficient scheme for transferring information in a
system with many registers is to use a common bus
The connection of the registers and memory of the basic
computer to a common bus system
04/05/2025
Computer Instructions
o The basic computer has three instruction
code formats:
15
011
04/05/2025
Computer Instructions
16
04/05/2025
Computer Instructions…
Fig: Basic Computer
Instructions
17
04/05/2025
Computer Instructions…
o Instruction Types:
o Functional Instructions
o Arithmetic, logic, and shift instructions
o ADD, CMA, INC, CIR, CIL, AND, CLA
o Transfer Instructions
oData transfers between the main memory
and the processor registers
o LDA, STA
o Control Instructions
oProgram sequencing and control
o BUN, BSA, ISZ
o Input/Output Instructions
oInput and output
oINP, OUT
18
04/05/2025
Timing and Control
o Control Unit:
o Control units are implemented in one of
two ways:
o Hardwired Control
oCU is made up of sequential and combinational
circuits to generate the control signals
o Microprogrammed Control
oA control memory on the processor contains
microprograms that activate the necessary
control signals
19
04/05/2025 20
Cont…
Two major types of control organization
Hardwired Control
 The control logic is implemented with gates, decoders, and other
digital circuits,
 Fast operation.
 Wiring change (if the design has to be modified)
Micro programmed Control
 The control information is stored in a control memory, and the
control memory is programmed to initiate the required sequence of
micro operations.
 Any required change can be done by updating the micro program in
control memory.
 Slow operation
04/05/2025
Instruction Cycle
o In the basic computer each instruction
cycle consists:
i. Fetch an instruction from memory
ii. Decode the instruction
iii. Read the effective address from memory if the
instruction has an indirect address.
iv. Execute the instruction.
21
04/05/2025 22
Design of Basic Computer
The basic computer consists of the following hardware
components
1. A memory unit with 4096 words of 16 bits
2. Eight registers: AR, PC, DR, AC, IR, TR, OUTR, INPR
3. Seven F/Fs: I, S, E, R, IEN, FGI, and FGO
4. Two decoder in control unit: 3 x 8 operation decoder, 4
x 16 timing decoder
5. A 16-bit common bus
6. Control Logic Gates:
7. Adder and Logic circuit connected to the AC input
04/05/2025
Input-Output and Interrupts…
o External events can force the computer to quit
the normal program flow to react fast on the
events.
o Such event that requires fast response by the
computer is called interrupt.
o interrupt routine: The collection of
instructions that have to be executed to
respond to the interrupt
o IEN (Interrupt-enable flip-flop)
o can be set and cleared by instructions
o when cleared, the computer cannot be interrupted
23
Questions
04/05/2025 24

Computer organization and architecture chapter 5

  • 1.
    Haramaya University College ofComputing and Informatics Department of Computer Science Computer Organization and Architecture(COA) 04/05/2025 1
  • 2.
    04/05/2025 2 Chapter -5 Basic Computer Organization and Design
  • 3.
    04/05/2025 3 Outline Instruction Codes ComputerRegisters Computer Instructions Timing and Control Design of Basic Computer
  • 4.
    04/05/2025 Instruction Codes o Aprogram is a set of instructions that specify the operations, operands, and the sequence by which processing has to occur. o A computer instruction is a binary code that specifies a sequence of micro- operations for the computer. o An instruction code is a group of bits that instruct the computer to perform a specific operation. 4
  • 5.
    04/05/2025 5 Instruction Codes Theuser of a computer can control the process by means of a program A program is a set of instructions that specify the operations, operand, the sequence(control) An instruction is a binary code that specifies a sequence of micro operations. Instruction codes together with data are stored in memory(Stored Program Concept) Instruction Cycle: The computer reads each instruction from memory and places it in a control register. The control then interprets the binary code of the instruction and proceeds to execute it by issuing a sequence of micro operations.
  • 6.
    04/05/2025 Instruction Codes… o Instructionformat: o Two major components of an instruction code: o The operation code (opcode) o Address o An opcode specifies the operation for the instruction. o An address specifies the registers and/or locations in memory to use for that operation Opcode Fig: Instruction Format 11 0 15 14 I Address 12 Addressing mode 6
  • 7.
    04/05/2025 Instruction Codes… o AddressMode: o The address field of an instruction represents o Direct address: the address in memory of the data to use (the address of the operand) oIndirect address: the address in memory of the address in memory of the data to use 7
  • 8.
    04/05/2025 Basic Computer Registers Fig:Basic Processor registers 8
  • 9.
    04/05/2025 9 Addressing Mode Immediateoperand address: The second part of an instruction code(address field) specifies an operand  Operand is specified in the instruction itself. Direct operand address: The second part of an instruction code specifies the address of an operand Indirect operand address :The bits in the second part of the instruction designate an address of a memory word in which the address of the operand is found one bit of the instruction code is used to distinguish between a direct and an indirect address Effective Address: The operand address in computation- type instruction or the target address in a branch-type instruction
  • 10.
    04/05/2025 10 Computer Registers Basiccomputer registers and memory 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.
  • 11.
    04/05/2025 11 Cont… Program Counter(PC): Hold the address of the next instruction to be read from memory after the current instruction is executed. Instruction words are read and executed in sequence unless a branch instruction is encountered. A branch instruction calls for a transfer to a nonconsecutive instruction in the program. The address part of a branch instruction is transferred to PC to become the address of the next instruction. To read instruction, memory read cycle is initiated, and PC is incremented by one (next instruction fetch)
  • 12.
    04/05/2025 12 Cont… Input Register(INPR): receive an 8-bit character from an input device Output Register(OUTR) : hold an 8-bit character for an output device
  • 13.
    04/05/2025 Basic Computer Registers… Fig:Registers Connected to Common Bus 13
  • 14.
    04/05/2025 14 Cont… Common BusSystem The basic computer has eight registers, a memory unit, and a control unit Paths must be provided to transfer information from one register to another and between memory and registers A more efficient scheme for transferring information in a system with many registers is to use a common bus The connection of the registers and memory of the basic computer to a common bus system
  • 15.
    04/05/2025 Computer Instructions o Thebasic computer has three instruction code formats: 15 011
  • 16.
  • 17.
  • 18.
    04/05/2025 Computer Instructions… o InstructionTypes: o Functional Instructions o Arithmetic, logic, and shift instructions o ADD, CMA, INC, CIR, CIL, AND, CLA o Transfer Instructions oData transfers between the main memory and the processor registers o LDA, STA o Control Instructions oProgram sequencing and control o BUN, BSA, ISZ o Input/Output Instructions oInput and output oINP, OUT 18
  • 19.
    04/05/2025 Timing and Control oControl Unit: o Control units are implemented in one of two ways: o Hardwired Control oCU is made up of sequential and combinational circuits to generate the control signals o Microprogrammed Control oA control memory on the processor contains microprograms that activate the necessary control signals 19
  • 20.
    04/05/2025 20 Cont… Two majortypes of control organization Hardwired Control  The control logic is implemented with gates, decoders, and other digital circuits,  Fast operation.  Wiring change (if the design has to be modified) Micro programmed Control  The control information is stored in a control memory, and the control memory is programmed to initiate the required sequence of micro operations.  Any required change can be done by updating the micro program in control memory.  Slow operation
  • 21.
    04/05/2025 Instruction Cycle o Inthe basic computer each instruction cycle consists: i. Fetch an instruction from memory ii. Decode the instruction iii. Read the effective address from memory if the instruction has an indirect address. iv. Execute the instruction. 21
  • 22.
    04/05/2025 22 Design ofBasic Computer The basic computer consists of the following hardware components 1. A memory unit with 4096 words of 16 bits 2. Eight registers: AR, PC, DR, AC, IR, TR, OUTR, INPR 3. Seven F/Fs: I, S, E, R, IEN, FGI, and FGO 4. Two decoder in control unit: 3 x 8 operation decoder, 4 x 16 timing decoder 5. A 16-bit common bus 6. Control Logic Gates: 7. Adder and Logic circuit connected to the AC input
  • 23.
    04/05/2025 Input-Output and Interrupts… oExternal events can force the computer to quit the normal program flow to react fast on the events. o Such event that requires fast response by the computer is called interrupt. o interrupt routine: The collection of instructions that have to be executed to respond to the interrupt o IEN (Interrupt-enable flip-flop) o can be set and cleared by instructions o when cleared, the computer cannot be interrupted 23
  • 24.