Computer Organization & Design Chapter Five Sec Microcode for Control. The Processor: Datapath & Control. Control

Similar documents
Computer organization

Solutions. Solution The values of the signals are as follows:

Instruction Set Architecture

Central Processing Unit (CPU)

Computer Organization and Components

Pipeline Hazards. Arvind Computer Science and Artificial Intelligence Laboratory M.I.T. Based on the material prepared by Arvind and Krste Asanovic

Review: MIPS Addressing Modes/Instruction Formats

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University

İSTANBUL AYDIN UNIVERSITY

Design of Digital Circuits (SS16)

CPU Organisation and Operation

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Systems I: Computer Organization and Architecture

CHAPTER 7: The CPU and Memory

MICROPROCESSOR AND MICROCOMPUTER BASICS

Instruction Set Design

CPU Organization and Assembly Language

(Refer Slide Time: 00:01:16 min)

Computer Organization and Architecture

Chapter 2 Logic Gates and Introduction to Computer Architecture

Instruction Set Architecture. Datapath & Control. Instruction. LC-3 Overview: Memory and Registers. CIT 595 Spring 2010

l C-Programming l A real computer language l Data Representation l Everything goes down to bits and bytes l Machine representation Language

Introducción. Diseño de sistemas digitales.1

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

CS352H: Computer Systems Architecture

COMP 303 MIPS Processor Design Project 4: MIPS Processor Due Date: 11 December :59

Chapter 4 Lecture 5 The Microarchitecture Level Integer JAVA Virtual Machine

CHAPTER 4 MARIE: An Introduction to a Simple Computer

Chapter 9 Computer Design Basics!

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

The 104 Duke_ACC Machine

Let s put together a Manual Processor

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

Summary of the MARIE Assembly Language

Chapter 2 Topics. 2.1 Classification of Computers & Instructions 2.2 Classes of Instruction Sets 2.3 Informal Description of Simple RISC Computer, SRC

Instruction Set Architecture (ISA)

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

Administrative Issues

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)

Pipeline Hazards. Structure hazard Data hazard. ComputerArchitecture_PipelineHazard1

A s we saw in Chapter 4, a CPU contains three main sections: the register section,

Microprocessor & Assembly Language

Levels of Programming Languages. Gerald Penn CSC 324

Q. Consider a dynamic instruction execution (an execution trace, in other words) that consists of repeats of code in this pattern:

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Overview. CISC Developments. RISC Designs. CISC Designs. VAX: Addressing Modes. Digital VAX

1 Classical Universal Computer 3

Reduced Instruction Set Computer (RISC)

How It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals

Notes on Assembly Language


Preface. Any questions from last time? A bit more motivation, information about me. A bit more about this class. Later: Will review 1st 22 slides

PART B QUESTIONS AND ANSWERS UNIT I

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Computer Systems Design and Architecture by V. Heuring and H. Jordan

Memory Elements. Combinational logic cannot remember

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

Stack machines The MIPS assembly language A simple source language Stack-machine implementation of the simple language Readings:

Generating MIF files

Memory Basics. SRAM/DRAM Basics

A FPGA Implementation of a MIPS RISC Processor for Computer Architecture Education

Solution: start more than one instruction in the same clock cycle CPI < 1 (or IPC > 1, Instructions per Cycle) Two approaches:

Aims and Objectives. E 3.05 Digital System Design. Course Syllabus. Course Syllabus (1) Programmable Logic

EC 362 Problem Set #2

Design of Pipelined MIPS Processor. Sept. 24 & 26, 1997

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

The WIMP51: A Simple Processor and Visualization Tool to Introduce Undergraduates to Computer Organization

Computer Architecture Lecture 3: ISA Tradeoffs. Prof. Onur Mutlu Carnegie Mellon University Spring 2013, 1/18/2013

BASIC COMPUTER ORGANIZATION AND DESIGN

EE361: Digital Computer Organization Course Syllabus

Chapter 01: Introduction. Lesson 02 Evolution of Computers Part 2 First generation Computers

Introduction to Microcoded Implementation of a CPU Architecture

a storage location directly on the CPU, used for temporary storage of small amounts of data during processing.

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Execution Cycle. Pipelining. IF and ID Stages. Simple MIPS Instruction Formats

Programmable Logic Controllers Definition. Programmable Logic Controllers History

EE282 Computer Architecture and Organization Midterm Exam February 13, (Total Time = 120 minutes, Total Points = 100)

Lecture 8: Synchronous Digital Systems

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

PROBLEMS. which was discussed in Section

Software Pipelining. for (i=1, i<100, i++) { x := A[i]; x := x+1; A[i] := x

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

A3 Computer Architecture

TYPES OF COMPUTERS AND THEIR PARTS MULTIPLE CHOICE QUESTIONS

Chapter 5 Instructor's Manual

1 Computer hardware. Peripheral Bus device "B" Peripheral device. controller. Memory. Central Processing Unit (CPU)

Processor Architectures

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

CSE 141 Introduction to Computer Architecture Summer Session I, Lecture 1 Introduction. Pramod V. Argade June 27, 2005

SIM-PL: Software for teaching computer hardware at secondary schools in the Netherlands

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8

LSN 2 Computer Processors

An Overview of Stack Architecture and the PSC 1000 Microprocessor

Central Processing Unit

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Microprocessor and Microcontroller Architecture

Computer Organization. and Instruction Execution. August 22

AC : A PROCESSOR DESIGN PROJECT FOR A FIRST COURSE IN COMPUTER ORGANIZATION

5 Combinatorial Components. 5.0 Full adder. Full subtractor

Transcription:

Computer Organization & Design Chapter Five Sec. 5.5-5.11 Microcode for 1 The Processor: Datapath & We're ready to look at an implementation of the MIPS Simplified to contain only: memory-reference instructions: lw, sw arithmetic-logical instructions: add, sub, and, or, slt control flow instructions: beq, j Generic Implementation: use the program counter (PC) to supply instruction address get the instruction from memory read registers use the instruction to decide exactly what to do All instructions use the ALU after reading the registers Why? memory-reference? arithmetic? control flow? 2 e.g., what should the ALU do with this instruction Example: lw $1, 100($2) 35 2 1 100 op rs rt 16 bit offset ALU control input 000 AND 001 OR 010 add 110 subtract 111 set-on-less-than Why is the code for subtract 110 and not 011? 3

Must describe hardware to compute 3-bit ALU conrol input given instruction type 00 = lw, sw 01 = beq, 11 = arithmetic function code for arithmetic Describe it using a truth table (can turn into gates): ALUOp computed from instruction type ALUOp Funct field Operation ALUOp1 ALUOp0 F5 F4 F3 F2 F1 F0 0 0 X X X X X X 010 X 1 X X X X X X 110 1 X X X 0 0 0 0 010 1 X X X 0 0 1 0 110 1 X X X 0 1 0 0 000 1 X X X 0 1 0 1 001 1 X X X 1 0 1 0 111 4 Memto- Reg Mem Mem Instruction RegDst ALUSrc Reg Write Read Write Branch ALUOp1 ALUp0 0 0 1 0 R-format 1 0 0 1 0 lw 0 1 1 1 1 0 0 0 0 sw X 1 X 0 0 1 0 0 0 beq X 0 X 0 0 0 1 0 1 5 Implementing the Value of control signals is dependent upon: what instruction is being executed which step is being performed Use the information we ve accumulated to specify a finite state machine specify the finite state machine graphically, or use microprogramming Implementation can be derived from specification 6

Graphical Specification of FSM How many state bits will we need? 10 states, < 2^4 4 bits 7 Finite State Machine for Implementation: Logic Data path Instruction Register Opcode Field 8 PLA Implementation If I picked a horizontal or vertical line could you explain it? 9

ROM Implementation ROM = "Read Only Memory" values of memory locations are fixed ahead of time A ROM can be used to implement a truth table if the address is m-bits, we can address 2 m entries in the ROM. our outputs are the bits of data that the address points to. m n 0 0 0 0 0 1 1 0 0 1 1 1 0 0 0 1 0 1 1 0 0 0 1 1 1 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 1 0 1 1 1 0 1 1 1 m is the "height", and n is the "width" 10 ROM Implementation How many inputs are there? 6 bits for opcode, 4 bits for state = 10 address lines (i.e., 2 10 = 1024 different addresses) How many outputs are there? 16 datapath-control outputs, 4 state bits = 20 outputs ROM is 2 10 x 20 = 20K bits (and a rather unusual size) Rather wasteful, since for lots of the entries, the outputs are the same i.e., opcode is often ignored 11 ROM vs PLA Break up the table into two parts 4 state bits tell you the 16 outputs, 2 4 x 16 bits of ROM 10 bits tell you the 4 next state bits, 2 10 x 4 bits of ROM Total: 4.3K bits of ROM PLA is much smaller can share product terms only need entries that produce an active output can take into account don't cares Size is (#inputs #product-terms) + (#outputs #product-terms) For this example = (10x17)+(20x17) = 460 PLA cells PLA cells usually about the size of a ROM cell (slightly bigger) 12

Another Implementation Style Complex instructions: the "next state" is often current state + 1 Unit PLA or ROM Data path State Address Select Logic Instruction Register Opcode Field 13 Details Dispatch ROM 1 Dispatch ROM 2 Op Opcode name Value Op Opcode name Value 000000 R-format 0110 100011 lw 0011 000010 jmp 1001 101011 sw 0101 000100 beq 1000 100011 lw 0010 101011 sw 0010 State Dispatch ROM 2 Dispatch ROM 1 Instruction Register Opcode Field State number Address-control action Value of AddrCtl 0 Use incremented state 3 1 Use dispatch ROM 1 1 2 Use dispatch ROM 2 2 3 Use incremented state 3 4 Replace state number by 0 0 5 Replace state number by 0 0 6 Use incremented state 3 7 Replace state number by 0 0 8 Replace state number by 0 0 9 Replace state number by 0 0 14 Microprogramming Unit Microcode Memory Data path Microprogram Counter Address Select Logic Instruction Register Opcode Field What are the microinstructions? 15

Microprogramming A specification methodology appropriate if hundreds of opcodes, modes, cycles, etc. signals specified symbolically using microinstructions ALU Register PCWrite Label control SRC1 SRC2 control Memory control Sequencing Fetch Add PC 4 Read PC ALU Seq Add PC Extshft Read Dispatch 1 Mem1 Add A Extend Dispatch 2 LW2 Read ALU Seq Write MDR Fetch SW2 Write ALU Fetch Rformat1Func A B Seq code Write ALU Fetch BEQ1 Subt A B ALUOut-cond Fetch JUMP1 Jump address Fetch Will two implementations of the same architecture have the same microcode? What would a microassembler do? 16 Microinstruction format Field name Value Signals active Comment ALUOp = 00 Add Cause the ALU to add. ALU control Subt ALUOp = 01 Cause the ALU to subtract; this implements the compare for branches. Func code ALUOp = 10 Use the instruction's function code to determine ALU control. SRC1 PC ALUSrcA = 0 Use the PC as the first ALU input. A ALUSrcA = 1 Register A is the first ALU input. B ALUSrcB = 00 Register B is the second ALU input. SRC2 4 ALUSrcB = 01 Use 4 as the second ALU input. Extend ALUSrcB = 10 Use output of the sign extension unit as the second ALU input. Extshft ALUSrcB = 11 Use the output of the shift-by-two unit as the second ALU input. Read Read two registers using the rs and rt fields of the IR as the register numbers and putting the data into registers A and B. Write ALU RegWrite, Write a register using the rd field of the IR as the register number and Register RegDst = 1, the contents of the ALUOut as the data. control MemtoReg = 0 Write MDR RegWrite, Write a register using the rt field of the IR as the register number and RegDst = 0, the contents of the MDR as the data. MemtoReg = 1 Read PC MemRead, Read memory using the PC as address; write result into IR (and lord = 0 the MDR). Memory Read ALU MemRead, Read memory using the ALUOut as address; write result into MDR. lord = 1 Write ALU MemWrite, Write memory using the ALUOut as address, contents of B as the lord = 1 data. ALU PCSource = 00 Write the output of the ALU into the PC. PCWrite PC write control ALUOut-cond PCSource = 01, If the Zero output of the ALU is active, write the PC with the contents PCWriteCond of the register ALUOut. jump address PCSource = 10, Write the PC with the jump address from the instruction. PCWrite Seq AddrCtl = 11 Choose the next microinstruction sequentially. Sequencing Fetch AddrCtl = 00 Go to the first microinstruction to begin a new instruction. Dispatch 1 AddrCtl = 01 Dispatch using the ROM 1. Dispatch 2 AddrCtl = 10 Dispatch using the ROM 2. 17 Maximally vs. Minimally Encoded No encoding: 1 bit for each datapath operation faster, requires more memory (logic) used for Vax 780 an astonishing 400K of memory! Lots of encoding: send the microinstructions through logic to get control signals uses less memory, slower Historical context of CISC: Too much logic to put on a single chip with everything else Use a ROM (or even RAM) to hold the microcode It s easy to add new instructions 18

Microcode: Trade-offs Distinction between specification and implementation is sometimes blurred Specification Advantages: Easy to design and write Design architecture and microcode in parallel Implementation (off-chip ROM) Advantages Easy to change since values are in memory Can emulate other architectures Can make use of internal registers Implementation Disadvantages, SLOWER now that: is implemented on same chip as processor ROM is no longer faster than RAM No need to go back and make changes 19 The Big Picture Initial Representation Finite State Diagram Microprogram Sequencing Explicit Next-State Function Microprogram Counter + Dispatch ROMS Logic Representation Logic Equation Truth Tables Implementation Technique Programmable Logic Array Read Only Memory 20