Title: William Stallings Computer Organization and Architecture
1William Stallings Computer Organization and
Architecture
- Chapter 17
- Microprogrammed Control
2Topics
- Basic Concepts
- Microinstruction Sequencing
- Microinstruction Execution
- Applications of Microprogramming
3Microprogrammed Control
- Use sequences of instructions (see earlier notes)
to control complex operations - Called microprogramming or firmware
4Implementation (1)
- All the control unit does is to 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
5Implementation (2)
- Control words are put in a memory (control
memory), with each word having a unique address - Bits are added to specify conditions
- Put everything together
- ? Micro-instruction
6Implementation (3)
- Todays 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
- corresponding to the number of instructions to be
executed - Has a wide word width
- Due to the large number of control points to be
manipulated
7Microprogram Word Length
- Based on 3 factors
- Maximum number of simultaneous micro-operations
supported - The way control information is represented or
encoded - The way in which the next microinstruction
address is specified
8Microinstruction Types
- Horizontal microprogramming
- Each microinstruction specifies many different
micro-operations to be performed in parallel - Vertical microprogramming
- Each microinstruction specifies single (or few)
micro-operations to be performed
9Horizontal Microprogramming
- Wide memory word
- 1 bit for each CPU control line
- 1 bit for each system bus control line
- Condition field indicates branch or not
- Address field for branch target
- High degree of parallel operations possible
- Little encoding of control information
10Horizontal Microprogrammed Diagram
Internal CPU Control Signals
Micro-instruction Address
Jump Condition
System Bus Control Signals
11Horizontal Microprogramming
- Interpretation of a microinstruction
- Turn on/off all control lines indicated by a 1/0
bit - If condition indicated by condition bits is false
then - execute next instruction in sequence
- else
- execute microinstruction indicated in address
field
12Vertical Microprogramming
- Width is narrow
- A code is used for each action to be performed
- E.g., MAR ? (PC)
- 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 - i.e., decoder translates the code into individual
control signals
13Vertical Micro-Programming Diagram
Micro-instruction Address
Function Codes
Jump Condition
14Compromise
- Divide control signals into disjoint groups
- Implement each group as separate field in memory
word - Supports reasonable levels of parallelism without
too much complexity
15Microprogrammed Control Unit
- Key elements
- Control memory
- Store microinstructions
- Control Address Register (CAR)
- Contains address of next microinstruction to be
read - Control Buffer Register (CBR)
- Buffer where a read microinstruction is
transferred to - Left-hand portion connects to control lines
- ? reading a microinstruction ? executing a
microinstruction - Sequencing unit
- Loads CAR and issues a READ
16Control Unit
(A)
(B)
17Control Memory
Jump to Indirect or Execute
Fetch cycle routine
Jump to Execute
Indirect Cycle routine
Jump to Fetch
Interrupt cycle routine
Jump to Op code routine
Execute cycle begin
Jump to Fetch or Interrupt
AND routine
Jump to Fetch or Interrupt
ADD routine
18Control Unit Function
- Decoder (A) translates opcode of IR into a
control memory address - Sequence logic 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 logic loads new address into control
buffer register based on next address information
from control buffer register and ALU flags - Decoder (B) is used for vertical microinstructions
19Advantages and Disadvantages
- Microprogrammed v.s. hardwired
- Simplifies design of control unit
- Cheaper
- Less error-prone
- Slower
- CISC microprogramming
- RISC hardwired
20Tasks Done By Microprogrammed Control Unit
- Microinstruction sequencing
- Get next microinstruction from memory
- Microinstruction execution
- Generate control signals needed to execute the
microinstruction - Must consider both together
21Microinstruction Sequencing
- Two concerns in design considerations
- 1. Size of microinstructions (size? ? cost? )
- 2. Next address generation time (faster ?
better) - Next address
- Determined by instruction register
- Once per instruction cycle, after instruction is
fetched - Next sequential address
- Common in most designed
- Branches
- Both conditional and unconditional
22Sequencing Techniques
- Based on current microinstruction, condition
flags, and contents of IR, control memory address
must be generated - Categories based on format of address information
- Two address fields
- Single address field
- Variable format
23Address Generation Techniques (Optional)
- Explicit Implicit
- Two-field Mapping (from opcode)
- Unconditional Branch Addition (base offset)
- Conditional branch Residual control
(e.g., subroutine)
24Microinstruction Execution
- The microinstruction cycle is the basic event on
a microprogrammed CPU - Each cycle is made up of two events
- Fetch
- Determined by generation of microinstruction
address - Execute
25Execute
- Effect is to generate control signals
- Some control points internal to processor
- Rest go to external control bus or other
interface - Example of microinstruction encoding
- Figure 17.12
26Control Unit Organization
27Applications of Microprogramming (1)
- Realization of computers
- Systematic technique for control unit
implementation - Emulation
- Use of a microprogram on one machine to execute
programs originally written for another - Most common use aiding users in migrating from
one (older) computer to another
28Applications of Microprogramming (2)
- OS support
- Implement primitives to replace important
portions of OS software - ? simplify OS implementation
- improve OS performance
- Realization of special-purpose devices
- e.g., data communication board
- High-level language support
- Micro-diagnostics
- monitoring, detection, isolation, error repair
- User tailoring
29Required Reading