Computer Instructions
• The basic computer has three instruction code formats.
• Each format has 16 bits.
• The operation code(op-code) part of the instruction contains three bits and
the meaning of remaining 13 bits depends upon the op-code encountered.
The Computer: Top-Level Structure
CPU
Main
Memory
System
Bus
I/O
COMPUTER
Control
Unit
ALU
Internal
Bus
Register
CPU
Control Unit
Registers and
Decoders
Sequencing
Logic
Control Unit
Control
Memory
Internal Block Diagram of a CPU
Internal Block Diagram of a CPU
Control Unit
The function of control unit is to generate relevant timing and control signals to all
operations in the computer.
Control Unit is “the brain within the brain”.
It controls the flow of data between the processor and memory and peripherals.
The examples of devices that require a control unit are CPUs and graphics
processing units (GPUs).
Control Unit
The control unit directs the entire computer system to carry out stored
program instructions.
The control unit must communicate with both the arithmetic logic unit (ALU)
and main memory.
The control unit instructs the arithmetic logic unit that which logical or
arithmetic operation is to be performed.
The control unit co-ordinates the activities of the other two units as well as all
peripherals and auxiliary storage devices linked to the computer
Control Unit Organization
Control unit generates control signals using one of the two organizations:
Hardwired Control Unit.
Micro-programmed Control Unit.
Control unit consist of a:
 Instruction Register
 Number of Control Logic Gates,
 Two Decoders
 4-bit Sequence Counter
Control Unit
 Hardwired control units are implemented through use of sequential
logic units or circuits like gates , fliflops , decoders in hardware.
 Hardwired control units are generally faster than micro-programmed
designs.
This architecture is preferred in reduced instruction set computers (RISC)
as they use a simpler instruction set.
The hardwired approach has become less popular as computers have evolved as at
one time, control units for CPUs were ad-hoc logic, and they were difficult to
design.
Control Unit
Advantages
Hardwired Control Unit is fast
because control signals are generated
by combinational circuits.
The delay in generation of control
signals depends upon the number
of gates.
The performances is high as
compared to micro-programmed
control unit.
Disadvantages
The control signals required by the
CPU will be more complex
Modifications in control signal are
very difficult. That means it requires
rearranging of wires in the
hardware circuit.
 It is difficult to correct mistake in
original design or adding new
features in existing design of
control unit.
Control Unit of Basic Computer
11 - 0
14 13 12
15
3× 8
Decoder
7 6 5 4 3 2 1 0
Control
Logic Gates
Other Inputs
Control
Outputs
I
.
.
.
4-Bit Sequence
Counter (SC)
Increment (INR)
Clear (CLR)
Clock
15 14 .... 2 1 0
. . .
.
.
.
T0
T15
D0
T0
D7
4× 16
Decoder
Instruction Register (IR)
Control Timing Signals
Control Timing Signals
Instruction Cycle
• A program residing in the memory unit of the computer consists of a
sequence of instructions.
• The program is executed in the computer by going thru a cycle for each
instruction.
• In basic computer, each instruction cycle consists of the following phases:
1. Fetch an instruction from memory.
2. Decode the instruction.
3. Read the effective address from memory.
4. Execute the instruction.
Flow chart for Instruction Cycle Initial Configuration
T0
T1
PC
AR
Decode operation code in IR (12-14)
T2
Fetch
PC+1
PC
IR(15)
I
IR (0-11) ,
AR
D7
I
I
= 0 (Memory Reference)
Register or I/O 1 =
= 0 (Register)
(I/O) 1 =
Nothing
= 0 (Direct)
(Indirect) 1 =
T3
T3
T3 T3
M[AR]
IR
M[AR]
AR
Execute Reg. Ref. Ins.
SC 0
Execute Mem. Ref. Ins.
SC 0
Decode
Decision
Execute I/O Ref. Ins.
SC 0
Execution
SC 0
Start
Microoperations for fetch and Decode
Microprogrammed Control Unit
 The idea of microprogramming was introduced by Maurice Wilkes in 1951.
 Micro-programs were organized as a sequence of microinstructions and
stored in special control memory.
 The main advantage of the micro-program control unit is the simplicity of
its structure.
 Outputs of the controller are organized in microinstructions and they
can be easily replaced
 A micro-programmed control unit is implemented using programming
approach. A sequence of micro operations are carried out by executing a
program consisting of micro-instructions.
 Micro-program, consisting of micro-instructions is stored in the
control memory of the control unit.
 Execution of a micro-instruction is responsible for generation of a set
of control signals.
Microprogrammed Control Unit

Control Unit and Instruction Cycle.pptx.

  • 1.
    Computer Instructions • Thebasic computer has three instruction code formats. • Each format has 16 bits. • The operation code(op-code) part of the instruction contains three bits and the meaning of remaining 13 bits depends upon the op-code encountered.
  • 2.
    The Computer: Top-LevelStructure CPU Main Memory System Bus I/O COMPUTER Control Unit ALU Internal Bus Register CPU Control Unit Registers and Decoders Sequencing Logic Control Unit Control Memory
  • 3.
  • 4.
  • 5.
    Control Unit The functionof control unit is to generate relevant timing and control signals to all operations in the computer. Control Unit is “the brain within the brain”. It controls the flow of data between the processor and memory and peripherals. The examples of devices that require a control unit are CPUs and graphics processing units (GPUs).
  • 6.
    Control Unit The controlunit directs the entire computer system to carry out stored program instructions. The control unit must communicate with both the arithmetic logic unit (ALU) and main memory. The control unit instructs the arithmetic logic unit that which logical or arithmetic operation is to be performed. The control unit co-ordinates the activities of the other two units as well as all peripherals and auxiliary storage devices linked to the computer
  • 7.
    Control Unit Organization Controlunit generates control signals using one of the two organizations: Hardwired Control Unit. Micro-programmed Control Unit. Control unit consist of a:  Instruction Register  Number of Control Logic Gates,  Two Decoders  4-bit Sequence Counter
  • 8.
    Control Unit  Hardwiredcontrol units are implemented through use of sequential logic units or circuits like gates , fliflops , decoders in hardware.  Hardwired control units are generally faster than micro-programmed designs. This architecture is preferred in reduced instruction set computers (RISC) as they use a simpler instruction set. The hardwired approach has become less popular as computers have evolved as at one time, control units for CPUs were ad-hoc logic, and they were difficult to design.
  • 9.
    Control Unit Advantages Hardwired ControlUnit is fast because control signals are generated by combinational circuits. The delay in generation of control signals depends upon the number of gates. The performances is high as compared to micro-programmed control unit. Disadvantages The control signals required by the CPU will be more complex Modifications in control signal are very difficult. That means it requires rearranging of wires in the hardware circuit.  It is difficult to correct mistake in original design or adding new features in existing design of control unit.
  • 10.
    Control Unit ofBasic Computer 11 - 0 14 13 12 15 3× 8 Decoder 7 6 5 4 3 2 1 0 Control Logic Gates Other Inputs Control Outputs I . . . 4-Bit Sequence Counter (SC) Increment (INR) Clear (CLR) Clock 15 14 .... 2 1 0 . . . . . . T0 T15 D0 T0 D7 4× 16 Decoder Instruction Register (IR)
  • 11.
  • 12.
  • 13.
    Instruction Cycle • Aprogram residing in the memory unit of the computer consists of a sequence of instructions. • The program is executed in the computer by going thru a cycle for each instruction. • In basic computer, each instruction cycle consists of the following phases: 1. Fetch an instruction from memory. 2. Decode the instruction. 3. Read the effective address from memory. 4. Execute the instruction.
  • 14.
    Flow chart forInstruction Cycle Initial Configuration T0 T1 PC AR Decode operation code in IR (12-14) T2 Fetch PC+1 PC IR(15) I IR (0-11) , AR D7 I I = 0 (Memory Reference) Register or I/O 1 = = 0 (Register) (I/O) 1 = Nothing = 0 (Direct) (Indirect) 1 = T3 T3 T3 T3 M[AR] IR M[AR] AR Execute Reg. Ref. Ins. SC 0 Execute Mem. Ref. Ins. SC 0 Decode Decision Execute I/O Ref. Ins. SC 0 Execution SC 0 Start
  • 15.
  • 16.
    Microprogrammed Control Unit The idea of microprogramming was introduced by Maurice Wilkes in 1951.  Micro-programs were organized as a sequence of microinstructions and stored in special control memory.  The main advantage of the micro-program control unit is the simplicity of its structure.  Outputs of the controller are organized in microinstructions and they can be easily replaced  A micro-programmed control unit is implemented using programming approach. A sequence of micro operations are carried out by executing a program consisting of micro-instructions.  Micro-program, consisting of micro-instructions is stored in the control memory of the control unit.  Execution of a micro-instruction is responsible for generation of a set of control signals.
  • 17.