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

Similar documents
Computer Organization

MICROPROGRAMMED CONTROL:-

Blog -

Computer Organization MIPS Architecture. Department of Computer Science Missouri University of Science & Technology

Chapter 3 : Control Unit

MICROPROGRAMMED CONTROL

Computer Architecture Programming the Basic Computer

CS 5803 Introduction to High Performance Computer Architecture: RISC vs. CISC. A.R. Hurson 323 Computer Science Building, Missouri S&T

Programming Level A.R. Hurson Department of Computer Science Missouri University of Science & Technology Rolla, Missouri

MICROPROGRAMMED CONTROL

MICROPROGRAMMED CONTROL

CS 5803 Introduction to High Performance Computer Architecture: Arithmetic Logic Unit. A.R. Hurson 323 CS Building, Missouri S&T

MICROPROGRAMMED CONTROL

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

Chap. 7 Microprogrammed Control(Control Unit)

Nanostorage and Nanoprogram

Control Unit Implementation Hardwired Memory

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

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

Digital System Design Using Verilog. - Processing Unit Design

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

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

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

Microprogrammed Control


Mobile and Heterogeneous databases

Chapter 20 - Microprogrammed Control (9 th edition)

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

Outcomes. Lecture 13 - Introduction to the Central Processing Unit (CPU) Central Processing UNIT (CPU) or Processor

Module 5 - CPU Design

Advanced Computer Architecture

Computer Organization and Architecture

William Stallings Computer Organization and Architecture

SCRAM Introduction. Philipp Koehn. 19 February 2018

Computer Architecture

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

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

2 MARKS Q&A 1 KNREDDY UNIT-I

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

Mobile and Heterogeneous databases

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Mobile and Heterogeneous databases Distributed Database System Transaction Management. A.R. Hurson Computer Science Missouri Science & Technology

4. MICROPROGRAMMED COMPUTERS

Computer Logic II CCE 2010

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

Micro-programmed Control Ch 15

Processing Unit CS206T

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

Micro-programmed Control Ch 15

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

Department of Computer and Mathematical Sciences. Lab 4: Introduction to MARIE

The MARIE Architecture

THE MICROPROCESSOR Von Neumann s Architecture Model

Chapter 14 Design of the Central Processing Unit

Micro-programmed Control Ch 17

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

William Stallings Computer Organization and Architecture

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

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

Chapter 17. Microprogrammed Control. Yonsei University

Computer Organization and Design

1. Fundamental Concepts

CPU Structure and Function

Machine Language and Assembly Language

Mobile and Heterogeneous databases Distributed Database System Query Processing. A.R. Hurson Computer Science Missouri Science & Technology

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

Introduction to Computers - Chapter 4

General purpose registers These are memory units within the CPU designed to hold temporary data.

Computer Architecture

Microprogramming: Basic Idea

Lecture 11: Control Unit and Instruction Encoding

COMPUTER ORGANIZATION

Assembly Language Programming of 8085

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

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

Microprogrammed Control Approach

CISC Processor Design

A3 Computer Architecture

Parallelism. Execution Cycle. Dual Bus Simple CPU. Pipelining COMP375 1

Lecture 10: Control Unit

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

5-1 Instruction Codes

Lecture 10: Control Unit

PESIT Bangalore South Campus

Processing Unit. Unit II

DC57 COMPUTER ORGANIZATION JUNE 2013

CS311 Lecture: The Architecture of a Simple Computer

101. The memory blocks are mapped on to the cache with the help of a) Hash functions b) Vectors c) Mapping functions d) None of the mentioned

von Neumann Architecture Basic Computer System Early Computers Microprocessor Reading Assignment An Introduction to Computer Architecture

Basic Computer System. von Neumann Architecture. Reading Assignment. An Introduction to Computer Architecture. EEL 4744C: Microprocessor Applications

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register

MCQ's on Unit-3 Control Unit

CHAPTER 8: Central Processing Unit (CPU)

CS 5803 Introduction to High Performance Computer Architecture: Address Accessible Memories. A.R. Hurson 323 CS Building, Missouri S&T

Practice Problems (Con t) The ALU performs operation x and puts the result in the RR The ALU operand Register B is loaded with the contents of Rx

Copyright 2000 N. AYDIN. All rights reserved. 1

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

Running Applications

Register-Level Design

Transcription:

Control Unit Department of Computer Science Missouri University of Science & Technology hurson@mst.edu 1

Note, this unit will be covered in three lectures. In case you finish it earlier, then you have the following options: 1) Take the early test and start CS3889.module6 2) Study the supplement module (supplement CS3889.module5) 3) Act as a helper to help other students in studying CS3889.module5 Note, options 2 and 3 have extra credits as noted in course outline. 2

Enforcement of background Current Module { Glossary of prerequisite topics No Familiar with the topics? Yes Take Test No Pass? Remedial action Yes { Glossary of topics No Familiar with the topics? Take the Module Yes Take Test No Pass? Yes Options Review CS3889.module5.background At the end give a test, record the score, and impose remedial action if not successful Study next module? Lead a group of students in this module (extra credits)? Study more advanced related topics (extra credits)? Extra Curricular activities

CPU CU ALU Information Input Unit Memory Unit Output Unit Result Data Path Control Path 4

Control Unit In general control unit has two major tasks: Instruction Sequencing: the way instructions are selected. Instruction Interpretation: the way instructions are executed. 5

Control Unit Instruction Interpretation Each assembly (machine) level instruction is an orderly sequence of µ-operations. Assembly (machine) level instructions are executed by means of control functions (control signals). Each control function is a Boolean function which enables the execution of a µ-operation. It is the task of control unit to generate control signals in an orderly fashion. A control unit is the realization of control functions. It is simply a decoder that based on an input pattern, generates a proper output pattern, where each output signal is a control signal. 6

Control Unit Simple machine OPR 3 x 8 Decoder I q 0. q 7 Control Unit... Control Signals MAR PC MBR (M[MAR]). 2 x 4 Decoder t 0 t 3 Counter Clock C 0 C 1 C 2 C 3 2 x 4 Decoder F R 7

c t 0 1 c t 1 1 c Control Unit Simple machine In the simple machine, main memory has been repeatedly read in various routine. This signal initiates: c 0 t 0 : MAR PC 0 1 MBR (M[MAR]), PC (PC) + 1 c 1 t 0 0 : MAR (MBR(ADDRESS)) 2 OPR (MBR(op)), I (MBR(I)) qc q' 10 tc 7 Ic 12 : t 0 : MAR MBR (MBR(address)) (M[MAR]) 0 t 3 : R 1 qc (q 10 tc : idle 7 +I')c 2 t 1 : MBR (M[MAR]) 0 t 3 : 1 qc 10 tc 32 : t 2 : AC F (AC) 1, R Λ (MBR) 0 q 0 c 2 t 3 :... M B R ( M [ M AR] ) c t 2 1 q 0 q t2 1 1 c q t 2 1 c 2 q t2 1 6 8

Control Unit Naturally, such an ad hoc approach is justifiable when dealing with simple organizations. In case of complex systems one needs to use a more systematic approach in the design of control unit. Two approaches have been proposed: Hardwired: Realization of the control unit as a sequential device. µ-programming: Realization of the control unit by means of programming routines. 9

Control Unit Hardwired State Table Method Delay Element Method Sequence Counter Programmable Logic Array 10

Control Unit µ-programmed As one can visualize, a hardwired control unit is a "big decoder" which, at each moment in time, based on the input pattern (system's status) generates a bit pattern as output (control signals). This bit pattern then activates the proper functional boxes. A microprogrammed control unit is simply a mechanism which allows to: i) Store all possible output bit patterns in a memory, and ii) Read them in an orderly fashion. 11

Control Unit µ-programmed Suppose we have a memory (control memory), like any other memory organization, composed of memory words (control word). Further, each bit of a memory word is designated by a mnemonic name which represents a specific function: Control Word PC (PC) + 1 MAR PC MBR (M[MAR]) 12

Control Unit µ-programmed It is also assumed that we have a facility to set up the control words by different patterns: 1 0 0 0 0 0 1 1 0 0 13

µ-programmed Control Unit If one has a mechanism to fetch the control words and interpret their contents, then fetching the previous two memory words in proper order, generates the sequence of control functions needed to perform fetch cycle. 14

µ-programmed Control Unit Hardware Requirements Control Store to store micro instructions. This storage could be a part of main memory or a dedicated storage medium. Hardware facility to fetch, decode and execute micro instructions. Mechanism to map the operation codes (at assembly level) to the proper addresses in the control store. 15

µ-programmed Control Unit Flow of Control Micro instructions are stored in groups. Each group of micro instructions represents a macro instruction (assembly instruction). Similar to a "case statement", the operation code of a macro instruction transfers control to a designated collection of micro instructions. A macro instruction is fetched. The operation code is mapped into a block of the control store which represents that macro instruction. The designated micro instructions are fetched and executed in an orderly fashion. 16

Control Store µ-programmed Control Unit Flow of Control PC Macro (assembly level) instructions Main Memory Fetch a Macro Inst. 1 3 2 Map macro inst. to a block Fetch and execute the µ - inst. Each block represents a sequence of µ - inst. for a macro inst. 17

µ-programmed Control Macro Inst. Unit Mapping Process Increment Control Address Register Return Address Reg. or Stack Status bits Branch Logic Control Memory Micro operations 18

µ-programmed Control Unit µ-instruction Format A µ-instruction (in general) is composed to two parts: control field and address field. Control field is used to activate functional units. Address field is used to fetch µ-instructions in an orderly fashion. However, similar to the concept of the program counter, the address field can be eliminated at the expense of a register called micro program counter. In some cases control words have additional field(s) called Emit-Field(s) - say to initialize a register. 19

Questions Compare and contrast µ-programmed and hardwired control units against each other. How can we reduce the length of the µ- instructions? Discuss the factors that could effect the length of the µ-instructions. 20

µ-programmed Control Unit µ- Instruction Format Based on the degree of parallelism and representation of µ-operations, µ-instructions can be classified into three groups: Horizontal Vertical Diagonal 21

µ-programmed Control Unit µ-instruction Format Horizontal: each bit of the control part represents a distinct µ-operation. A horizontal µ-instruction is characterized by: Long format. Ability to express a high degree of parallelism. Little encoding of the control information. Vertical: control part represents just one µ-operation. A vertical format is characterized by: Short format No degree of parallelism Considerable encoding of the control information Diagonal: it is a compromise between horizontal and vertical formats. It is characterized by: Moderate length format Some degree of parallelism Some encoding of the control information 22

µ-programmed Control Unit An Example The computer configuration is as follows: 1 11 PC 1 11 MAR Main Memory Control Store 128 * 20 1 7 CAR 1 7 SBR 2k * 16 1 16 MBR 1 16 AC 23

µ-programmed Control Unit An Example Macro Instruction Format 1 2 5 6 16 Mode Bit Op-Code Operand 24

µ-programmed Control Unit An Example Sixteen possible instructions, such as ADD 0000 AC (AC)+(M) BRANCH 0001 if AC<0 then PC effective address STORE 0010 M (AC) 25

µ-programmed Control Unit An Example µ-instruction Format 3 3 3 2 2 7 F 1 F 2 F 2 CD BR ADF F 1, F 2, and F 3 fields are the control part. Having F 1, F 2, and F 3 as part of control part implies some degree of parallelism. 000 100 101 implies 2 micro operations F1 = 000 no operation F2 = 100 MBR (M[MAR]) F3 = 101 PC (PC) + 1 CD, BR and ADF fields collectively represent a (conditional) transfer control. 26

µ-programmed Control Unit An Example CD is 2-bits long and defines status conditions: CD Condition 00 U unconditional 1 01 I Indirect mode bit MBR(I) 10 S Sign of AC AC(S) 11 Z Zero value in AC AC = 0 27

µ-programmed Control Unit An Example BR is 2-bits long and defines different types of branches: BR 00 JMP CAR (ADF) if condition is true CAR (CAR)+1 otherwise 01 CALL CAR (ADF), SBR (CAR)+1 if condition is true CAR (CAR)+1 otherwise 10 RET CAR (SBR) 11 MAP CAR(2-5) (MBR(Op-Code)), CAR(1,6,7) 0 ADF is 7-bits long and represents the address field. 28

µ-programmed Control Unit An Example Similar to the assembly instructions, a symbolic notation can be used to represent each µ-instruction. In our system, each µ-instruction is composed of six elements: A label followed by semi-colons µ-op-codes separated by commas CD fields (U, I, S, Z) BR field (JMP, CALL, RET, MAP) ADF field (a label, NEXT, or blank) Comments 29

µ-programmed Control Unit An Example FETCH Cycle The first 64 words in the control store represent the micro instructions for 16 macro instructions. For each macro instruction, a block of four µ-instruct-ions is designated. Therefore, the micro code to represent the instruction fetch cycle is stored somewhere in the high order half part of the control store. FETCH: PCTAR U JMP NEXT READ, INCPC U JMP NEXT BRTAR U MAP 30

µ-programmed Control Unit An Example ADD ADD: NOP I CALL INDRCT READ U JMP NEXT ADD U JMP FETCH BRANCH BRANCH: NOP S JMP OVER NOP U JMP FETCH OVER: NOP I CALL INDRCT BRTPC U JMP FETCH 31

µ-programmed Control Unit Example STORE An STORE: NOP I CALL INDRCT ACTBR U JMP NEXT WRITE U JMP FETCH Indirect Cycle INDRCT: READ U JMP NEXT BRTAR U RET 32

µ-programmed Control Unit Microprocessor Sequencer It is a unit which allows to fetch the µ-instructions in an orderly fashion. L M ap Ext ernal Macro Inst. I 1 I 0 Swi t ch L ogic S 0 3 2 1 0 Mapping Process SBR L Increment 1 I S Z MUX. T S 1 CAR Status bits Control Memory Branch Logic I ncrement Control Address Register Control Memory Return Address Reg. or Stack µ-codes CD BR A DF Micro operations 33

µ-programmed Control Unit Microprocessor Sequencer BR I 0 I 1 T S 0 S 1 L JMP 00 0 0 0 0 0 0 JMP 00 0 0 1 1 0 0 CALL 01 0 1 0 0 0 0 CALL 01 0 1 1 1 0 1 RET 10 1 0 X 0 1 0 MAP 11 1 1 X 1 1 0 S 0 = I 0 I 1 T+I 0 I 1 T+I 0 I 1 = I 0 T(I 1 +I 1 )+ I 0 I 1 = I 0 T+I 0 I 1 S 1 = I 0 I 1 +I 0 I 1 = I 0 (I 1 +I 1 )=I 0 34 L = I 0 I 1 T

Control Unit Control unit: A computer module with two major tasks: instruction sequencing and instruction interpretation. Instruction sequencing: The way instructions are selected. Instruction Interpretation: The way instructions are executed. Hardwired control unit: A way to design the control unit, in which the control signals are generated by random logic. 35

Control Unit Micro programming: A way to design the control unit, in which the control signals are generated by reading them from the control store. State table method: A hardwired technique for the design of control unit. Delay elements method : A hardwired technique for the design of control unit. Sequence counter method: A hardwired technique for the design of control unit. Programmable logic array: A hardwired technique for the design of control unit. 36

Questions In a general purpose computer, what are the major tasks of a control unit? Based on our earlier discussion about the simple machine, there are missing input signals to the control unit diagram of the simple machine. What are they? What is a correct answer? Control unit: Is a decoder which interprets the status of the computer at each moment of time. Is a black box which generates control signals in an orderly fashion. Initiates the execution of micro operations. None of the above. 37