Chapter 5
Chapter 5
Chapter 5
1
Outlines
Instructional Code
Computer Registers
Computer Instructions
Instruction cycle
It contains
Many registers
This is similar to what real processors were like ~25 years ago
The memory has 4096 words in it –4096 = 212, so it takes 12 bits to select
a word in memory
5
Instructional Codes
The Internal organization of a digital system is defined by the
sequence of microoperations it performs on data stored in its
registers
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,
operands, and the processing sequence
A computer instruction is a binary code that specifies a sequence of
micro-operations for the computer
Each computer has its unique instruction set
6
Instructional Codes….
Instruction codes and data are stored in memory
control register
The control unit interprets the binary code of the instruction and
7
Instructional Codes….
The operation code of an instruction is a group of bits that
microoperations
8
Instructional Codes….
An operation must be performed on some data stored in processor
registers or in memory
but also the location of the operands (in registers or in the memory),
and where the result will be stored (registers/memory)
9
Instructional Codes….
Each computer has its own particular instruction code format
11
Instructional Codes….
Indirect Address
There are three Addressing Modes used for address
portion of the instruction code:
Immediate: the operand is given in the address portion (constant)
300 1350
457 Operand
1350 Operand
+ +
AC AC
13
Instructional Codes….
14
Computer registers
Computer instructions are normally stored in consecutive memory
locations and executed sequentially one at a time
The control reads an instruction from a specific address in memory and
executes it, and so on
This type of sequencing needs a counter to calculate the address of the
next instruction after execution of the current instruction is completed
It is also necessary to provide a register in the control unit for storing the
instruction code after it is read from memory
The computer needs processor registers for manipulating data and a
register for holding a memory address
15
Computer registers……
These requirement dictate the following requirement
16
Computer registers….
Data Register(DR) : hold the operand(Data) read from memory
The basic computer has 8 registers, a memory unit, and a control unit
The outputs of 8 registers and memory are connected to the common bus
18
Computer registers….
19
Computer Instructions
The basic computer has three instruction codes formats
20
Computer Instructions…
21
Computer Instructions…
Instruction Set Completeness
The set of instructions are said to be complete if the computer
includes a sufficient number of instructions in each of the
following categories
Arithmetic, Logical, and shift : CMA, INC, ..
Clock pulses
The timing for all registers in the basic computer is controlled by a master
clock generator
The clock pulses do not change the state of register unless the register is
23
Timing and Control….
Major types of control organization
✓ Hardwired control
modified)
✓ Microprogrammed control
25
Timing and Control….
Example: Register transfer statement: T0: AR ←PC
26
Instruction cycle
In Basic Computer, a machine instruction is executed in the following
cycle:
1. Fetch an instruction from memory
2. Decode the instruction
3. Read the effective address from memory if the instruction has an
indirect address
4. Execute the instruction
After an instruction is executed, the cycle starts again at step 1, for the
next instruction
27
Instruction cycle….
Instruction fetch
Initially, PC is loaded with the address of the first instruction and SC is
cleared to 0
T0: AR PC
Place the content of PC onto the bus by making the bus selection
inputs
Transfer the content of the bus to AR by enabling the LD input of AR
T1: IR M [AR], PC PC + 1
) Enable the read input memory
Place the content of memory onto the bus by making S2S1S0= 111
Transfer the content of the bus to IR by enable the LD input of IR
Increment PC by enabling the INR input of PC
Decode Instruction
28 T : D0, . . . , D7 Decode IR(12-14), AR IR(0-11) , I IR(15)
2
Instruction cycle….
29
Instruction fetch
Instruction cycle….
Decode IR(12-14)
D7=1: regester or Input/output instruction
D7=0: memory reference instruction
I IR(15)
Register or input/output instruction
I=0: register instruction:
I=1: input/output instruction
32
Flow chart for instruction cycle
Design of Basic Computer
ϗ The basic computer consists of the following components
2. Nine registers : AR, PC, DR, AC, IR, TR, OUTR, INPR, SC
33
Design of Basic Computer…..
Control Logic Gates
ϗ Signals for S2, S1, and S0 to select a register for the bus
34
Design of Accumulator logic
35
Design of Accumulator logic
• Find the statement that change the AC:AC ?
36
AC(Accumulator) control
Design of ALU
37
Adder and logic circuit
?
Many thanks!!!
38