Chapter 20 - Microprogrammed Control (9 th edition)

Similar documents
Microprogrammed Control

Micro-Operations. execution of a sequence of steps, i.e., cycles

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 16 Micro-programmed Control

Chapter 16. Control Unit Operation. Yonsei University

Class Notes. Dr.C.N.Zhang. Department of Computer Science. University of Regina. Regina, SK, Canada, S4S 0A2

William Stallings Computer Organization and Architecture 8 th Edition. Micro-programmed Control

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015


Processing Unit CS206T

Module 5 - CPU Design

Chapter 17. Microprogrammed Control. Yonsei University

Advanced Computer Architecture

Digital System Design Using Verilog. - Processing Unit Design

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit

William Stallings Computer Organization and Architecture

Chapter 3 : Control Unit

4. MICROPROGRAMMED COMPUTERS

Micro-programmed Control Ch 15

Machine Instructions vs. Micro-instructions. Micro-programmed Control Ch 15. Machine Instructions vs. Micro-instructions (2) Hardwired Control (4)

Micro-programmed Control Ch 15

Computer Logic II CCE 2010

Basic Processing Unit: Some Fundamental Concepts, Execution of a. Complete Instruction, Multiple Bus Organization, Hard-wired Control,

Micro-programmed Control Ch 17

Chapter 05: Basic Processing Units Control Unit Design. Lesson 15: Microinstructions

Chapter 3 - Top Level View of Computer Function

Hardwired Control (4) Micro-programmed Control Ch 17. Micro-programmed Control (3) Machine Instructions vs. Micro-instructions

SCRAM Introduction. Philipp Koehn. 19 February 2018

MICROPROGRAMMED CONTROL

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Chapter 5. Computer Architecture Organization and Design. Computer System Architecture Database Lab, SANGJI University

CONTROL UNIT CONTROL UNIT. CONTROL vs DATA PATH. Instruction Sequencing. Two main operations of Control Unit can be identified:

Microprogramming is a technique to implement the control system of a CPU using a control store to hold the microoperations.

There are four registers involved in the fetch cycle: MAR, MBR, PC, and IR.

Lecture 10: Control Unit

Lecture 10: Control Unit

Chapter 14 - Processor Structure and Function

Blog -


Control unit. Input/output devices provide a means for us to make use of a computer system. Computer System. Computer.

Computer Architecture

Chapter 5 - Input / Output

Chapter 18 - Multicore Computers

Chapter 4. MARIE: An Introduction to a Simple Computer

CPU Structure and Function

Processing Unit. Unit II

THE MICROPROCESSOR Von Neumann s Architecture Model

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

UNIT- 5. Chapter 12 Processor Structure and Function

Introduction to CPU Design

William Stallings Computer Organization and Architecture. Chapter 11 CPU Structure and Function

AS/A Level Computing Syllabus 2011

Controller Implementation--Part II

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics

Materials: 1. Projectable Version of Diagrams 2. MIPS Simulation 3. Code for Lab 5 - part 1 to demonstrate using microprogramming

MARIE: An Introduction to a Simple Computer

Blog -

Chapter 10 - Computer Arithmetic

Introduction to CPU architecture using the M6800 microprocessor

Materials: 1. Projectable Version of Diagrams 2. MIPS Simulation 3. Code for Lab 5 - part 1 to demonstrate using microprogramming

Faculty of Engineering Systems & Biomedical Dept. First Year Cairo University Sheet 6 Computer I

MARIE: An Introduction to a Simple Computer

5-1 Instruction Codes

UNIT 3 - Basic Processing Unit

Unit 1. Chapter 3 Top Level View of Computer Function and Interconnection

Systems Architecture

Chapter 1 : Introduction

PESIT Bangalore South Campus

1. Fundamental Concepts

The register set differs from one computer architecture to another. It is usually a combination of general-purpose and special purpose registers

COMPUTER ORGANIZATION AND ARCHITECTURE

Fig: Computer memory with Program, data, and Stack. Blog - NEC (Autonomous) 1

Major and Minor States

CPU ARCHITECTURE. QUESTION 1 Explain how the width of the data bus and system clock speed affect the performance of a computer system.

Computer Architecture Programming the Basic Computer

CHAPTER SIX BASIC COMPUTER ORGANIZATION AND DESIGN

Tutorial 4 KE What are the differences among sequential access, direct access, and random access?

Unit 8 - Week 7: Organization and Optimization of Micro-programmed Controlled Control Unit

Computer Organization II CMSC 3833 Lecture 33

Microprogramming. Bởi: Hoang Lan Nguyen. - Controller the data to move from one register to another

PROBLEMS. 7.1 Why is the Wait-for-Memory-Function-Completed step needed when reading from or writing to the main memory?

Chapter 5: Computer Systems Organization

Chapter 5: Computer Systems Organization. Invitation to Computer Science, C++ Version, Third Edition

SISTEMI EMBEDDED. Computer Organization Central Processing Unit (CPU) Federico Baronti Last version:

CPU Structure and Function

Chapter 4. Chapter 4 Objectives. MARIE: An Introduction to a Simple Computer

Chapter 4 The Von Neumann Model

Register-Level Design

Basics of Microprocessor

Chapter 4. MARIE: An Introduction to a Simple Computer 4.8 MARIE 4.8 MARIE A Discussion on Decoding

Objective now How are such control statements registers and other components Managed to ensure proper execution of each instruction

Computer Organization Control Unit. Department of Computer Science Missouri University of Science & Technology

CHAPTER 5 Basic Organization and Design Outline Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle

MC9211Computer Organization. Unit 4 Lesson 1 Processor Design

Microprocessors/Microcontrollers

COMPUTER STRUCTURE AND ORGANIZATION

structural RTL for mov ra, rb Answer:- (Page 164) Virtualians Social Network Prepared by: Irfan Khan

b) Write basic performance equation.

Running Applications

Implementing the Control. Simple Questions

EE 3170 Microcontroller Applications

Transcription:

Chapter 20 - Microprogrammed Control (9 th edition) Luis Tarrataca luis.tarrataca@gmail.com CEFET-RJ L. Tarrataca Chapter 20 - Microprogrammed Control 1 / 47

Table of Contents I 1 Motivation 2 Basic Concepts Microinstructions Microprogrammed Control Unit Advantages and Disadvantages µ-instruction sequencing Two address fields Two address fields Variable Format µ-instruction Execution L. Tarrataca Chapter 20 - Microprogrammed Control 2 / 47

Table of Contents I 3 Where to focus your study 4 Where to focus your study L. Tarrataca Chapter 20 - Microprogrammed Control 3 / 47

Motivation Motivation Remember what we talked about in the last class? L. Tarrataca Chapter 20 - Microprogrammed Control 4 / 47

Motivation Remember what we talked about in the last class? µ-operations - the most basic instruction executed by a processor: Control signals - to send data from the various locations; Control unit operation - how to control signals and micro-operations. L. Tarrataca Chapter 20 - Microprogrammed Control 5 / 47

Motivation We saw that it was possible to operate the control unit through: An hardwired version: Complete boolean circuit; Difficult to implement for complex systems. Impossible to add an instruction after implementing the circuit. So what is the alternative? Any ideas? L. Tarrataca Chapter 20 - Microprogrammed Control 6 / 47

Motivation Alternative: µ-programmed control unit The logic of the control unit is specified by a microprogram; Also known as firmware. A microprogram consists of a sequence ofµ-operations. L. Tarrataca Chapter 20 - Microprogrammed Control 7 / 47

Microinstructions Microinstructions How can we use the concept of microprogramming to implement a control unit? For eachµ-operation: Control unit is allowed to generate a set of control signals; Each control line is either on / off; This state can be represented by a binary digit for each control line. L. Tarrataca Chapter 20 - Microprogrammed Control 8 / 47

Microinstructions Idea: construct a control word (a.k.a. µ-instruction) Bit represents one control line Eachµ-op would be represented by a different pattern of 1s and 0s. L. Tarrataca Chapter 20 - Microprogrammed Control 9 / 47

Microinstructions Format of theµ-instruction or control word is as follows: Figure: Microinstruction (Source: [Stallings, 2015]) One bit for each internal processor control line; One bit for each system bus control line; Condition field indicating the condition under which there should be a branch; Field with the address of the microinstruction to be executed next when a branch is taken. L. Tarrataca Chapter 20 - Microprogrammed Control 10 / 47

Microinstructions Such a microinstruction is interpreted as follows: Activate control lines indicated by a 1 bit; Deactivate control lines indicated by a 0 bit; If condition indicated by the condition bits is False: execute the next microinstruction in sequence; True: execute the instruction indicated in the address field. L. Tarrataca Chapter 20 - Microprogrammed Control 11 / 47

Microprogrammed Control Unit Microprogrammed Control Unit How can we process theseµ-instructions? Processing a µ-program requires: Going through a sequence ofµ-instructions; Jumping to other addresses ofµ-instructions; I.e. normal procedure for processing instructions: Only difference is that these instructions are comprised of µ-operations. L. Tarrataca Chapter 20 - Microprogrammed Control 12 / 47

Microprogrammed Control Unit Lets take a look at one possible architecture: Figure: Control Unit Microarchitecture (Source: [Stallings, 2015]) L. Tarrataca Chapter 20 - Microprogrammed Control 13 / 47

Microprogrammed Control Unit Control memory: Containing the set of µ-instructions; Control address register (CAR): Containing the address of the next µ-instruction to be read; Control buffer register (CBR): Containing the µ-instruction read from the control memory; After µ-instruction is read it can be executed; Sequencing logic: Loads CAR and issues a read command. L. Tarrataca Chapter 20 - Microprogrammed Control 14 / 47

Microprogrammed Control Unit In greater detail: Figure: Function of microprogrammed control unit (Source: [Stallings, 2015]) L. Tarrataca Chapter 20 - Microprogrammed Control 15 / 47

Microprogrammed Control Unit The control unit functions as follows to execute an instruction: 1 Sequencing logic unit: Loads an address to be read into CAR; Issues a READ command to the control memory; 2 Word is read into CBR; 3 Content of the CBR generates: Control signals for the CPU; Next address for the sequencing logic unit; 4 Sequencing logic unit: Loads a new address into the CAR; Based on the next-address information from the CBR and the ALU flags. All this happens during one clock pulse. L. Tarrataca Chapter 20 - Microprogrammed Control 16 / 47

Microprogrammed Control Unit Does all of this sound strangely familiar? Sense of déjà vu? L. Tarrataca Chapter 20 - Microprogrammed Control 17 / 47

Microprogrammed Control Unit Does all of this sound strangely familiar? Sense of déjà vu? Similar to how control unit processed different stages of an instruction. Remember? MAR MBR Fetch cycle Indirect cycle PC Interrupt cycle But now are doing it in a smaller scale within the control unit: Instead of a system-wide: processor, bus, ram... L. Tarrataca Chapter 20 - Microprogrammed Control 18 / 47

Microprogrammed Control Unit Advantages and Disadvantages Main advantage of the use ofµ-programming: Simplifies the design of the control unit; Both cheaper and less error prone to implement. Hardwired control unit must contain complex logic: Microprogrammed control unit components are simple pieces of logic. Main disadvantage of aµ-programmed unit: Slower than a hardwired unit of comparable technology; L. Tarrataca Chapter 20 - Microprogrammed Control 19 / 47

µ-instruction sequencing µ-instruction sequencing Tasks performed by a microprogrammed control unit are: µ-instruction sequencing: Get next microinstruction from the control memory. µ-instruction execution: Generate control signals needed to execute the µ-instruction. Lets focus on the first one. L. Tarrataca Chapter 20 - Microprogrammed Control 20 / 47

µ-instruction sequencing Address of next µ-instruction to be executed is: Determined by instruction register or; Next sequential address or; Branch. Decision is based on: Currentµ-instruction; Condition flags; Contents of the instruction register; L. Tarrataca Chapter 20 - Microprogrammed Control 21 / 47

µ-instruction sequencing Wide variety of techniques to generate the next µ-instruction address: Two address fields Single address field Variable format L. Tarrataca Chapter 20 - Microprogrammed Control 22 / 47

µ-instruction sequencing Two address fields Figure: Branch Control Logic: Two Address Fields (Source: [Stallings, 2015]) L. Tarrataca Chapter 20 - Microprogrammed Control 23 / 47

µ-instruction sequencing Simplest approach: provide two address fields: Multiplex between both address fields and IR: Updating CAR accordingly. CAR is decoded to produce the next µ-instruction address; Branch logic module selects the address-selection signals: Based on control unit flags and Bits from the control portion of the µ-instruction. L. Tarrataca Chapter 20 - Microprogrammed Control 24 / 47

µ-instruction sequencing Figure: Branch Control Logic: L. Tarrataca Single Address Chapter Field 20(Source: - Microprogrammed [Stallings, Control 2015]) 25 / 47 Single address field

µ-instruction sequencing Two-address approach is simple but: Requires more bits in theµ-instruction than other approaches. Idea: Use additional logic to have only one address field; Options for next address are as follows: Address field; IR code; Next sequential address. L. Tarrataca Chapter 20 - Microprogrammed Control 26 / 47

µ-instruction sequencing However: Often, the address field will not be used... Can we do better? Any ideas? L. Tarrataca Chapter 20 - Microprogrammed Control 27 / 47

µ-instruction sequencing Variable Format Figure: Branch Control Logic: Variable Format (Source: [Stallings, 2015]) L. Tarrataca Chapter 20 - Microprogrammed Control 28 / 47

µ-instruction sequencing Provide for two entirely different microinstruction formats: F1: bits are used to activate control signals: Next address is either: {next sequential address, address derived from IR}. F2: some bits drive the branch logic, remaining provide address: Either a conditional or unconditional branch is being specified. L. Tarrataca Chapter 20 - Microprogrammed Control 29 / 47

µ-instruction Execution µ-instruction Execution Tasks performed by a microprogrammed control unit are: µ-instruction sequencing: Get next microinstruction from the control memory. µ-instruction execution: Generate control signals needed to execute the µ-instruction. Lets focus on the second one. L. Tarrataca Chapter 20 - Microprogrammed Control 30 / 47

µ-instruction Execution From the previous classes: Do you remember what is the function of the control unit? L. Tarrataca Chapter 20 - Microprogrammed Control 31 / 47

µ-instruction Execution Remember this? Figure: Data paths and control signals (Source: [Stallings, 2015]) Execution of a microinstruction: generate control signals. Some signals control points internal to the processor; Other signals go to the system bus; L. Tarrataca Chapter 20 - Microprogrammed Control 32 / 47

µ-instruction Execution We can now update our previous Figure 3: Figure: Function of microprogrammed control unit (Source: [Stallings, 2015]) L. Tarrataca Chapter 20 - Microprogrammed Control 33 / 47

µ-instruction Execution With this one: Figure: Control Unit Organization (Source: [Stallings, 2015]) L. Tarrataca Chapter 20 - Microprogrammed Control 34 / 47

µ-instruction Execution What is the difference between pictures? First picture focused on the sequencing logic module: Containing logic to generate address of next µ-instruction using: as inputs the IR, ALU flags, CAR, CBR. Driven by a clock that determines the timing of theµ-instruction cycle. Second picture introduces control logic module: Generates control signals as a function of theµ-instruction; L. Tarrataca Chapter 20 - Microprogrammed Control 35 / 47

µ-instruction Execution Control signals can be transmitted in various ways (1/2): K control signals: Can be controlled using K lines, allowing for 2 k possibilities; Not all of these possibilities are valid, e.g.: Two sources cannot be gated to the same destination; A register cannot be both source and destination; Only one pattern of control signals can be presented to the ALU at a time. Only one pattern of control signals can be presented to the external control bus at a time. We can do better than this... L. Tarrataca Chapter 20 - Microprogrammed Control 36 / 47

µ-instruction Execution Control signals can be transmitted in various ways (2/2): Let Q represent all allowable combinations of control signals: Possible combinations: Q with Q < 2 K possibilities; We can encode these Q combinations using log 2 Q bits; Therefore log 2 Q < 2 K L. Tarrataca Chapter 20 - Microprogrammed Control 37 / 47

µ-instruction Execution Advantages / Disadvantages: Unencoded format: Advantage: Little or no decode logic is needed; Each bit generates a particular control signal. Disadvantage: Requires more bits than necessary. Encoded format: Advantage: Requires less bits. Disadvantage: Requires complex logic to encode / decode resulting in loss of performance. L. Tarrataca Chapter 20 - Microprogrammed Control 38 / 47

µ-instruction Execution Example (1/5) Assume a processor with: Single accumulator; Several internal registers: Such as a program counter and a temporary register for ALU input. Instruction format where: First 3 bits indicate the type of operation; Next 3 encode the operation; Final 2 select an internal register L. Tarrataca Chapter 20 - Microprogrammed Control 39 / 47

µ-instruction Execution Example (2/5) Figure: Simple register transfers (Source: [Stallings, 2015]) L. Tarrataca Chapter 20 - Microprogrammed Control 40 / 47

µ-instruction Execution Example (3/5) Figure: Memory Operations (Source: [Stallings, 2015]) L. Tarrataca Chapter 20 - Microprogrammed Control 41 / 47

µ-instruction Execution Example (4/5) Figure: Special sequencing operations (Source: [Stallings, 2015]) * CSAR = channel system address register, special register for controlling bus lines that exists in some processors. L. Tarrataca Chapter 20 - Microprogrammed Control 42 / 47

µ-instruction Execution Example (5/5) Figure: ALU operations (Source: [Stallings, 2015]) L. Tarrataca Chapter 20 - Microprogrammed Control 43 / 47

Where to focus your study Where to focus your study (1/2) After this class you should be able to understand that: Execution of an instruction involves the execution of substeps: Each cycle is in turn made up of µ-operations; Control unit causes the processor to go through a series of µ-operations: in the proper sequence; and generating the appropriate control signals; L. Tarrataca Chapter 20 - Microprogrammed Control 44 / 47

Where to focus your study Where to focus your study (2/2) After this class you should be able to understand that: Alternative to a hardwired control unit is a µ-programmed control unit: logic is specified by aµ-program: which consists of a sequence µ-operations. µ-programmed control unit is a simple logic circuit capable of: sequencing through µ-instructions; generating control signals to execute each µ-instruction. As in a hardwired control unit: Control signals generated by aµ-instruction are used to cause register transfers and ALU operations. L. Tarrataca Chapter 20 - Microprogrammed Control 45 / 47

Where to focus your study Less important to know how these solutions were implemented: details of specific hardware solutions. Your focus should always be on the building blocks for developing a solution =) L. Tarrataca Chapter 20 - Microprogrammed Control 46 / 47

References References I Stallings, W. (2015). Computer Organization and Architecture. Pearson Education. L. Tarrataca Chapter 20 - Microprogrammed Control 47 / 47