outline
play

Outline snack Prereqs, Learning Goals, and Quiz Notes Problems and - PDF document

snick Outline snack Prereqs, Learning Goals, and Quiz Notes Problems and Discussion CPSC 121: Models of Computation A Pushbutton Light Switch 2016W2 Memory and Events: D Latches & Flip-Flops General Implementation of


  1. snick  Outline snack • Prereqs, Learning Goals, and Quiz Notes • Problems and Discussion CPSC 121: Models of Computation – A Pushbutton Light Switch 2016W2 – Memory and Events: D Latches & Flip-Flops – General Implementation of DFAs Building & Designing Sequential Circuits (with a more complex DFA as an example) – How Powerful are DFAs? Steve Wolfman, based on notes by • Next Lecture Notes Patrice Belleville and others 1 2 This work is licensed under a Creative Commons Attribution 3.0 Unported License. Learning Goals: Pre-Class Learning Goals: In-Class We are mostly departing from the readings By the end of this unit, you should be able to talk about a new kind of circuit on our to: way to a full computer: sequential circuits. – Translate a DFA to a corresponding sequential circuit, but with a “hole” in it for the The pre-class goals are to be able to: circuitry describing the DFA’s transitions. – Trace the operation of a deterministic finite- state automaton (represented as a diagram) – Describe the contents of that “hole” as a on an input, including indicating whether the combinational circuitry problem (and therefore DFA accepts or rejects the input. solve it, just like you do other combinational – Deduce the language accepted by a simple circuitry problems!). DFA after working through multiple example – Explain how and why each part of the inputs. resulting circuit works. 3 4 Where We Are in Outline The Big Stories • Prereqs, Learning Goals, and Quiz Notes Theory Hardware • Problems and Discussion How do we model How do we build devices to computational systems? compute? – A Pushbutton Light Switch – Memory and Events: D Latches & Flip-Flops Now : With our powerful Now : Learning to build a – General Implementation of DFAs modelling language (pred new kind of circuit with logic), we can prove memory that will be (with a more complex DFA as an example) things like universality the key new feature – How Powerful are DFAs? of NOR gates for we need to build full- • Next Lecture Notes combinational circuits. blown computers! (Something you’ve seen Our new model (DFAs) are sort of full computers. in lab from a new angle.) 5 6 1

  2. A Light Switch “DFA” ? Problem : Push-Button Light Switch Problem: Design a circuit to control a light so that the light changes state any time its pressed “push - button” switch is pressed. (Like the light switches in Dempster: Press and release, light light and the light changes state. Press and release again, off on and it changes again.) pressed ? This Deterministic Finite Automaton (DFA) isn’t really about 7 8 accepting/rejecting; its current state is the state of the light. ? Problem : COMPARE TO : ? Lecture 2’s Light Switch Light Switch Problem : Design a circuit to control a light so that the light Problem : Design a circuit to control a light so that the changes state any time its “push - button” switch is light changes state any time its switch is flipped . pressed. Identifying inputs/outputs: consider Identifying inputs/outputs: consider Which are most useful for Which are most useful for these possible inputs and outputs: these possible inputs and outputs: this problem? this problem? Input : the button was pressed or Input : the switch flipped or a. pressed and shining a. flipped and shining the button is down the switch is up b. pressed and changed b. flipped and changed c. down and shining c. up and shining Output : the light is shining or Output : the light is shining or d. down and changed d. up and changed the light changed states the light changed states e. None of these e. None of these 9 10 Departures from Outline Combinational Circuits • Prereqs, Learning Goals, and !Quiz Notes MEMORY : We need to “remember” • Problems and Discussion the light’s state. – A Pushbutton Light Switch – Memory and Events: D Latches & Flip-Flops – General Implementation of DFAs EVENTS : (with a more complex DFA as an example) We need to act on – How Powerful are DFAs? a button push rather • Next Lecture Notes than in response to an input value. 11 12 2

  3. Problem: Worked Problem: “ Muxy Memory” How Do We Remember? We want a circuit that: How do we use a mux to store a bit of memory? We choose to remember on a control value of 0 • Sometimes … remembers its current state. and to load a new state on a 1. • Other times … loads a new state to remember. ??? 0 output new data 1 Sounds like a choice . control 13 14 What circuit element do we have for modelling choices? We use “0” and “1” because that’s how MUXes are usually labelled. Worked Problem: Truth Table for “Muxy Memory” Muxy Memory Fill in the MM’s truth table: How do we use a mux to store a bit of memory? a. b. c. d. e. We choose to remember on a control value of 0 G D Q' Q Q Q Q None and to load a new state on a 1. of 0 0 0 0 0 0 0 these 0 0 1 1 1 1 0 0 1 0 0 0 0 0 old output (Q’) 0 0 1 1 1 1 1 1 output (Q) 1 0 0 0 0 0 1 new data (D) 1 1 0 1 1 0 X 1 1 1 0 0 1 X 0 control (G) 1 1 1 1 1 1 1 15 16 This violates our basic combinational constraint: no cycles. Worked Problem: Worked Problem: Truth Table for “Muxy Memory” Truth Table for “Muxy Memory” Worked Problem: Write a truth table for the Worked Problem: Write a truth table for the MM: MM: G D Q' Q G D Q' Q 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 0 0 0 1 0 0 0 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 17 18 Like a “normal” mux table, but what happens when Q'  Q? Q' “takes on” Q’s value at the “next step”. 3

  4. “D Latch” Symbol + Semantics D Latch Symbol + Semantics We call a “muxy memory” a “D latch”. When G is 0, the latch maintains its memory. When G is 0, the latch maintains its memory. When G is 1, the latch loads a new value from D. When G is 1, the latch loads a new value from D. old output (Q’) old output (Q’) 0 0 output (Q) output (Q) new data (D) 1 new data (D) 1 control (G) control (G) 20 19 D ON ’ T P ANIC ! D Latch Symbol + Semantics Hold On!! When G is 0, the latch maintains its memory. Why does the D Latch have two inputs and one output when the mux inside has THREE inputs and one When G is 1, the latch loads a new value from D. output? a. The D Latch is broken as is; it should have three inputs. new data (D) D b. A circuit can always ignore one of its inputs. Q output (Q) c. One of the inputs is always true. d. One of the inputs is always false. control (G) G e. None of these (but the D Latch is not broken as is). 21 22 Using the D Latch Using the D Latch for Circuits with Memory for Our Light Switch Problem : What goes in the cloud? What do Problem : What do we send into G? we send into G? D D current light state Q Q Combinational ?? G ?? G Circuit to calculate next state no (0 bit) input output input a. T if the button is down, F if it’s up. b. T if the button is up, F if it’s down. c. Neither of these. 23 24 We assume we just want Q as the output. 4

  5. A Timing Problem: A Timing Problem, Metaphor We Need EVENTS! (from MIT 6.004, Fall 2002) What’s wrong with this Problem : What do we send into G? tollbooth? D current light state “pulse” Q when G button is pressed output button As long as the button is down, D flows to Q P.S. Call this a “bar”, not a “gate”, pressed flows through the NOT gate and back to D... 25 26 or we’ll tie ourselves in (k)nots. which is bad! A Timing Solution, Metaphor A Timing Problem (from MIT 6.004, Fall 2002) Is this one OK? Problem : What do we send into G? D current light state “pulse” Q when G button is pressed output button As long as the button is down, D flows to Q pressed flows through the NOT gate and back to D... 27 28 which is bad! A Timing Solution (Almost) A Timing Solution D D D D Q Q Q Q L R L R G G G G Never raise both “bars” at output ?? output the same time. The two latches are never enabled at the same time (except for the moment needed for the NOT gate on the left to button compute, which is so short that no “cars” get through). pressed 29 30 5

  6. Button/Clock is LO A Timing Solution (unpressed) 1 1 D D D D Q Q Q Q L R L R 0 1 G G G G button output output press LO 0 signal We’re assuming the circuit has been set up and is “running normally”. Right now, the light is off (i.e., the output of the right latch is 0). button 31 32 pressed Button goes HI Propagating signal.. (is pressed) left NOT, right latch 1 1 1 1 D D D D Q Q Q Q L R 0 L R 1 1 0 G G G G output output HI 1 HI 1 This stuff is processing a new signal. This stuff is processing a new signal. 33 34 Propagating signal.. Button goes LO (released) right NOT (steady state) 0 0 1 1 D D D D Q Q Q Q L R 1 L R 1 0 0 G G G G output output HI 1 LO 0 Why doesn’t the left latch update? a. Its D input is 0. b. Its G input is 0. This stuff is processing a new signal. c. Its Q output is 1. 35 36 d. It should update! 6

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend