CS125-Ch04-Part1 - Tagged
CS125-Ch04-Part1 - Tagged
Chapter#04
• Many registers
3
Introduction
4
The Basic Computer
5
Instruction Codes
• Program: A sequence of (machine) instructions
• (Machine) Instruction: A group of bits that tell the computer to
perform a specific operation (a sequence of micro-operations)
• The instructions of a program, along with any needed data are
stored in memory
• The CPU reads the next instruction from memory and
placed it in an Instruction Register (IR)
• Control circuitry in control unit then translates the
instruction into the sequence of micro-operations necessary
to implement it.
• There are many variations for arranging binary code of
instructions.
• Each computer has its own particular instruction code
format. 6
Instruction Codes
7
Instruction Codes
• The control unit received the instruction from the memory and
interpret the operation code bits. It then issues a sequence of
control signals to initiate the right microoperations necessary
for the operation.
8
Instruction Codes
2. Operand (address)
• The operation part of instruction code is performed on some
data stored in memory or register.
• The operand part of an instruction specifies the location of this
data (address).
• It must also specify the location where the result must be
stored.
• Memory words can be specified in instruction codes by their
address.
• Processor registers can be specified by assigning to the
instruction another binary code of k bits that specify one of the
registers.
9
Instruction Codes
Stored Program Organization:
• Instructions are stored in one section of memory and data in the another.
• In the Basic Computer, since the memory contains 4096 (212) words we
needs 12 bits to specify which memory address this instruction will use.
11
Addressing Modes
12
Basic Computer Registers
15
Basic Computer Registers
11 0
PC
Memory
11 0 4096 words
AR 16 bits per word
1 0
5
IR
CPU
1 0 15 0
5
TR DR
16
15
Common Bus System
17
Common Bus System s0 s1 s2
Bus
Memory Unit
7
4096x16 Address
WRITE READ
AR 1
LD INR CLR
PC 2
LD INR CLR
DR 3
LD
INR CLR
E
ALU AC 4
LD INR CLR
INPR
IR 5
LD
TR 6
LD INR CLR
OUTR
Clock
LD
L I L I L
C C
L IC DR IR L I C
PC TR
AR OUTR L
L I
C
7 1 2 3 5 6
4
S0 S1 S2
16-bit
19
Common Bus
Common Bus System
• Three control lines, S2, S1, and S0 control which register the
bus selects as its input
S2 S1 S0 Register
0 0 0 x
0 0 1 AR
0 1 0 PC
0 1 1 DR
1 0 0 AC
1 0 1 IR
1 1 0 TR
1 1 1 Memory
• Either one of the registers will have its load signal activated,
or the memory will have its write signal activated
• Will determine where the data from the bus gets
loaded 20
Common Bus System
• The 12-bit registers, AR and PC, have 0’s loaded onto the bus
in the high order 4 bit positions
12 bits
21
Basic Computer Instructions
Three Instruction Code Formats:
Memory-Reference Instructions (OP-Code = 000 ~ 110)
15 14 12 11 0
I Op-Code Address
26
Timing Signals
cleared. T1
T3
T0, T1, . . .
T4
• Assume: At time T4, SC is
D3
cleared to 0 if decoder output
CLR
D3 is active. SC
• D3T4: SC ← 0
27