[CS61C FA20] Lecture 15.2 - State, State Machines: Register Details Flip-flops — Transcript
Full transcript
- 0:00welcome back now let's dig a little
- 0:02deeper into what is
- 0:04in the innards of a register turns out
- 0:05it's called flip-flops
- 0:07so let's see what that why they're
- 0:08called that so what's inside this
- 0:10register let's lift the hood on this
- 0:11so let's give it some names and
- 0:15register is basically an n bit register
- 0:18is basically n
- 0:19one bit flip flops that's the idea in
- 0:22parallel
- 0:24the input is called data d for data
- 0:29and the output is q for i think we call
- 0:31it quiescent it means it's stable
- 0:33quiescent q for quiescent
- 0:37so here is d n
- 0:40inputs d zero through d n minus one is
- 0:43n outputs of this one bit flip-flop
- 0:48this clock which is going to say let's
- 0:51load the register
- 0:53has to be sent to all of these guys and
- 0:55this might be the first time to show you
- 0:56whenever i show a line that isn't
- 0:59connected i'm going to try to disconnect
- 1:01it there so that's really important i'm
- 1:02going to show those lines not connecting
- 1:05whenever i show a line that is connected
- 1:07i'm going to draw a circle there to say
- 1:08that it's connected so if you ever see a
- 1:09line like this
- 1:10it's really ambiguous should have gone
- 1:12underneath and been a gap or should have
- 1:13been a circle there
- 1:14so we're never going to try to do that
- 1:16we're always going to try to make it
- 1:16very clear which one we meant
- 1:18so a circle whenever our two lines cross
- 1:20and they meant to cross it's the same
- 1:22signal just being
- 1:23forked out in a way there'll be a circle
- 1:26there
- 1:26if it's ever not connected there'll be a
- 1:28gap okay so just remember that in the
- 1:30future as you see our lines and
- 1:31hopefully we'll try to have every single
- 1:32drawing we ever show you
- 1:34so these are called flip flops or ff
- 1:37for short because the name because it
- 1:39implies that the data is going to flip
- 1:41and flop between zero and one that's the
- 1:43idea
- 1:44these data is q's output and also these
- 1:47by the way are called
- 1:47d type flip flop the other kinds of flip
- 1:49flops there used to be other kinds d
- 1:51type is now what we talk about okay
- 1:53so d-type flip-flop so that's how this
- 1:54is going to work it's d it's n
- 1:56an n-bit register is n one bit
- 1:59uh n parallel one bit flip-flops
- 2:03what's the timing let's actually go dig
- 2:05even deeper into a flip-flop now this is
- 2:06important as we start talking about
- 2:08timing diagrams
- 2:09so this one is going to be called a
- 2:12rising edge triggered and there's also
- 2:14falling edge triggered flip-flops but
- 2:15we're going to only consider rising edge
- 2:16trigger flip-flops
- 2:18in this this is also called positive
- 2:19edge which means when it goes from zero
- 2:22to one that's what it's going to trigger
- 2:24it means load okay
- 2:26so let's actually read this so it says
- 2:27on the rising edge of the clock
- 2:29the input d is sampled remember here i
- 2:31am going to use my flip flop
- 2:32i'll be a one bit flip flop one bit flip
- 2:33flop on the rising edge of the clock
- 2:36i turn around i sample i grab what the
- 2:39input d
- 2:39is and i transfer it takes some time now
- 2:42to transfer it to the output now it's a
- 2:45zero turn around
- 2:46it goes high okay load load me clock go
- 2:49up now it's a zero now i'm a zero okay
- 2:51that's why this happens
- 2:52at all of the times it's ignored i kind
- 2:54of started before it's ignored the
- 2:55input's changing i don't care
- 2:57i'm not looking at you only when i'm
- 2:59asked to load
- 3:01and that rising edge happens right turn
- 3:02around and grab the value and have it on
- 3:04the output that's the idea
- 3:06so here's an example waveform okay let's
- 3:07take a deeper dive to this waveform now
- 3:10so i've got a clock rising edges let's
- 3:14look at this rising edge
- 3:15right so this is the magic time okay
- 3:17rising edge rising edge
- 3:19and notice d is changing right
- 3:22and d can change all it wants to q
- 3:25i draw like this this is the way to draw
- 3:27it to indicate
- 3:28i don't know what it was it could have
- 3:30been a one could have a zero i kind of
- 3:31shaded inside of it it's almost like a
- 3:33filled in area i don't know what it was
- 3:35before unknown it's like garbage right i
- 3:37think
- 3:37q is garbage and only when
- 3:41there's a rising edge do i turn around
- 3:43and grab it so let's actually take a
- 3:44look
- 3:45there's my rising edge and i see
- 3:48a little bit of delay remember there's a
- 3:49delay in all these devices
- 3:51between when i grabbed it turn around
- 3:53grab it and then
- 3:55show it in the outside so i don't know
- 3:56what it was but there was even after
- 3:58this time
- 3:59i still didn't change it and only after
- 4:01a certain amount of time
- 4:02am i going to guarantee to have a steady
- 4:04state value of whatever the input was
- 4:06back at that time
- 4:07at the time zero at that rising edge and
- 4:09this happens again if i watch this again
- 4:11let's keep doing this
- 4:12there's my rising edge i sample d i see
- 4:15the output on q
- 4:16rising edge sample d put it on q and
- 4:19watch it here
- 4:20what happens i even do it if d hadn't
- 4:22changed look d is changing between those
- 4:24two clock guys
- 4:25look d change in the middle but from the
- 4:27point of view of the flip-flop i don't
- 4:28care
- 4:28because last time i sample it and now i
- 4:31stay the same so nothing from my point
- 4:32of view i
- 4:33grab it zero turn around d is changing
- 4:35one zero one zero
- 4:36turn around if it's still zero i just
- 4:37grab the zero and give it again but i
- 4:38mean the output should not see it it'll
- 4:40still be zero throughout that whole
- 4:41period or that on the output side
- 4:43okay so far all right
- 4:47now let's this is one of my favorite
- 4:48slides this and we'll stop this lecture
- 4:50series with this slide
- 4:52the timing is really important to
- 4:54understand these new words i'm teaching
- 4:55you some new words today
- 4:57we saw this rising edge triggered flip
- 4:59flop we saw that that line nothing
- 5:00you've seen this already this is
- 5:02this is all from before this is all from
- 5:03before let's actually dig into more
- 5:05detail of this
- 5:07so the red line is the red line
- 5:10is the rising edge of the clock that's
- 5:12the important red line
- 5:14and now here's the key you're going to
- 5:16say well dan
- 5:17can d can d just while i'm trying while
- 5:20i'm turning around and grabbing it
- 5:22can d just be moving around like
- 5:24wouldn't you kind of possibly grab a
- 5:25half
- 5:26if it's moving from zero to one and the
- 5:28answer is yes
- 5:29i could be in a really unstable state if
- 5:31as i'm turning around to grab d
- 5:33d is changing so you need to have d
- 5:35stable
- 5:36how stable stable from sometime before
- 5:40the right like
- 5:40negative time before the rising edge of
- 5:42the clock and some stable time
- 5:44after the rising of the clock so in that
- 5:46kind of key window when i was turning
- 5:47around
- 5:48they better be locked in time before now
- 5:50i'm grabbing it
- 5:52and now time after better still be the
- 5:53stable as i'm grabbing a stable value
- 5:56and having it on my output so
- 5:59here is negative time
- 6:02this means we call this setup time that
- 6:05input d better be stable for
- 6:07the setup time before the rising edge
- 6:10and here
- 6:11is the hold time
- 6:14from setup which is negative time before
- 6:16the rising edge to hold time after that
- 6:18hitch
- 6:18that better be stable for both of those
- 6:20time windows and then so that's two new
- 6:22words and then
- 6:23and by the way input has to be stable in
- 6:25that window okay
- 6:27and then there's a delay between when i
- 6:30grabbed it and you saw that we saw that
- 6:31on the last
- 6:32slide the output we're going to give a
- 6:33name to it call it clock
- 6:35right it's it's let's see what should we
- 6:38call the name the delay is between the
- 6:40clock
- 6:40till it's stable at q so it's clock to
- 6:43cube what should we call it
- 6:45block to cue so that's what they call it
- 6:47it's the delay
- 6:48between the rising edge of the clock and
- 6:50when it's stable on the quiescent
- 6:53calm quiescent stable on the output line
- 6:55so
- 6:56clock to queue delay okay three names
- 7:00set up time is negative time hold time
- 7:02is time after from
- 7:04kind of the rising edge till when it
- 7:05needs to be stable so it's stable
- 7:06between
- 7:07set up before hold after and independent
- 7:10of that
- 7:12grab it the val output queue is not
- 7:14stable until
- 7:15after guaranteed after clock two could
- 7:17happen before then but when you go to
- 7:19fry's electronics
- 7:20you're gonna buy a flip-flop you say i
- 7:22want
- 7:23here's some numbers there's three spec
- 7:24numbers spec spec spec numbers in terms
- 7:26of that
- 7:27and usually they're really small numbers
- 7:28picoseconds often and i'm going to say
- 7:30well
- 7:30how about this one that's the bargain
- 7:32bin what's in there well that's with a
- 7:33really
- 7:34huge clock to q delay oh how about that
- 7:36expensive one
- 7:37yeah that's a really small clock to q
- 7:39delay right the faster this thing can
- 7:40operate
- 7:41the faster you can clock the circuit so
- 7:43the expensive ones
- 7:44are and i'm i'm i'm joking about like
- 7:47going to fry's and getting just a
- 7:48flip-flop but the point is
- 7:49you it's harder to design a system that
- 7:51has small clock to q it's really easy to
- 7:53design that has a bad clock to queue
- 7:55so you want to have the smallest clock
- 7:57to queue you want and
- 7:58also you want to have small setup and
- 7:59hold time so the window wanted to be
- 8:01stable is small
- 8:02and the the speed at which i can grab it
- 8:04and have it on the output is really
- 8:05small so again you want really small
- 8:07values there for my
- 8:08for my flip flop in the ideal case
- 8:12and again this is the beautiful block
- 8:13diagram of my dq flip-flop
- 8:16that's the end of this lecture we'll see
- 8:17the next one
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 15.2 - State, State Machines: Register Details Flip-flops by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,741 words across 274 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.