ECE290 Fall 2012 Lecture 22. Dr. Zbigniew Kalbarczyk

Similar documents
Figure 4.9 MARIE s Datapath

Department of Electrical and Computer Engineering The University of Texas at Austin

CENG3420 Lab 3-1: LC-3b Datapath

Basic Computer Organization and Design Part 3/3

Enrico Nardelli Logic Circuits and Computer Architecture

Design of Digital Circuits Lecture 14: Microprogramming. Prof. Onur Mutlu ETH Zurich Spring April 2017

CSE Computer Architecture I

Lecture 13: Sequential Circuits, FSM

A Second Datapath Example YH16

UNIVERSITY OF WISCONSIN MADISON

Lecture 13: Sequential Circuits, FSM

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

INF2270 Spring Philipp Häfliger. Lecture 8: Superscalar CPUs, Course Summary/Repetition (1/2)

ECE 3401 Lecture 23. Pipeline Design. State Table for 2-Cycle Instructions. Control Unit. ISA: Instruction Specifications (for reference)

CHAPTER log 2 64 = 6 lines/mux or decoder 9-2.* C = C 8 V = C 8 C * 9-4.* (Errata: Delete 1 after problem number) 9-5.

Project Two RISC Processor Implementation ECE 485

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

Logic Design. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

3. (2) What is the difference between fixed and hybrid instructions?

NCU EE -- DSP VLSI Design. Tsung-Han Tsai 1

Combinational vs. Sequential. Summary of Combinational Logic. Combinational device/circuit: any circuit built using the basic gates Expressed as

[2] Predicting the direction of a branch is not enough. What else is necessary?

Design at the Register Transfer Level

ICS 233 Computer Architecture & Assembly Language

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON

ALU A functional unit

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

CMP 334: Seventh Class

L07-L09 recap: Fundamental lesson(s)!

Simple Instruction-Pipelining (cont.) Pipelining Jumps

CPU DESIGN The Single-Cycle Implementation

Table of Content. Chapter 11 Dedicated Microprocessors Page 1 of 25

4. (3) What do we mean when we say something is an N-operand machine?

CSCI-564 Advanced Computer Architecture

From Sequential Circuits to Real Computers

Computer Architecture

Lecture: Pipelining Basics

CprE 281: Digital Logic

CSE370: Introduction to Digital Design

CPSC 3300 Spring 2017 Exam 2

Computer Organization I CRN Test 3/Version 1 CMSC 2833 CRN Spring 2017

[2] Predicting the direction of a branch is not enough. What else is necessary?

Logic Design II (17.342) Spring Lecture Outline

Microprocessor Power Analysis by Labeled Simulation

Digital Circuits and Systems

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

1. (2 )Clock rates have grown by a factor of 1000 while power consumed has only grown by a factor of 30. How was this accomplished?

Shift Register Counters

COE 328 Final Exam 2008

CMP 338: Third Class

Computer Engineering Department. CC 311- Computer Architecture. Chapter 4. The Processor: Datapath and Control. Single Cycle

System Data Bus (8-bit) Data Buffer. Internal Data Bus (8-bit) 8-bit register (R) 3-bit address 16-bit register pair (P) 2-bit address

Counters. We ll look at different kinds of counters and discuss how to build them

From Sequential Circuits to Real Computers

CPE100: Digital Logic Design I

2

Chapter 3 Digital Logic Structures

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Simple Instruction-Pipelining. Pipelined Harvard Datapath

Administrivia. Course Objectives. Overview. Lecture Notes Week markem/cs333/ 2. Staff. 3. Prerequisites. 4. Grading. 1. Theory and application

Chapter 3. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 3 <1>

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

14.1. Unit 14. State Machine Design

Finite State Machine (FSM)

ECE 341. Lecture # 3

CMPT-150-e1: Introduction to Computer Design Final Exam

ENGIN 112 Intro to Electrical and Computer Engineering

Operational Semantics

Computer Science Final Examination Friday December 14 th 2001

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Lecture 10: Synchronous Sequential Circuits Design

CSE 200 Lecture Notes Turing machine vs. RAM machine vs. circuits

COVER SHEET: Problem#: Points

SRC Language Conventions. Class 6: Intro to SRC Simulator Register Transfers and Logic Circuits. SRC Simulator Demo. cond_br.asm.

Simple Instruction-Pipelining. Pipelined Harvard Datapath

Chapter 7: Digital Components. Oregon State University School of Electrical Engineering and Computer Science. Review basic digital design concepts:

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Building a Computer. Quiz #2 on 10/31, open book and notes. (This is the last lecture covered) I wonder where this goes? L16- Building a Computer 1

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University

Final Exam. ECE 25, Spring 2008 Thursday, June 12, Problem Points Score Total 90

CMU Introduction to Computer Architecture, Spring 2015 HW 2: ISA Tradeoffs, Microprogramming and Pipelining

Sequential Logic Circuits

EC 413 Computer Organization

CPE100: Digital Logic Design I

State and Finite State Machines

IMPERIAL COLLEGE OF SCIENCE, TECHNOLOGY AND MEDICINE UNIVERSITY OF LONDON DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING EXAMINATIONS 2005

ECE 2300 Digital Logic & Computer Organization

Processor Design & ALU Design

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

(Boolean Algebra, combinational circuits) (Binary Codes and -arithmetics)

CPS 104 Computer Organization and Programming Lecture 11: Gates, Buses, Latches. Robert Wagner

Introduction The Nature of High-Performance Computation

Lecture 17: Designing Sequential Systems Using Flip Flops

EE201l Homework # 6. Microprogrammed Control Unit Design

CMP N 301 Computer Architecture. Appendix C

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Chapter 3. Chapter 3 :: Topics. Introduction. Sequential Circuits

ALU, Latches and Flip-Flops

The Digital Logic Level

L10 State Machine Design Topics

Transcription:

ECE290 Fall 2012 Lecture 22 Dr. Zbigniew Kalbarczyk

Today LC-3 Micro-sequencer (the control store) LC-3 Micro-programmed control memory LC-3 Micro-instruction format LC -3 Micro-sequencer (the circuitry) LC -3 Micro-sequencer control Determining next state

FETCH LC-3: Abbreviated State Diagram MAR PC PC PC+1 MDR M[MAR] State 18 State 33 ADD instructions = many microinstructions! IR MDR State 35 DECODE [opcode] State 32 ADD LDR JMP First state after DECODE for ADD instruction First state after DECODE LDR instruction First state after DECODE for JMP instruction Last state to carry out ADD instruction Last state to carry out LDR instruction PC Register To state 18 To state 18 To state 18

From the Task to a Solution Control Signals for one microinstruction of ADD instruction Microinstruction: DR SR1 +SR2; Load NZP This does not include fetch, decode, and other execution phase microinstructions needed to perform ADD instruction!!!

LC-3: Micro-Architecture How is the next state determined? 49 control signals during each clock cycle!

Instructions vs Microinstructions Instruction: assembly or binary representation of an instruction Each instruction corresponds to one or more microinstructions needed to go through fetch, decode and execute phases Each microinstruction consists of bits corresponding to Next state information (check the state diagram arrows between states) Control word (control signals we just went through)

LC-3 Micro-instructions Microinstruction Next state information Control word Instructions are in Main Memory Microinstructions are in control store: Control ROM Memory

Control Store for LC3 Architecture Next state bits Control word bits Address in ROM Control Store b b b b b Control Store 64 rows ~ states of the LC3 state machine 49 columns ~ 10 sequence control (signals from the current microinstruction) and 39 data path control 39 control signals = 25 operation execution + 14 interrupt execution

THE CONTROL STORE: MICRO-SEQUENCING ADDR 48 39 38 control signals 0 2 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 1 0 0 1 MAR PC + sext (off 9) BR1 LD1 18 0 1 0 1 1 0 0 0 0 1 fetch1 22 25 27 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 1 1 0 0 1 MDR M[MAR] 0 0 0 0 0 0 1 0 0 1 0 DR MDR, set CC BR2 LD2 LD3 32 33 35 1 X X X X X X X X X 0 0 0 1 1 0 0 0 0 1 0 0 decode fetch2 fetch3 0

Overview: Instruction Versus Micro-instruction Instruction Micro-Instruction

Review: Status Signals from Data Path to Control IR[15:11] are the opcode bits PSR[15] is the bit [15] of the Processor Status Register, which indicates whether the current program is executing with supervisor or user privileges. BEN is to indicate whether or not a BR (conditional branch) should be taken. INT is to indicate that some external device of higher priority than the executing process requests service. R is to indicate the end of a memory operation. (J,COND, IRD) to provide signals from the current microinstruction

LC3: Control Structure Micro-programmed Control Unit Why 6 bit address? A: Addressing 52 states need 6 bit address Why do we need CAR? A: Similar to MAR need to store the address

LC3 Micro-Instruction Format Each Micro-instruction has the default next state location encoded in J[5:0] This next state location can be modified depending on the values of IRD and COND[2:0] ADDRESS OF NEXT INSTRUCTION 48 39 38 0 IRD COND J CONTROL SIGNALS

LC3 Micro-Instruction Format: IRD=1 If IRD = 1 This is the control vector for state 32 The next address will be 00 concatenated with IR[15:12] (00 IR[15:12]) ADDRESS OF NEXT INSTRUCTION = 32 48 39 38 0 1 X X X X X X X X X IRD COND J CONTROL SIGNALS

LC3 Micro-Instruction Format: IRD=0 If IRD = 0 Get the branch address J[5:0] of micro-instruction from the control word Use COND[2:0] and signals R, BEN, INT, IR[11] and PSR[15] to modify the branch address ADDRESS OF NEXT INSTRUCTION 48 39 38 0 0 IRD COND J CONTROL SIGNALS

LC3 State Machine Every state requires at least one clock cycle State waiting for memory operations to complete may require more clock cycles

Example: Execute Phase of LD State 2: MAR PC + sext(offset9) From State 2: always go to State 25 (011001) ADDRESS OF NEXT INSTRUCTION 48 47 46 45 44 43 42 41 40 39 38 0 0 0 0 0 0 1 1 0 0 1 IRD COND J CONTROL SIGNALS

Example: Execute Phase of LD State 25: MDR M[MAR] If R=0 (memory not ready) go to State 25 Next state (NS) = 011001 (25) If R=1 go to State 27 (011010) Control Address 25 48 47 46 45 44 43 42 41 40 39 38 0 0 0 0 1 0 1 1 0 0 1 IRD COND J CONTROL SIGNALS If R=1 then NS = 011011 Control Address 27 48 47 46 45 44 43 42 41 40 39 38 0 0 0 0 0 0 1 0 0 1 0 IRD COND J CONTROL SIGNALS

IRD COND J CONTROL SIGNALS Micro-sequencer Control 1 0 IRD=0 If R =1 then Address of next state = (COND2) (COND1) COND0 R Control Address 25 48 47 46 45 44 43 42 41 40 39 38 0 0 0 0 1 0 1 1 0 0 1

Other Examples Current Addr If R=0, go to If R=1, go to 16 16 (10000) 010010 18 28 28 (11100) 011110 30 24 24 (11000) 011010 26 29 29 (11101) 011111 31 State Diagram M[MAR] MDR R R R MDR M[MAR] R7 PC R MDR M[MAR] R MDR M[MAR] R 16 R R 28 24

Exercise For the word stored at address 33 in the control ROM, give the most leftmost 10 bits the microsequencing (next state) bits Control Address 33 48 47 46 45 44 43 42 41 40 39 38 0 0 0 0 1 1 0 0 0 0 1 IRD COND J CONTROL SIGNALS If R=0 then next state=33 If R=1 then next state=35

Micro-sequence Control COND TEST BIT COMPUTED CONDITION TESTED BRANCH 000 NO TEST UNCONDITIONAL NO CHANGE 001 R MEMORY READ COMPLETED 010 BEN SUCESFUL CONDITIONAL BRANCH J[1]=1 J[2]=1 011 IR[11] ADDRESSING MODE J[0]=1 100 PSR[15] PRIVILEGED MODE J[3]=1 101 INT INTERRUPT MODE J[4]=1

BR Instruction BEN: Branch Enable flip-flop BEN = 1 if branch condition in BR instruction matches values of NZP BEN = 0 otherwise

BR Instruction (cont.) In State 32 (instruction decode) BEN IR[11] N + IR[10] Z + IR[9] P

Execute Phase of BRnz Example: BRnz has N=Z=1, P=0 Branches to PC + sext(offset9) if 1 N + 1 Z + 0 P = N + Z State 0 If BEN = 0 go to State 18 = 010010 (begin fetch) If BEN = 1 go to State 22 = 010110 (22=18+4) Control Address 18 48 47 46 45 44 43 42 41 40 39 38 0 0 0 1 0 0 1 0 0 1 0 IRD COND J CONTROL SIGNALS J[5]=0 J[4]=1 J[3]=0 J[2]=0+BEN J[1]=1 J[0]=0

State 22 Execute Phase of BRnz (cont.) PC PC + sext(offset9) Go to State 18 (begin fetch) Control Address 22 48 47 46 45 44 43 42 41 40 39 38 0 0 0 0 0 0 1 0 0 1 0 IRD COND J CONTROL SIGNALS Control Address 18 48 47 46 45 44 43 42 41 40 39 38 0 0 1 0 1 1 0 0 0 0 1 IRD COND J CONTROL SIGNALS