Control Unit
Control Unit
1
Basic Elements of Processor
• ALU
• Registers
• Internal data paths
• External data paths
• Control Unit
A Simple Computer & its Control Unit
Instruction Micro-Operations
• Clock
— One micro-instruction (or set of parallel micro-
instructions) per clock cycle
• Instruction register
— Op-code for current instruction
— Determines which micro-instructions are performed
• Flags
— State of CPU
— Results of previous operations
Fetch Cycle:
t1: MAR (PC)
t2: MBR (memory)
PC (PC) +1
t3: IR (MBR)
Fetch Cycle
• Let Tx be the time unit of the clock. Then:
t1: MAR (PC)
t2: MBR (memory)
PC (PC) +1
t3: IR (MBR)
Execute: BSA X (Branch and Save Address) • BSA X - Branch and save address
Address of instruction following
t1: MAR (IRaddress)
BSA
MBR (PC) is saved in X
t2: PC (IRaddress)
• Execution continues from X+1
memory (MBR)
t3: PC (PC) + 1
Control Signals
Control Unit with Decoded Inputs
Internal Organization
• Usually a single internal bus
• Gates control movement of data onto and
off the bus
• Control signals control data transfer to
and from external systems bus
• Temporary registers needed for proper
operation of ALU
Hard Wired Control Unit
• The Cycles (Fetch, Indirect, Execute,
Interrupt) are constructed as a State
Machine
State Machine
Storage
Clock Elements
State Diagram
Inputs
Outputs
Next States
Master-slave
flipflops
Problems With Hard Wired Designs
28
Control Unit Organization
Microinstructions:
• Generate Control Signals
• Provide Branching
• Do both
Typical Microinstruction Formats
Horizontal vs Vertical Microprogramming
Horizontal Microprogrammed
— Unpacked
— Hard
— Direct
Vertical Microprogrammed
— Packed
— Soft
— Indirect
Microinstruction Encoding
Direct Encoding
Microinstruction Encoding
Indirect Encoding
Horizontal Micro-programming
• Fast
Vertical Micro-programming
• Width can be much narrower
• Slower
Typical Microinstruction Formats
Next Address Decision
• Depending on ALU flags and control buffer
register:
—Get next instruction
– Add 1 to control address register
Advantage:
• Simplifies design of control unit
— Cheaper
— Less error-prone
— Easier to modify
Disadvantage:
• Slower
Design Considerations
• Necessity of speed
• Size of microinstructions
• Address generation
—Branches
– Both conditional and unconditional
Explicit Implicit
Two-field Mapping