DOC PREVIEW
MIT 6 111 - Lecture Notes

This preview shows page 1-2-22-23 out of 23 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 23 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

6.111 Lecture 6I. Blocking vs. Nonblocking AssignmentsAssignment Styles for Sequential LogicUse Nonblocking for Sequential LogicUse Blocking for Combinational LogicImplementation for on/off buttonII. Single-clock Synchronous CircuitsClocked circuit for on/off buttonAsynchronous Inputs in Sequential SystemsAsynchronous Inputs in Sequential SystemsHandling MetastabilityIII. Finite State MachinesExample 1: Light SwitchExample 2: 4-bit CounterExample 2: 4-bit CounterExample 2: 4-bit CounterTwo Types of FSMsDesign Example: Level-to-PulseStep 1: State Transition DiagramStep 2: Logic DerivationStep 2: Logic DerivationMoore Level-to-Pulse ConverterMoore Level-to-Pulse ConverterDesign of a Mealy Level-to-PulseMealy Level-to-Pulse ConverterMealy Level-to-Pulse ConverterMoore/Mealy Trade-OffsFSM Timing RequirementsSummary6.111 Fall 2005 Lecture 6, Slide 16.111 Lecture 6Today:1.Blocking vs. non-blocking assignments2.Single clock synchronous circuits3.Finite State Machines6.111 Fall 2005 Lecture 6, Slide 2I. Blocking vs. Nonblocking AssignmentsConceptual need for two kinds of assignment (in always blocks):abcxyaba = bb = ax = a & by = x | cBlocking:Evaluation and assignment are immediatea <= bb <= ax <= a & by <= x | cNon-Blocking:Assignment is postponed until all r.h.s. evaluations are doneWhen to use:Sequential CircuitsCombinatorial Circuits( only in always blocks! )6.111 Fall 2005 Lecture 6, Slide 3Assignment Styles for Sequential LogicDQDQDQin outq1 q2clkFlip-Flop Based Digital Delay Line• Will nonblocking and blocking assignments both produce the desired result?module nonblocking(in, clk, out);input in, clk;output out;reg q1, q2, out;always @ (posedge clk) beginq1 <= in;q2 <= q1;out <= q2;end module blocking(in, clk, out);input in, clk;output out;reg q1, q2, out;always @ (posedge clk) beginq1 = in;q2 = q1;out = q2;end endmodule endmodule6.111 Fall 2005 Lecture 6, Slide 4Use Nonblocking for Sequential LogicDQDQDQin outq1 q2clkalways @ (posedge clk) beginq1 <= in;q2 <= q1;out <= q2;end“At each rising clock edge, q1, q2, and out simultaneously receive the old valuesof in, q1, and q2.”always @ (posedge clk) beginq1 = in;q2 = q1;out = q2;end “At each rising clock edge, q1 = in. After that, q2 = q1 = in; After that,out = q2 = q1 = in; Finally out = in.”DQinoutclkq1q2• Blocking assignments do not reflect the intrinsic behavior of multi-stage sequential logic• Guideline: use nonblocking assignments for sequentialalways blocksx <= a & b;0 1 0 1 1 x<=0Assignment completion0 1 0 01Use Blocking for Combinational Logic6.111 Fall 2005 Lecture 6, Slide 5• Nonblocking assignments do not reflect the intrinsic behavior of multi-stage combinational logic• While nonblocking assignments can be hacked to simulate correctly (expand the sensitivity list), it’s not elegant• Guideline: use blocking assignments for combinationalalways blocks(Given) Initial ConditionBlocking Behaviora b c x y1 1 0 1 1(Given) Initial Conditiona b c x y Deferred1 1 0 1 1Nonblocking Behavioralways @ (a or b or c) beginx <= a & b;y <= x | c;endalways @ (a or b or c) beginx = a & b;y = x | c;endabcxya changes; always block triggered0 1 0 1 1x = a & b;0 1 0 0 1y = x | c;0 1 0 0 0a changes; always block triggered0 1 0 1 1y <= x | c;0 1 0 1 1 x<=0, y<=16.111 Fall 2005 Lecture 6, Slide 6Implementation for on/off buttonbuttonlightmodule onoff(button,light);input button;output light;reg light;always @ (posedge button)beginlight <= ~light;endendmoduleDQBUTTONLIGHTQ6.111 Fall 2005 Lecture 6, Slide 7II. Single-clock Synchronous CircuitsWe’ll use Flip Flops and Registers – groups of FFs sharing a clock input – in a highly constrained way to build digital systems.Single-clock Synchronous Discipline:• No combinational cycles• Only care about value of combinational circuits just before rising edge of clock• Period greater than everycombinational delay• Change saved state after noise-inducing logic transitions have stopped!• Single clock signal shared among all clocked devices6.111 Fall 2005 Lecture 6, Slide 8Clocked circuit for on/off buttonmodule onoff(clk,button,light);input clk,button;output light;reg light;always @ (posedge clk)beginif (button) light <= ~light;endendmoduleDQBUTTONLIGHTCLK01QDLECLKLOAD-ENABLED REGISTERSINGLE GLOBAL CLOCKDoes this work with a 1Mhz CLK?6.111 Fall 2005 Lecture 6, Slide 9Asynchronous Inputs in Sequential SystemsWhat about external signals?Can’t guarantee setup and hold times will be met!Sequential SystemClockWhen an asynchronous signal causes a setup/hold violation...ClockQDITransition is missed on first clock cycle, but caught on next clock cycle.IITransition is caught on first clock cycle.?IIIOutput is metastablefor an indeterminate amount of time.Q: Which cases are problematic?6.111 Fall 2005 Lecture 6, Slide 10Asynchronous Inputs in Sequential SystemsAll of them can be, if more than one happens simultaneously within the same circuit.Idea: ensure that external signals directly feed exactly one flip-flopDQSequential SystemClockD QD QQ0ClockClockQ1Async InputClocked Synchronous SystemThis prevents the possibility of I and II occurring in different places in the circuit, but what about metastability?6.111 Fall 2005 Lecture 6, Slide 11Handling Metastability• Preventing metastability turns out to be an impossible problem• High gain of digital devices makes it likely that metastable conditions will resolve themselves quickly• Solution to metastability: allow time for signals to stabilizeDQComplicated Sequential Logic SystemClockDQDQLikely to be metastableright after samplingExtremely unlikely to be metastable for >2 clock cycleVery unlikely to be metastable for >1 clock cycleHow many registers are necessary?• Depends on many design parameters(clock speed, device speeds, …)• In 6.111, a pair of synchronization registers is sufficient6.111 Fall 2005 Lecture 6, Slide 12III. Finite State Machines• Finite State Machines (FSMs) are a useful abstraction for sequential circuits with centralized “states”of operation• At each clock edge, combinational logic computes outputsand next stateas a function of inputsand present stateCombinationalLogicFlip-FlopsQDinputs+presentstatenoutputs+nextstatenCLK6.111 Fall 2005 Lecture 6, Slide 13Example 1: Light Switch• State transition diagramLIGHT= 0LIGHT= 1BUTTON=1BUTTON=1BUTTON=0 BUTTON=0DQBUTTONLIGHTCLK01Combinatorial logicRegister• Logic diagram6.111 Fall 2005 Lecture 6, Slide 17Two Types of


View Full Document

MIT 6 111 - Lecture Notes

Documents in this Course
Verilog

Verilog

21 pages

Video

Video

28 pages

Bass Hero

Bass Hero

17 pages

Deep 3D

Deep 3D

12 pages

SERPENT

SERPENT

8 pages

Vertex

Vertex

92 pages

Vertex

Vertex

4 pages

Snapshot

Snapshot

15 pages

Memories

Memories

42 pages

Deep3D

Deep3D

60 pages

Design

Design

2 pages

Frogger

Frogger

11 pages

SkiFree

SkiFree

81 pages

Vertex

Vertex

10 pages

EXPRESS

EXPRESS

2 pages

Labyrinth

Labyrinth

81 pages

Load more
Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?