[CS61C FA20] Lecture 17.4 - Combinational Logic Blocks: Subtractor Design — Transcript
Full transcript
- 0:00this is it welcome back
- 0:03we're here this is the last lecture of
- 0:05this four lecture series
- 0:08module of synchronous digital systems
- 0:10this is it we're building
- 0:12the climax come on band climax crescendo
- 0:16to the final piece
- 0:20where we're looking and we're trying to
- 0:21build a subtractor the final design of
- 0:24subtractor
- 0:25and it is extremely clever and you'll
- 0:28see why this is clever
- 0:30i don't want to have to build just to
- 0:31step back don't look at the screen don't
- 0:32look over here look at me
- 0:34i don't want to have to build 32 bits of
- 0:37an adder which does its thing
- 0:39and 32 bits of a subtractor and then
- 0:41shoes in a mux between them i'd like to
- 0:43be able to reuse that machinery
- 0:45so can i possibly reuse the machinery
- 0:47for my cascaded adder
- 0:49for my subtractor here's the big idea i
- 0:52love this idea
- 0:54a minus b is the same as a plus
- 0:58negative b like duh yeah i get that
- 1:01but how do you how does that embody
- 1:03itself in the circuit
- 1:07i love this part see this little graph
- 1:10over here this little truth table
- 1:13is an xor do you remember that slide i
- 1:16showed you before
- 1:17i actually probably showed you this
- 1:18truth table when x is zero
- 1:22y the output is just y it's just y
- 1:28when x is one it switches
- 1:31it's not y we call this
- 1:35a conditional inverter
- 1:39so a plus negative b
- 1:43sometimes i want to add a plus b
- 1:46sometimes i want to add a plus
- 1:47negative b how do you negate this is so
- 1:50fun
- 1:51how do you negate a two's complement
- 1:53number
- 1:56you invert the bits and add one
- 2:01[Music]
- 2:03subtract goes high when this line goes
- 2:06hot i'm so pleased because i just love
- 2:07this slide this is the crescendo of all
- 2:09the fun
- 2:10and it's really is very clever when this
- 2:12subtract lone guy
- 2:13line goes high i feed that into here
- 2:17that is shared from each line of b i
- 2:19need 32 of these guys
- 2:21and end of these guys each of those bits
- 2:25let's watch this each of those bits
- 2:27independently is going to be flipped
- 2:28remember
- 2:29a two's complement number you flip the
- 2:31bits this
- 2:32does that each one of these gets their
- 2:35bits
- 2:36flipped when this goes high each of them
- 2:38if it's a one becomes a zero
- 2:39the output is zero if that if the input
- 2:41for b of n minus one is a zero
- 2:43the output is a one it flips the bits
- 2:46and add one i had this port sitting over
- 2:50here
- 2:52i'm just too pleased with myself that
- 2:54was like does it wiggling do i let it do
- 2:56i let it go do i not plug anything into
- 2:58it i said well let's put a zero there
- 2:59and it's true two unsigned numbers i
- 3:00better put a zero there but i want to be
- 3:02able to flip the bits
- 3:04and add one this
- 3:07is your add one flip the bits
- 3:11and add one and you are now calculating
- 3:14a
- 3:15minus b a plus negative b which is the
- 3:18same as a minus b
- 3:19so i can reuse my entire subtractor
- 3:23my retire all the adders the one bit
- 3:25adders from my adder
- 3:27to be able to do a subtractor by just
- 3:30flipping b's bits
- 3:31and adding one and now i've flipped b
- 3:33now it's negative b
- 3:35now that representation is negative b
- 3:40a plus negative b a minus b
- 3:44this is my what this is my what this is
- 3:46my signed overflow
- 3:48okay my signed overflow by itself
- 3:53is my unsigned overflow okay
- 3:57so remember xor of both of these
- 3:59channels and
- 4:00c of n minus 1 and n we just talked
- 4:02about that is my signed overflow
- 4:04just take this line straight that's my
- 4:06unsigned overflow unsigned i should
- 4:08write this right
- 4:08unsigned over
- 4:12flow okay can't read my handwriting but
- 4:13i can't either
- 4:15when you have to be a phd you can write
- 4:16scribble and people can't tell what's
- 4:18happening
- 4:19this is it i'm so excited so
- 4:23in summary use muxes to be able to do a
- 4:27flag
- 4:28person on the line i got two signals to
- 4:30come in but i only have one output
- 4:31i use a mux to be able to drive who who
- 4:33gets to drive the output who gets to
- 4:34drive across the bridge okay
- 4:36if i have s input bits i select from
- 4:39among two to the s inputs we saw
- 4:41one bit chooses among two two bits
- 4:43chooses among four so
- 4:45s bits chooses among s two to the s
- 4:47inputs each input themselves
- 4:49independently can be n bits wired that
- 4:50could be
- 4:50two that could be four one bit lanes
- 4:53driving a one bit output
- 4:54or or four n-bit lanes n-bit input lanes
- 4:58all driving one n-bit
- 5:00bridge okay that's pretty cool i can
- 5:02implement those muxes hierarchically we
- 5:04saw that thinking the ncaa
- 5:05double-a tournament my aou can be
- 5:07implemented using a mux i do all these
- 5:09calculations
- 5:10and then i just at the end use the muxes
- 5:11to figure out who drives the output line
- 5:14and i can use to build an n bit adder
- 5:17subtractor
- 5:18i can use n one bit adders cascade them
- 5:21together
- 5:22and use an xor to determine the signed
- 5:25assigned overflow
- 5:26that's pretty cool this is really good
- 5:28stuff so we started we literally if i go
- 5:30back four lectures ago
- 5:33and several hours in one long recording
- 5:35day for me
- 5:37i started by talking about a transistor
- 5:40and what
- 5:40having voltage turning on and a gate to
- 5:42be able to have what a bit means
- 5:44how do you even go from current flowing
- 5:46or not flowing to a bit
- 5:48how to wire them to get some basic low
- 5:50level structure how to make a nand gate
- 5:52how to build up how to look at signals
- 5:54and waveforms how to then
- 5:55ignore those signals waveforms and think
- 5:57about and so some timing in there
- 5:58how to think about how would you
- 6:02build combinational logic circuits
- 6:03what's some boolean algebra behind that
- 6:05how do you massage it how do you get
- 6:06your hands all stuck with
- 6:08lotion to massage a boolean expression
- 6:10down to its simplest form
- 6:11maybe fewest gates and then how to take
- 6:14some of those basic gates
- 6:15to build them to higher level blocks
- 6:17we're going to use in our data path
- 6:18to be able to build together a working
- 6:20machine to process risk five machine
- 6:23code and actually get this working
- 6:24that's the next three lectures i cannot
- 6:26wait to see you there awesome folks
- 6:27thank you so much for coming to these
- 6:28sts lectures we'll see the next time
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 17.4 - Combinational Logic Blocks: Subtractor Design by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,125 words across 179 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.