Control Unit

advertisement
William Stallings
Computer Organization
and Architecture
Chapter 15
Micro-programmed Control
微程序控制
15.1 Basic Concepts
• 1951 Wilkes
• 1964.4 IBM 360
• Use sequences of instructions to control
complex operations
Called micro-programming or firmware
微程序
固件
1. Microinstructions
• Microprogramming 微程序
• Microinstructions 微指令
Implementation (1)
• All the control unit does is generate a set of
control signals
• Each control signal is on or off
• Represent each control signal by a bit
• Have a control word for each micro-operation
• Have a sequence of control words for each
machine code instruction
• Add an address to specify the next microinstruction, depending on conditions
Implementation (2)
• Today’s large microprocessor
• Many instructions and associated register-level
hardware
• Many control points to be manipulated
• This results in control memory 控制存储器that
• Contains a large number of words (p581)
coresponding to the number of instructions to
be executed
• Has a wide word width
Due to the large number of control points to
be manipulated
Micro-instruction Word Length
• Based on 3 factors
o Maximum number of simultaneous microoperations supported 同时执行的微操作数
o The way control information is represented or
encoded 微指令表示形式
o The way in which the next micro-instruction
address is specified 下址表示形式
Micro-instruction Types
微指令类型
• Each micro-instruction specifies single (or
few) micro-operations to be performed
(vertical micro-instruction) 垂直
• Each micro-instruction specifies many
different micro-operations to be
performed in parallel
(horizontal micro- instruction) 水平
Vertical Micro- instruction
垂直微指令
•
•
•
•
Width is narrow
n control signals encoded into log2 n bits
Limited ability to express parallelism
Considerable encoding of control
information requires external memory
word decoder to identify the exact control
line being manipulated
Vertical Micro- instruction diag
Micro-instruction Address
Function Codes
Jump
Condition
Horizontal Micro- instruction
水平微指令
• Wide memory word
• High degree of parallel operations possible
• Little encoding of control information
Horizontal Micro- instruction diag
Internal CPU Control Signals
System Bus
Control Signals
Micro-instruction Address
Jump Condition
Compromise 折衷 / 混合型
• Divide control signals into disjoint groups
• Implement each group as separate field in
memory word
• Supports reasonable levels of parallelism
without too much complexity
Micro-instruction Address
Control Memory 控制存储器
.
Jump to Indirect or Execute
.
Jump to Execute
.
Jump to Fetch
Jump to Op code routine
.
Jump to Fetch or Interrupt
.
Jump to Fetch or Interrupt
Fetch cycle routine
Indirect Cycle routine
Interrupt cycle routine
Execute cycle begin
AND routine
ADD routine
2. Control Unit
• Sequence login unit issues
控制单元
read command
• Word specified in control
address register is read into
control buffer register
• Control buffer register
contents generates control
signals and next address
information
• Sequence login loads new
address into control buffer
register based on next
address information from
control buffer register and
ALU flags
Control Unit Function控制单元功能
• Sequence login unit issues read command
• Word specified in control address register is read
into control buffer register
• Control buffer register contents generates control
signals and next address information
• Sequence login loads new address into control
buffer register based on next address information
from control buffer register and ALU flags
Advantages and Disadvantages
微程序控制优缺点
• Simplifies design of control unit
• Cheaper
便宜
• Less error-prone 不易出错
• Slower 速度慢
Tasks Done By Microprogrammed
Control Unit 微程序控制单元任务
• Microinstruction sequencing
微指令排序
• Microinstruction execution
微指令执行
• Must consider both together
Design Considerations
• Size of microinstructions 微指令大小
• Address generation time 地址生成时间
• Determined by instruction register 指令寄存器定
Once per cycle, after instruction is fetched
• Next sequential address 下一顺序地址
Common in most designed
• Branches 转移
Both conditional and unconditional
15.2 Sequencing Techniques
排序技术
• Based on current microinstruction,
condition flags, contents of IR, control
memory address must be generated
• Based on format of address information
o Two address fields 双地址字段/场 P589
o Single address field 单地址字段
P590
o Variable format
可变格式 (略)
Address Generation
Explicit
• Two-field
• Unconditional Branch
• Conditional branch
control
Implicit
Mapping
Addition
Residual
15.3 Execution 微指令执行
• The cycle is the basic event
• Each cycle is made up of two events
• Fetch 取指
Determined by generation of microinstruction
address
• Execute 执行
Execute
• Effect is to generate control signals
• Some control points internal to processor
Rest go to external control bus or other
interface
Control Unit Organization
Required Reading
• Stallings chapter 15
Homework
• P617
15.7
Download