Admin. ECE 550: Fundamentals of Computer Systems and Engineering. Last time. VHDL: Behavioral vs Structural. Memory Elements



Similar documents
EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

Set-Reset (SR) Latch

7. Latches and Flip-Flops

CSE140: Components and Design Techniques for Digital Systems

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

Lecture-3 MEMORY: Development of Memory:

Register File, Finite State Machines & Hardware Control Language

Timing Methodologies (cont d) Registers. Typical timing specifications. Synchronous System Model. Short Paths. System Clock Frequency

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

Sequential Circuits. Combinational Circuits Outputs depend on the current inputs

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

Clocking. Figure by MIT OCW Spring /18/05 L06 Clocks 1

Lesson 12 Sequential Circuits: Flip-Flops

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

CHAPTER 11: Flip Flops

Lecture 10: Sequential Circuits

Lecture 11: Sequential Circuit Design

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

Flip-Flops, Registers, Counters, and a Simple Processor

GETTING STARTED WITH PROGRAMMABLE LOGIC DEVICES, THE 16V8 AND 20V8

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012

Flip-Flops and Sequential Circuit Design

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Digital Logic Design Sequential circuits

ASYNCHRONOUS COUNTERS

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

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

Layout of Multiple Cells

EXPERIMENT 8. Flip-Flops and Sequential Circuits

SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

Combinational Logic Design Process

Topics of Chapter 5 Sequential Machines. Memory elements. Memory element terminology. Clock terminology

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

Memory Elements. Combinational logic cannot remember

if-then else : 2-1 mux mux: process (A, B, Select) begin if (select= 1 ) then Z <= A; else Z <= B; end if; end process;

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

Lecture 7: Clocking of VLSI Systems

VHDL GUIDELINES FOR SYNTHESIS

Latch Timing Parameters. Flip-flop Timing Parameters. Typical Clock System. Clocking Overhead

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

Lecture 5: Gate Logic Logic Optimization

Lecture 10 Sequential Circuit Design Zhuo Feng. Z. Feng MTU EE4800 CMOS Digital IC Design & Analysis 2010

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

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

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

Lecture 8: Synchronous Digital Systems

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

The enable pin needs to be high for data to be fed to the outputs Q and Q bar.

SECTION C [short essay] [Not to exceed 120 words, Answer any SIX questions. Each question carries FOUR marks] 6 x 4=24 marks

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

CHAPTER 11 LATCHES AND FLIP-FLOPS

BINARY CODED DECIMAL: B.C.D.

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Chapter 2 Logic Gates and Introduction to Computer Architecture

A Verilog HDL Test Bench Primer Application Note

IE1204 Digital Design F12: Asynchronous Sequential Circuits (Part 1)

Topics. Flip-flop-based sequential machines. Signals in flip-flop system. Flip-flop rules. Latch-based machines. Two-sided latch constraint

Sequential Logic Design Principles.Latches and Flip-Flops

Lecture 10: Latch and Flip-Flop Design. Outline

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

CS311 Lecture: Sequential Circuits

Sequential Circuit Design

CNC FOR EDM MACHINE TOOL HARDWARE STRUCTURE. Ioan Lemeni

Counters and Decoders

Chapter 6: From Digital-to-Analog and Back Again

Sequential 4-bit Adder Design Report

Memory unit. 2 k words. n bits per word

University of St. Thomas ENGR Digital Design 4 Credit Course Monday, Wednesday, Friday from 1:35 p.m. to 2:40 p.m. Lecture: Room OWS LL54

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

MAX II ISP Update with I/O Control & Register Data Retention

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann

Engr354: Digital Logic Circuits

2 : BISTABLES. In this Chapter, you will find out about bistables which are the fundamental building blocks of electronic counting circuits.

ECE124 Digital Circuits and Systems Page 1

Computer organization

Chapter 8. Sequential Circuits for Registers and Counters

Chapter 2 Clocks and Resets

Fairchild Solutions for 133MHz Buffered Memory Modules

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

EE552. Advanced Logic Design and Switching Theory. Metastability. Ashirwad Bahukhandi. (Ashirwad Bahukhandi)

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

Systems I: Computer Organization and Architecture

Registers & Counters

Decimal Number (base 10) Binary Number (base 2)

Understanding Logic Design

E158 Intro to CMOS VLSI Design. Alarm Clock

CSE140: Components and Design Techniques for Digital Systems

Chapter 9 Latches, Flip-Flops, and Timers

I 2 S bus specification

Chapter 5. Sequential Logic

A New Paradigm for Synchronous State Machine Design in Verilog

EE360: Digital Design I Course Syllabus

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Microprocessor & Assembly Language

Module 3: Floyd, Digital Fundamental

Transcription:

Admin C 55: Fundamentals of Computer ystems and ngineering torage and Clocking eading Finish up Chapter ecitation How is it going? VHL questions/issues? Homework Homework ubmissions vis akai C 55 (Hilton): torage and Clocking C 55 (Hilton): torage and Clocking 2 VHL: Behavioral vs tructural A few words about this tructural: pell out at (roughly) gate level Abstract piece into entities for abstraction/re-use Very easy to understand what synthesis does to it Behavioral: pell out at higher level equential statements, for loops, process blocks Can be difficult to understand how it synthesizes ifficult to resolve performance issues Last time Who can remind us what we did last time? C 55 (Hilton): torage and Clocking C 55 (Hilton): torage and Clocking 4 o far We can make logic to compute math Add, subtract, (we ll see multiply/divide later) Bitwise: AN, O, NOT, hifts election (MUX) pretty much anything But processors need state (hold value) egisters Memory lements All the circuits we looked at so far are combinational circuits: the output is a Boolean function of the inputs. We need circuits that can remember values. (registers) The output of the circuit is a function of the input AN a function of a stored value (state). Circuits with memory are called sequential circuits. Key to storage: loops from outputs to inputs C 55 (Hilton): torage and Clocking 5 C 55 (Hilton): torage and Clocking 6

NO-based et-eset () Latch et-eset Latch (Continued) - on t set both & to C 55 (Hilton): torage and Clocking 7 C 55 (Hilton): torage and Clocking 8 et-eset Latch (Continued) et-eset Latch (Continued) et ignal Goes High et ignal Goes Low Output ignal Goes High C 55 (Hilton): torage and Clocking 9 Output ignal tays High C 55 (Hilton): torage and Clocking et-eset Latch (Continued) Latch ownside: and at once = chaos ownside: Bad interface o let s build on it to do better Until eset ignal Goes High Then Output ignal Goes Low C 55 (Hilton): torage and Clocking C 55 (Hilton): torage and Clocking 2

ata Latch ( Latch) ata Latch ( Latch) nable ata We start with Latch We start with Latch..and add some gates at the front which change the interface ata + nable C 55 (Hilton): torage and Clocking C 55 (Hilton): torage and Clocking 4 ata Latch ( Latch) ata Latch ( Latch) nable - ata goes high nable - ata goes low oes not affect Output ed tays as output Output unchanged By changes to C 55 (Hilton): torage and Clocking 5 C 55 (Hilton): torage and Clocking 6 ata Latch ( Latch) ata Latch ( Latch) nable - ata goes high ed Becomes new output nable - ata light elay ( gates take time) C 55 (Hilton): torage and Clocking 7 C 55 (Hilton): torage and Clocking 8

Takes takes time: Gate delays: delay to switch each gate Wire delays: delay for signal to travel down wire Clocks Processors have a clock: Alternates Latch -> logic -> in one clock cycle Fan out: related to capacitance Need to make sure that signals timing is right on t want to have races or whacky conditions.. One clock cycle.4 GHz processor =.4 Billion clock cycles/sec C 55 (Hilton): torage and Clocking 9 C 55 (Hilton): torage and Clocking 2 trawman: Level Triggered First thoughts: Level Triggered Latch enabled when clock is high Hold value when clock is low trawman: Level Triggered Clock is low, all values stable C 55 (Hilton): torage and Clocking 2 C 55 (Hilton): torage and Clocking 22 trawman: Level Triggered Clock goes high, es capture and xmit new val trawman: Level Triggered ignals work their way through logic w/ high clk C 55 (Hilton): torage and Clocking 2 C 55 (Hilton): torage and Clocking 24

trawman: Level Triggered Clock goes low before signals reach next trawman: Level Triggered Clock goes low before signals reach next C 55 (Hilton): torage and Clocking 25 C 55 (Hilton): torage and Clocking 26 trawman: Level Triggered verything stable before clk goes high trawman: Level Triggered goes high again, repeat C 55 (Hilton): torage and Clocking 27 C 55 (Hilton): torage and Clocking 28 trawman: Level Triggered Problem: What if signal reaches too early? I.e., while clk is still high trawman: Level Triggered Problem: What if signal reaches too early? ignal goes right through, into next stage.. C 55 (Hilton): torage and Clocking 29 C 55 (Hilton): torage and Clocking

That would be bad Getting into a stage too early is bad omething else is going on there: corrupted Also may be a loop with one Consider incrementing counter Too fast: increment twice? eep dge Triggered Instead of level triggered Latch a new value at a level (high or low) We use edge triggered Latch a value at an edge (rising or falling) ising dges + C 55 (Hilton): torage and Clocking Falling dges C 55 (Hilton): torage and Clocking 2 Flip-Flop Flip-Flop C C ising edge triggered Flip-flop Two Latches w/ Opposite clking of enables ising edge triggered Flip-flop Two Latches w/ Opposite clking of enables On Low, first enabled (propagates value) econd not enabled, maintains value C 55 (Hilton): torage and Clocking C 55 (Hilton): torage and Clocking 4 Flip-Flop Flip-Flop C ising edge triggered Flip-flop Two Latches w/ Opposite clking of enables On Low, first enabled (propagates value) econd not enabled, maintains value On High, second enabled First not enabled, maintains value No possibility of races anymore ven if I put 2 FFs back-to-back By the time signal gets through 2 nd of st FF st of 2 nd FF is disabled till must ensure signals reach FF before clk rises Important concern in logic design making timing C 55 (Hilton): torage and Clocking 5 C 55 (Hilton): torage and Clocking 6

Making Timing Making timing is important in a design If you don t make timing, your logic won t compute right ynthesis tool (uartus) tells you what max freq unning above this your logic doesnt finish in time Flip-flops (continued ) Could also do falling edge triggered witch which has NOT on clk Flip-flop is ubiquitous Typically people just say and mean FF Which edge: doesn t matter As long as consistent in entire design We ll use rising edge C 55 (Hilton): torage and Clocking 7 C 55 (Hilton): torage and Clocking 8 flip flops Generally don t draw clk input Have one global clk, assume it goes there Often see > as symbol meaning clk Maybe have explicit enable Might not want to write every cycle If no enable signal shown, implies always enabled FF > FFs in VHL x: dffe port map ( clk => clk, d => someinput, q => theoutput, ena => en, --the clock clrn => not(rst), --clear prn => ''); --the input is d --the output is q --the enable --set FF FF Also, comes in dff with no enable Get output and NOT(output) for free C 55 (Hilton): torage and Clocking 9 C 55 (Hilton): torage and Clocking 4 A word of advice A few words about timing x_d signal x_q : std_logic; signal x_d: std_logic; x : dffe port map (, d=> x_d, q=>x_q, ); Use naming convention: x_d, x_q Write x_d, read x_q emember new value shows up next cycle x x_q Homework 2: VGA Controller equires certain clock frequency lse won t control monitor properly uartus will tell you what timing you make Fmax : how fast can this be clocked Tells you your worst timing paths From which dff to which dff Can see in schematic viewer (usually) Homework 2 hould be plenty of slack But if not C 55 (Hilton): torage and Clocking 4 C 55 (Hilton): torage and Clocking 42

Fixing timing misses Typical approach: reduce logic (gate delays) Better adder? ethink approach? Change don t care behavior? Fix high fanout uplicate high FO/simple logic Also, feel free to ask for help from me/tas uartus s tools to help you fix them aren t the best egister File Can store one value How about many? egister File In processor, holds values it computes on MIP, 2 2-bit registers How do we build a egister File using Flip-Flops? What other components do we need? C 55 (Hilton): torage and Clocking 4 C 55 (Hilton): torage and Clocking 44 egister File: Interface egister file strawman rnumw Wval rnuma egister File rnumb 4 inputs register numbers (5 bit): 2 read, write register write value (2 bits) 2 outputs 2 register values (2 bits) Aval Bval Use a mux to pick read? 2 input mux = slow (other regs not pictured) 2 bit reg 2 bit reg 2 bit reg 2 bit reg C 55 (Hilton): torage and Clocking 45 C 55 (Hilton): torage and Clocking 46 egister file strawman First: A ecoder Use a mux to pick read? 2 input mux = slow other regs not pictured Writing the registers Need to pick which reg Have reg num (e.g., 9) Need to make n9= n, n, = Wrata 2 bit reg n 2 bit reg n 2 bit reg n 2 bit reg n First task: convert binary number to one hot aw this before Take register number ecoder C 55 (Hilton): torage and Clocking 47 C 55 (Hilton): torage and Clocking 48

egister File Now we know how to write: Use decoder to convert reg # to one hot end write data to all regs Use one hot encoding of reg # to enable right reg till need to fix read side 2 input mux (the way we ve made it) not realistic To do this: expand our world from, to,, Z C 55 (Hilton): torage and Clocking 49 CMO: Complementary MO Vcc Output Gnd 2 inputs: and. What does this do? Output Write truth table for output C 55 (Hilton): torage and Clocking 5 CMO: Complementary MO Vcc CMO: Complementary MO Vcc Output Output Gnd Gnd 2 inputs: and. What does this do? Write truth table for output When =, straightforward Output C 55 (Hilton): torage and Clocking 5 2 inputs: and. What does this do? Write truth table for output When =, straightforward When =, no connection: Z Output Z Z C 55 (Hilton): torage and Clocking 52 High Impedance: Z Z = High Impedance No path to power or ground Gate does not produce a or a Previous slide: tri-state inverter More commonly drawn: tri-state buffer = enable, = data Out on t care Out X Z C 55 (Hilton): torage and Clocking 5 emember this rule? emember I told you not to connect two outputs? a b c d BA! If one gate tries to drive a and the other drives a One pumps water in.. The other sucks it out xcept its electric charge, not water hort circuit lots of current -> lots of heat C 55 (Hilton): torage and Clocking 54

We ve had this rule one day... Its ok to connect multiple outputs together Under one circumstance (*): All but one must be outputting Z at any time (*) isclaimer: there are other circumstances but not doing them now C 55 (Hilton): torage and Clocking 55 Mux, implemented with tri-states We can build effectively a mux from tri-states Much more efficient for large #s of inputs (e.g., 2) 5 ecoder C 55 (Hilton): torage and Clocking 56 2 bit reg 2 bit reg 2 bit reg 2 bit reg Ports What we just saw: read port Ability to do one read / clock cycle Originally said want 2 reads: read 2 src registers /insn Maybe even more if we do many insns at once This design: can just put replicate Another decoder Another set of tri-states Another output bus (wire connecting the tri-states) arlier: write port Ability to do one write/cycle Could add more: need muxes to pick wr values Minor etail FYI: This is not how a register file is implemented (Though it is how other things are implemented) Actually done with AM We ll see how those work soon C 55 (Hilton): torage and Clocking 57 C 55 (Hilton): torage and Clocking 58 ummary Can layout logic to compute things Add, subtract, Now can store things flip-flops egisters Also understand clocks C 55 (Hilton): torage and Clocking 59