Lecture 2.3 & Lecture 3.1 the Control Unit & ISA
Lecture 2.3 & Lecture 3.1 the Control Unit & ISA
–Lecture 3
oThe Control
Unit
CONTROL UNIT
Generate relevant timing and control signals to all operations
in the computer.
– The control signals generated by the control unit cause the opening and
closing of logic gates, resulting in the transfer of data to and from
registers and the operation of the ALU.
Control units are implemented in one of two ways the hardwired
and Micro programmed Control unit.
Hardwired - is made up of sequential and combinational circuits to
generate the control signals.
Its input logic signals, governed by the current machine
instruction, are transferred into a set of output control signals. 2
TIMING AND
CONTROL
Control unit of Basic Computer
Instruction register (IR)
15 14 13 12 11 - 0 Other inputs
3x8
decoder
7 6543 210
D0
I Combinational
D7 Control Control
logic signals
T15
T0
15 14 . . . . 2 1 0
4 x 16
decoder
IR LD
CPU bus
AR LD
Address bus
Timing and Control
• Step 3: How do we decode the instruction intention (ie.
NOTE:
meaning, operational definition) at T2?
All instructions share the
– The OpCode,
steps T0, T1 Mode
and T2.and Address field bits all serve as inputs
toHowever,
the Control Logic on
depending Gates that select the specific instruction
semantics
what each specific
instruction requires, the
• Direct addressing
control logic for higher time
• Indirect
steps is moreaddressing
complicated,
•requiring
CPU register
moreaddressing
inputs.
• Input
• Output
S0
Memory
7
unit
Address
Read
AR 1
LD
PC 2
INR
IR 5
LD Clock 7
Common bus
Basic Computer Organization & Design 8 Instrction Cycle
T0
AR PC
T1
IR M[AR], PC PC + 1
T2
Decode Opcode in IR(12-14),
AR IR(0-11), I IR(15)
T3 T3 T3 T3
Execute Execute AR M[AR] Nothing
input-output register-reference
instruction instruction
SC 0 SC 0 Execute T4
memory-reference
instruction
SC 0
D'7IT3: AR M[AR]
D'7I'T3: Nothing
D7I'T3: Execute a register-reference instr.
D7IT3: Execute an input-output instr.
Computer Organization Computer Architectures Lab
MR Instructions
D6T4: DR M[AR]
D6T5: DR DR + 1
D6T4: M[AR] DR, if (DR = 0) then (PC PC + 1),SC
0
CENTRAL
PROCESSING UNT
STRUCTURE
ECEg3148 12/09/2024
13 Lecture Outline
• CPU Instruction Set
Architectures
•Instruction Formats
12/09/2024
An Instruction Set
An Instruction Sets.
Serves as an interface between software and hardware.
Provides a mechanism by which the software tells the
hardware what should be done.
Instruction Set Design
One important design factor is the number of
operands contained in each instruction
Has a significant impact on the word size and complexity of
theE.CPU
Joanne DeGroat, OSU
Instruction Set Design
Consider how many operands we need for an ADD
instruction
If we want to add the contents of two memory locations
together, then we need to be able to handle at least two
memory addresses
Where does the result of the add go? We need a third
operand to specify the destination
General Other
Purpose Stack
ALU
ALU
AC Registers ALU
Registers
Registers
memory
Joanne E. DeGroat, OSU memory
acc = acc + mem[C] R1 = R1 + mem[C] R3 = R1 + R2
NUMBER OF ADDRESSES
19
Program to evaluate X = (A + B) * (C + D) :
ADD R1, A, B /* R1 M[A] + M[B]
*/
ADD R2, C, D /* R2 M[C] + M[D]
*/
MUL X, R1, R2 /* M[X] R1 * R2
*/
Program to evaluate X = (A + B) * (C + D) :
LOAD A /* AC M[A] */
ADD B /* AC AC + M[B] */
STORE T /* M[T] AC */
LOAD C /* AC M[C] */
ADD D /* AC AC + M[D] */
MUL T /* AC AC * M[T] */
STORE X /* M[X] AC */
Program to evaluate X = (A + B) * (C + D) :