EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 2

Similar documents
Department of Electrical Engineering, University of Waterloo. Introduction

Physics 2010 Motion with Constant Acceleration Experiment 1

Medium Scale Integrated (MSI) devices [Sections 2.9 and 2.10]

ENG2410 Digital Design Sequencing and Control

Differentiation Applications 1: Related Rates

Turing Machines. Human-aware Robotics. 2017/10/17 & 19 Chapter 3.2 & 3.3 in Sipser Ø Announcement:

ENG2410 Digital Design Sequential Circuits: Part A

ELE Final Exam - Dec. 2018

Activity Guide Loops and Random Numbers

Section 5.8 Notes Page Exponential Growth and Decay Models; Newton s Law

Pipetting 101 Developed by BSU CityLab

ECE 545 Project Deliverables

Rotating Paddle Switch SITRANS LPS200. Functional Safety Manual 05/2016 SITRANS

Thermodynamics and Equilibrium

ENG2410 Digital Design Sequential Circuits: Part B

This section is primarily focused on tools to aid us in finding roots/zeros/ -intercepts of polynomials. Essentially, our focus turns to solving.

ENG2410 Digital Design Arithmetic Circuits

Lesson Plan. Recode: They will do a graphic organizer to sequence the steps of scientific method.

Flipping Physics Lecture Notes: Simple Harmonic Motion Introduction via a Horizontal Mass-Spring System

SPH3U1 Lesson 06 Kinematics

CONSTRUCTING STATECHART DIAGRAMS

Plan o o. I(t) Divide problem into sub-problems Modify schematic and coordinate system (if needed) Write general equations

Five Whys How To Do It Better

CS 477/677 Analysis of Algorithms Fall 2007 Dr. George Bebis Course Project Due Date: 11/29/2007

making triangle (ie same reference angle) ). This is a standard form that will allow us all to have the X= y=

Potential and Capacitance

Chapter 3 Kinematics in Two Dimensions; Vectors

Name Student ID. A student uses a voltmeter to measure the electric potential difference across the three boxes.

8 Bit RISC Processor Using Verilog HDL

If (IV) is (increased, decreased, changed), then (DV) will (increase, decrease, change) because (reason based on prior research).

Flipping Physics Lecture Notes: Simple Harmonic Motion Introduction via a Horizontal Mass-Spring System

Chapter 9 Compressible Flow 667

Lecture 13 - Boost DC-DC Converters. Step-Up or Boost converters deliver DC power from a lower voltage DC level (V d ) to a higher load voltage V o.

MODULE 1. e x + c. [You can t separate a demominator, but you can divide a single denominator into each numerator term] a + b a(a + b)+1 = a + b

CHM112 Lab Graphing with Excel Grading Rubric

Purpose: Use this reference guide to effectively communicate the new process customers will use for creating a TWC ID. Mobile Manager Call History

L a) Calculate the maximum allowable midspan deflection (w o ) critical under which the beam will slide off its support.

Physics 212. Lecture 12. Today's Concept: Magnetic Force on moving charges. Physics 212 Lecture 12, Slide 1

Edexcel GCSE Physics

Trigonometric Ratios Unit 5 Tentative TEST date

AP Physics Kinematic Wrap Up

ECE-320: Linear Control Systems Homework 1. 1) For the following transfer functions, determine both the impulse response and the unit step response.

AIP Logic Chapter 4 Notes

Fall 2013 Physics 172 Recitation 3 Momentum and Springs

Computational modeling techniques

GENERAL FORMULAS FOR FLAT-TOPPED WAVEFORMS. J.e. Sprott. Plasma Studies. University of Wisconsin

Chapter 8. Root Locus Techniques

MODULE FOUR. This module addresses functions. SC Academic Elementary Algebra Standards:

Projectile Motion. What is projectile? Projectile -Any object which projected by some means and continues to move due to its own inertia (mass).

NUMBERS, MATHEMATICS AND EQUATIONS

Grumman F-14 Tomcat Control Design BY: Chike Uduku

Work, Energy, and Power

Experiment #3. Graphing with Excel

Chem 163 Section: Team Number: ALE 24. Voltaic Cells and Standard Cell Potentials. (Reference: 21.2 and 21.3 Silberberg 5 th edition)

CHEM 2400/2480. Lecture 19

READING STATECHART DIAGRAMS

A B C. 2. Some genes are not regulated by gene switches. These genes are expressed constantly. What kinds of genes would be expressed constantly?

IAML: Support Vector Machines

The Law of Total Probability, Bayes Rule, and Random Variables (Oh My!)

, which yields. where z1. and z2

Physics 2B Chapter 23 Notes - Faraday s Law & Inductors Spring 2018

Kinetic Model Completeness

Hypothesis Tests for One Population Mean

Homology groups of disks with holes

CHAPTER 8b Static Equilibrium Units

BASIC DIRECT-CURRENT MEASUREMENTS

1. Transformer A transformer is used to obtain the approximate output voltage of the power supply. The output of the transformer is still AC.

CHAPTER 24: INFERENCE IN REGRESSION. Chapter 24: Make inferences about the population from which the sample data came.

Nonisothermal Chemical Reactors

Chapter 3: Cluster Analysis

OTHER USES OF THE ICRH COUPL ING CO IL. November 1975

Three charges, all with a charge of 10 C are situated as shown (each grid line is separated by 1 meter).

Getting Involved O. Responsibilities of a Member. People Are Depending On You. Participation Is Important. Think It Through

Thermodynamics Partial Outline of Topics

COMP 551 Applied Machine Learning Lecture 5: Generative models for linear classification

Lecture 7: Damped and Driven Oscillations

Lab 1 The Scientific Method

Purchase Order Workflow Processing

Misc. ArcMap Stuff Andrew Phay

AP Physics. Summer Assignment 2012 Date. Name. F m = = + What is due the first day of school? a. T. b. = ( )( ) =

Bootstrap Method > # Purpose: understand how bootstrap method works > obs=c(11.96, 5.03, 67.40, 16.07, 31.50, 7.73, 11.10, 22.38) > n=length(obs) >

Group Color: Subgroup Number: How Science Works. Grade 5. Module 2. Class Question: Scientist (Your Name): Teacher s Name: SciTrek Volunteer s Name:

Lecture 5: Equilibrium and Oscillations

CHAPTER 2 Algebraic Expressions and Fundamental Operations

x 1 Outline IAML: Logistic Regression Decision Boundaries Example Data

Lecture 2: Supervised vs. unsupervised learning, bias-variance tradeoff

Why Don t They Get It??

ENSC Discrete Time Systems. Project Outline. Semester

TOPPER SAMPLE PAPER 2 Class XII- Physics

Lecture 2: Supervised vs. unsupervised learning, bias-variance tradeoff

[COLLEGE ALGEBRA EXAM I REVIEW TOPICS] ( u s e t h i s t o m a k e s u r e y o u a r e r e a d y )

Admin. MDP Search Trees. Optimal Quantities. Reinforcement Learning

AP Statistics Notes Unit Two: The Normal Distributions

Conservation of Momentum

Unit 9: The Mole- Guided Notes What is a Mole?

B. Definition of an exponential

k-nearest Neighbor How to choose k Average of k points more reliable when: Large k: noise in attributes +o o noise in class labels

BASD HIGH SCHOOL FORMAL LAB REPORT

GRADE 5 QUARTER 4 SUGGESTED PACING

Tutorial 3: Building a spectral library in Skyline

Transcription:

EE108A Lecture 10: Micrcde EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 1 Annuncement Prblem et 3 due Lab 4 hint D a gd clean deign Lab 5 and the final prject will reue mt f thi lab Yu ll regret any mitake here fr the ret f the quarter We ve detailed the interface t try and make thi eaier Undertand hw the lab wrk, nt jut hw t build it Hw ine wave are generated (handut) Hw t make FSM Timing Diagram t deal with memrie and data path (lat ectin f lab handut) Hw all the mdule interact (a gd blck diagram really help) Split up mdule deign and teting Decide n hw a mdule huld wrk a a grup Have ne pern deign it and the ther pern write the tet bench Find errr in deign and decriptin Watch yur timing Check yur ynthei reprt t make ure yu are meeting timing (If yur critical path i t lng yur deign invalid.) Run the timing analyzer and find the path that are t lw Find the path n yur blck diagram and figure ut where t inert pipeline regiter t plit up the lng path withut ling ynchrnizatin. (Hint: befre and after multiplier, but watch ut fr cntrl path!) EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 2 1

Micrcde an FSM realized with a memry array Original cncept by Wilke (1951) Put tate table in a memry (ROM r RAM) ROM Addre = {current tate, input} ROM Output = {next tate, utput} Effectively replace the cmbinatinal next tate lgic blck with the full truth table. Why i thi gd? Why might thi be bad? EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 3 Micrcde the picture Lk a lt like the cmbinatinal lgic blck frm regular FSM. next D Q tate +i a Memry d + input i n_ut D Q ut Memry ize: Ttal: 2 +i addree + bit per addre 2 +i *(+) bit clk EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 4 2

Example: Simple Light-Traffic Cntrller carew gn carew yn gew yew 100 001 010 001 001 100 001 010 tate utput gyr gyr n ew EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 5 Re-writing State Table Of Example ROM Addre: {tate, input} ROM Output: {next tate, utput} State Next State Output State carew addre data!carew carew gn 00 0 000 00100001 gn 00 00 01 100001 00 1 001 01100001 yn 01 11 11 010001 yn 01 0 010 11010001 gew 11 10 10 001100 01 1 011 11010001 yew 10 00 00 001010 gew 11 0 110 10001100 11 1 111 10001100 yew 10 0 100 00001010 10 1 101 00001010 Nte: We ve enumerated every pible cmbinatin f input and tate. I thi efficient? EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 6 3

Micrcde Of Light-Traffic Cntrller carew 000: 00100001 001: 01100001 010: 11010001 011: 11010001 3 100: 10001100 8 101: 10001100 110: 00001010 111: 00001010 next 2 n_ut 6 D D Q Q 2 6 tate light clk EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 7 Micrcded Traffic Light Cntrller in Verilg mdule ucdetlc(clk,rt,in,ut) ; parameter n = 1 ; // input width parameter m = 6 ; // utput width parameter k = 2 ; // bit f tate input clk, rt ; input [n-1:0] in ; utput [m-1:0] ut ; wire [k-1:0] next, tate ; wire [k+m-1:0] uint ; DFF #(k) tate_reg(clk, next, tate) ; // tate regiter DFF #(m) ut_reg(clk, uint[m-1:0], ut) ; // utput regiter ROM #(n+k,m+k) uc({tate, in}, uint) ; // micrcde tre aign next = rt? {k{1'b0}} : uint[m+k-1:m] ; // reet tate endmdule EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 8 4

Wavefrm Of Light-Traffic Cntrller Micrcde 00100001 01100001 10010001 10010001 11001100 11001100 00001010 00001010 EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 9 A New-and-Imprved Light-Traffic Cntrller Additinal functin t riginal Light-Traffic Cntrller: Light tay green in eat-wet directin a lng a car_ew i true. Light tay green in nrth-uth directin fr a minimum f 3 tate (GNS1, GNS2, and GNS3). After a yellw light, light huld g red in bth directin fr 1 cycle befre turning new light green. EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 10 5

Light-Traffic Cntrl State Diagram car_ew GNS1 GNS2 GNS3 car_ew YNS 100 001 100 001 100 001 010 001 car_ew REW YEW car_ew GEW RNS 001 001 001 010 001 100 001 001 EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 11 Light-Traffic Cntrller State Micrcde EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 12 6

Wavefrm Of Light-Traffic Cntrller Micrcde 001100001 001100001 010100001 010100001 010100001 011100001 100010001 100010001 101001001 101001001 110001100 101001100 111001010 111001010 000001001 000001001 EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 13 Intructin Sequencing With lt f input, ize f memry increae rapidly (expnentially). Can reduce memry ize by berving: Mt f the time we mve t the next tate. We uually nly need t branch t ne ther tate baed ne (r a few) input. Add a micrprgram cunter (µpc) regiter t implify tate equencing. (Think f the PC a the current tate f the FSM.) Next tate i nw µpc+1 unle we are branching EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 14 7

Intructin Sequencing the picture branch_target Mux3 +1 0 nextpc µpc 1 D Q a Memry d ++b 0 2 n_ut D Q 3 input i Branch Lgic clk ut branch_intructin b EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 15 Branching Lgic Branch lgic elect between µpc+1 and branch_target, depending n input and branch_intructin. Intructin are f the frm branch if f(input) Fr example branch if car_ew r branch if nt car_ew NOTE: The example ha changed here. Input are nw car Eat/Wet and Left Turn fr Nrth/Suth. Output are nw: NS{gyr}LT{gyr}EW{gyr} Lgic: tay green Eat/Wet until a Left Turn input cme in. EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 16 8

Branch Micrintructin Opcde NOP br brlt brnlt brew brnew Encding 000 100 001 101 010 110 Decriptin N branch alway g t next intructin Alway branch Branch when left-turn car i detected Branch if n left-turn car i detected Branch when eat-wet car i detected Branch if n eat-wet car i detected EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 17 Micrcde Of Traffic-Light Cntrller With Branche State Addr Int Target Output ng1 0000 brlt lt1 100001001 green n ng2 0001 brnew ng1 100001001 green n ew1 0010 np 010001001 yellw n ew2 0011 brew ew2 001001100 green ew ew3 0100 br ng1 001001010 yellw ew lt1 0101 np 010001001 yellw n lt2 0110 brlt lt2 001100001 green lt lt3 0111 br ng1 001001010 yellw lt EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 18 9

Micrintructin Frmat br int br target utput b Fr ur example: b = 3 = 4 = 9 EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 19 Implementing Micrcde Of Light-Traffic Cntrller With Branche Uing Verilg mdule ucdeis(clk,rt,in,ut) ; parameter n = 2 ; // input width parameter m = 9 ; // utput width parameter k = 4 ; // bit f tate parameter j = 3 ; // bit f intructin input clk, rt ; input [n-1:0] in ; utput [m-1:0] ut ; wire [k-1:0] nupc, upc ; // micrprgram cunter wire [j+k+m-1:0] uint ; // micrintructin wrd // plit ff field f micrintructin wire [m-1:0] nxt_ut ; // = uint[m-1:0] ; wire [k-1:0] br_upc ; // = uint[m+k-1:m] ; wire [j-1:0] brint ; // = uint[m+j+k-1:m+k] ; aign {brint, br_upc, nxt_ut} = uint ; DFF #(k) upc_reg(clk, nupc, upc) ; // micrprgram cunter DFF #(m) ut_reg(clk, nxt_ut, ut) ; // utput regiter ROM #(k,m+k+j) uc(upc, uint) ; // micrcde tre // branch intructin decde wire branch = (brint[0] & in[0] brint[1] & in[1]) ^ brint[2] ; // equencer aign nupc = rt? {k{1'b0}} : branch? br_upc : upc + 1'b1 ; endmdule EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 20 10

Micrcde Of Light-Traffic Cntrller With Left Turn EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 21 Wavefrm Of Light-Traffic Cntrller With Left Turn Micrcde 0010101100001001 1100000100001001 0000000010001001 0100011001001100 1000000001001010 0000000010001001 0010110001100001 1000000001010001 EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 22 11

Alternate Micrcde Fr Light-Traffic Cntrller With Left Turn Previu micrcde ha: 2 tate with GNS light (NS1 & NS2) 2 tate with YNS light (EW1 & LT1) By adding a new branch intructin BNA: 1 tate with GNS light (NS1) 1 tate with YNS light (NS2) EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 23 Wavefrm Of Alternate Micrcde 1110000100001001 0010100010001001 0100010001001100 1000000001001010 0010100001100001 1000000001010001 EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 24 12

Multiple Intructin Type Fr me FSM the micr-intructin wrd can tart getting a bit lng. T hrten it, we berve: Nt every tate need a branch Nt every utput change n every tate Define intructin that de jut a branch r a lad f ne regiter: brx 1yyyvvvv - branch t value vvvv n cnditin yyy ldx - 0yyyvvvv - lad regiter yyy with value vvvv Nte the tradeff: mre intructin (can nly branch r change utput n each intructin) but each intructin i much maller. EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 25 Intructin Frmat Of Micrcde With 2 Intructin Type Branch Intructin Stre Intructin 1 cnditin branch target 0 detinatin value 1 3 4 1 3 4 Branch Intructin: Operate branch mux a befre N write t utput regiter Lad Intructin: Set branch mux t +1 Update elected utput regiter: Can include ther datapath cmpnent e.g., timer in place f an utput regiter EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 26 13

Blck Diagram Of Micrcde With Output Intructin Multiple utput regiter: E.g., NS/EW/LT target/value Mux3 +1 0 nupc upc 1 D Q a Memry d x+ 0 2 3 input i Branch Lgic intructin x x Output Decde n e1 en D Q E clk D Q E clk ut1 utn EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 27 Micrcde Fr Traffic-Light Cntrller With brx & ldx Intructin Regiter t lad: ldn lad nrth/uth light with value ldlt lad left-turn light with value ldew lad eat/wet light with value ltim1 lad timer 1 with value tart timer EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 28 14

Micrcde Fr Traffic-Light Cntrller With brx & ldx Intructin (Cnt) NS Green Until input NS Yellw t Red EW r LT? Wait fr NS Red, make EW Green State Addr Int Value rt1 00000 ldlt RED rt2 00001 ldew RED n1 00010 ldn GREEN n3 00011 ltim T_GREEN n4 00100 bntz n4 n5 00101 brnle n5 n6 00110 ldn YELLOW n7 00111 ltim T_YELLOW n8 01000 bntz n8 n9 01001 ldn RED n10 01010 blt lt1 ew1 01011 ltim T_RED ew2 01100 bntz ew2 ew3 01101 ldew GREEN ew4 01110 ltim T_GREEN ew5 01111 bntz ew5 ew6 10000 ldew YELLOW EW t ew7 10001 ltim T_YELLOW Red ew8 10010 bntz ew8 ew9 10011 ldew RED Back t NS ew10 10100 br n1 Wait fr lt1 10101 ltim T_RED NS Red, lt2 10110 bntz lt2 make LT lt3 10111 ldlt GREEN Green lt4 11000 ltim T_GREEN lt5 11001 bntz lt5 lt6 11010 ldlt YELLOW LT t lt7 11011 ltim T_YELLOW Red lt8 11100 bntz lt8 lt9 11101 ldlt RED Back t NS lt10 11110 br n1 EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 29 Implementing Traffic-Light Cntrller Micrcde With brx & ldx Intructin In Verilg //---------------------------------------------------------------------- mdule ucdemi(clk,rt,in,ut) ; parameter n = 2 ; // input width parameter m = 9 ; // utput width parameter = 3 ; // utput ub-width parameter k = 5 ; // bit f tate parameter j = 4 ; // bit f intructin input clk, rt ; input [n-1:0] in ; utput [m-1:0] ut ; wire [k-1:0] nupc, upc ; // micrprgram cunter wire [j+k-1:0] uint ; // micrintructin wrd wire dne ; // timer dne ignal // plit ff field f micrintructin wire pcde ; // pcde bit wire [j-2:0] int ; // cnditin fr branch, det fr tre wire [k-1:0] value ; // target fr branch, value fr tre aign {pcde, int, value} = uint ; T be cntinued n next page EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 30 15

Implementing Traffic-Light Cntrller Micrcde With brx & ldx Intructin In Verilg (Cnt) DFF #(k) upc_reg(clk, nupc, upc) ; // micrprgram cunter ROM #(k,k+j) uc(upc, uint) ; // micrcde tre // utput regiter and timer DFFE #() r0(clk, e[0], value[-1:0], ut[-1:0]) ; // NS DFFE #() r1(clk, e[1], value[-1:0], ut[2*-1:]) ; // EW DFFE #() r2(clk, e[2], value[-1:0], ut[3*-1:2*]) ; // LT Timer #(k) tim(clk, rt, e[3], value, dne) ; // timer // enable fr utput regiter and timer wire [3:0] e = pcde? 4'b0 : 1<<int ; // branch intructin decde wire branch = pcde? (int[2] ^ (((int[1:0] == 0) & in[0]) // BLT ((int[1:0] == 1) & in[1]) // BEW ((int[1:0] == 2) & (in[0] in[1])) //BLE ((int[1:0] == 3) & dne))) // BTD : 1'b0 ; // fr a tre pcde // micrprgram cunter aign nupc = rt? {k{1'b0}} : branch? value : upc + 1'b1 ; endmdule EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 31 Summary Micrcde i jut FSM implemented with a ROM r RAM One addre fr each tate x input cmbinatin Addre cntain next tate and utput Adding a equencer reduce ize f ROM/RAM One entry per tate rather than 2 input µpc, incrementer, branch addre, and branch cntrl Adding intructin type reduce width f ROM/RAM Branch r utput in each intructin rather than bth Type field pecifie which ne Need mre intructin, but each i maller One tep away frm a full prcer Jut add mre intructin (defer until EE108B) EE 108A Lecture 9 (c) 2006 W. J. Dally and D. Black-Schaffer 32 16