Chapter 5
Chapter 5
Code: SEng3022
Set by :
Molla K.
1
Chapter 5
Basic Computer Organization and Design
2
Out Lines
Instructional Code
Computer Registers
Computer Instructions
Operation part: a group of bits that define such operations as add, subtract,
multiply, shift, and complement.
The user of the computer can control the process by means of a program.
A program is a set of instructions that specify the operations, operands, and the
sequence by which processing has to occur.
Depending on the complexity and the functions a computer may be classified as:
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
Instruction code is usually divided into parts, each having its own particular
interpretation.
9
Cont’d
The collection of different instructions that the processor can execute is referred to as the
The basic computer has three instruction code formats, each format has 16 bits.
The operation code (opcode) part of the instruction contains three bits and the meaning of the
A Memory-Reference Instruction uses 12 bits to specify an address and one bit to specify the
11
Cont’d
Symbol Operation Decoder Symbolic Description
AND D0 AC AC M[AR]
LDA D2 AC M[AR]
STA D3 M[AR] AC
BUN D4 PC AR
and the memory word specified by the effective address. The result of the operation is transferred
D0T4: DR M[AR]
D0T5: AC AC DR, SC 0
The control function for this instruction uses the operation decoder D0 since this output of the
decoder is active when the instruction has an AND operation whose binary code value is 000.
ADD to AC: This instruction adds the content of the memory word specified by effective address
to the value of AC. The sum is transferred into AC and the output carry Cout is transferred into E
D1T4: DR M[AR]
D2T4: DR M[AR]
D2T5: AC DR, SC 0
STA: Store AC: This instruction stores the content of AC into the memory
word specified by the effective address. Since the output of AC is applied to the
bus and the data input of memory is connected to the bus, we can execute this
14
Cont’d
BUN: Branch Unconditionally:
D4T4: PC AR, SC 0
The effective address from AR is transferred through the common bus to PC.
Resetting SC to 0 transfers control to T0.
The next instruction is then fetched and executed from the memory address given by
the new value in PC.
15
Cont’d
BSA: Branch and save Return Address:
This instruction is useful for branching to a portion of the program called subroutine
or procedure.
The effective address plus one is then transferred to PC to serve as the address of the
first instruction in the subroutine.
Timing signal T4 initiates a memory write operation, places the content of PC onto the
bus, and enables the INR input of AR.
The memory write operation is completed and AR is incremented by the time the
next clock transition occurs.
This instruction increments the word specified by the effective address, and if the
incremented value is equal to 0, PC is incremented by 1.
D6T4: DR M[AR]
D6T5: DR DR + 1
D6T6: M[AR] DR, if (DR = 0) then (PC PC + 1), SC 0
17
Computer Instructions
The Register-Reference Instructions are recognized by the operation code 111 with a
15 14 12 11 0
0 111 Register
operation
Input-output Instructions do not need to refer to the memory and are recognized by
The remaining 12 bits are used to specify the type of input-output operations or test
performed.
15 14 12 11 0
18
Instruction Cycle
A program residing in the memory unit of the computer consists of a sequence of instructions.
The program is executed by going through a cycle for each instruction is called fetch decode-
execute cycle.
In the basic computer each instruction cycle consists of the following phases:
o Read the effective address from memory if the instruction has an indirect address
Upon the completion of step 4, the control goes back to step 1 to fetch, decode and
19
Instruction Cycle
Fetch, decode and execute cycle are the three steps that the CPU
repetitively performs to complete one program instruction.
20
Instruction Cycle
A computer program comprises a series of program statements, also known as
program instructions.
Each program instruction accomplishes a specific task.
The program instructions are binary machine instructions that the CPU can
directly execute.
The operating system loads the machine instructions into the main memory RAM
to begin program execution.
In the instruction cycle, the essential operation of the CPU is the time required to
execute and fetch a complete instruction.
21
Instruction Cycle
The instruction cycle comprises three main stages and is also addressed as the fetch-
decode-execute cycle or fetch-execute cycle because of the steps involved. They are as
follows:
1. Fetch stage
2. Decode stage
3. Execute stage.
Fetch, decode and execute cycle are the three steps that the CPU repetitively performs
to complete one program instruction.
Decode
The instruction needs to be decoded. It is sent via the data bus to the control unit,
where it is split into two parts.
The first part is the operation code or opcode, which in this example CPU is the first
four bits. This is the command that the computer will carry out.
The second part, in this case the second four bits, is the operand.
22
This is an address in RAM where data will be read from or written to, depending on the operation
Instruction Cycle
23
Cont’
24
Timing and Control
Timing refers to the way in which actions are coordinated on the bus .
The clock pulses are applied to all flip-flops and registers in the system,
a sequence of micro-operations.
25
Cont’d
The CU is a component of a cpu that interprets program instruction and
generates control signals that direct other parts of the computer to perform
specific micro operation necessary to execute those instruction.
The timing and control unit is the component that determines what the
Hardwired control
Microprogrammed control
26
Cont’d
1. Hardwired Control: The control logic is implemented with
changed.
27
Cont’d
29
Cont’d
2. Microprogrammed Control: Control information is stored in a control
memory.
A control memory on the processor contains micro programs that activate the
necessary control signals.
A. The control inputs of the registers LD, INR, CLR must be known
B. The bus system must have control inputs to determine which component
to select
C. The current instruction must be decoded to determine what is to be done.
30
Cont’d
Control
gates
32
Cont’d
Circuits associated with AC 16
Adder and
16 16 16
From DR logic AC
circuit To bus
From INPR 8
Control
gates
33
Design of Basic Computer
The basic computer consists of the following hardware components;
Nine registers: AR, PC, DR, AC, IR, TR, OUTR, INPR, and SC
The memory unit is the standard component that can be obtained readily from a
commercial source.
34
Design of Basic Computer
35
Thank You!!!
Any Questions ?
36