YouTube2Text

[CS61C FA20] Lecture 17.4 - Combinational Logic Blocks: Subtractor Design — Transcript

by CS 61C Departmental · 1,125 words · 179 segments · language en · Watch on YouTube

Full transcript

  1. 0:00this is it welcome back
  2. 0:03we're here this is the last lecture of
  3. 0:05this four lecture series
  4. 0:08module of synchronous digital systems
  5. 0:10this is it we're building
  6. 0:12the climax come on band climax crescendo
  7. 0:16to the final piece
  8. 0:20where we're looking and we're trying to
  9. 0:21build a subtractor the final design of
  10. 0:24subtractor
  11. 0:25and it is extremely clever and you'll
  12. 0:28see why this is clever
  13. 0:30i don't want to have to build just to
  14. 0:31step back don't look at the screen don't
  15. 0:32look over here look at me
  16. 0:34i don't want to have to build 32 bits of
  17. 0:37an adder which does its thing
  18. 0:39and 32 bits of a subtractor and then
  19. 0:41shoes in a mux between them i'd like to
  20. 0:43be able to reuse that machinery
  21. 0:45so can i possibly reuse the machinery
  22. 0:47for my cascaded adder
  23. 0:49for my subtractor here's the big idea i
  24. 0:52love this idea
  25. 0:54a minus b is the same as a plus
  26. 0:58negative b like duh yeah i get that
  27. 1:01but how do you how does that embody
  28. 1:03itself in the circuit
  29. 1:07i love this part see this little graph
  30. 1:10over here this little truth table
  31. 1:13is an xor do you remember that slide i
  32. 1:16showed you before
  33. 1:17i actually probably showed you this
  34. 1:18truth table when x is zero
  35. 1:22y the output is just y it's just y
  36. 1:28when x is one it switches
  37. 1:31it's not y we call this
  38. 1:35a conditional inverter
  39. 1:39so a plus negative b
  40. 1:43sometimes i want to add a plus b
  41. 1:46sometimes i want to add a plus
  42. 1:47negative b how do you negate this is so
  43. 1:50fun
  44. 1:51how do you negate a two's complement
  45. 1:53number
  46. 1:56you invert the bits and add one
  47. 2:01[Music]
  48. 2:03subtract goes high when this line goes
  49. 2:06hot i'm so pleased because i just love
  50. 2:07this slide this is the crescendo of all
  51. 2:09the fun
  52. 2:10and it's really is very clever when this
  53. 2:12subtract lone guy
  54. 2:13line goes high i feed that into here
  55. 2:17that is shared from each line of b i
  56. 2:19need 32 of these guys
  57. 2:21and end of these guys each of those bits
  58. 2:25let's watch this each of those bits
  59. 2:27independently is going to be flipped
  60. 2:28remember
  61. 2:29a two's complement number you flip the
  62. 2:31bits this
  63. 2:32does that each one of these gets their
  64. 2:35bits
  65. 2:36flipped when this goes high each of them
  66. 2:38if it's a one becomes a zero
  67. 2:39the output is zero if that if the input
  68. 2:41for b of n minus one is a zero
  69. 2:43the output is a one it flips the bits
  70. 2:46and add one i had this port sitting over
  71. 2:50here
  72. 2:52i'm just too pleased with myself that
  73. 2:54was like does it wiggling do i let it do
  74. 2:56i let it go do i not plug anything into
  75. 2:58it i said well let's put a zero there
  76. 2:59and it's true two unsigned numbers i
  77. 3:00better put a zero there but i want to be
  78. 3:02able to flip the bits
  79. 3:04and add one this
  80. 3:07is your add one flip the bits
  81. 3:11and add one and you are now calculating
  82. 3:14a
  83. 3:15minus b a plus negative b which is the
  84. 3:18same as a minus b
  85. 3:19so i can reuse my entire subtractor
  86. 3:23my retire all the adders the one bit
  87. 3:25adders from my adder
  88. 3:27to be able to do a subtractor by just
  89. 3:30flipping b's bits
  90. 3:31and adding one and now i've flipped b
  91. 3:33now it's negative b
  92. 3:35now that representation is negative b
  93. 3:40a plus negative b a minus b
  94. 3:44this is my what this is my what this is
  95. 3:46my signed overflow
  96. 3:48okay my signed overflow by itself
  97. 3:53is my unsigned overflow okay
  98. 3:57so remember xor of both of these
  99. 3:59channels and
  100. 4:00c of n minus 1 and n we just talked
  101. 4:02about that is my signed overflow
  102. 4:04just take this line straight that's my
  103. 4:06unsigned overflow unsigned i should
  104. 4:08write this right
  105. 4:08unsigned over
  106. 4:12flow okay can't read my handwriting but
  107. 4:13i can't either
  108. 4:15when you have to be a phd you can write
  109. 4:16scribble and people can't tell what's
  110. 4:18happening
  111. 4:19this is it i'm so excited so
  112. 4:23in summary use muxes to be able to do a
  113. 4:27flag
  114. 4:28person on the line i got two signals to
  115. 4:30come in but i only have one output
  116. 4:31i use a mux to be able to drive who who
  117. 4:33gets to drive the output who gets to
  118. 4:34drive across the bridge okay
  119. 4:36if i have s input bits i select from
  120. 4:39among two to the s inputs we saw
  121. 4:41one bit chooses among two two bits
  122. 4:43chooses among four so
  123. 4:45s bits chooses among s two to the s
  124. 4:47inputs each input themselves
  125. 4:49independently can be n bits wired that
  126. 4:50could be
  127. 4:50two that could be four one bit lanes
  128. 4:53driving a one bit output
  129. 4:54or or four n-bit lanes n-bit input lanes
  130. 4:58all driving one n-bit
  131. 5:00bridge okay that's pretty cool i can
  132. 5:02implement those muxes hierarchically we
  133. 5:04saw that thinking the ncaa
  134. 5:05double-a tournament my aou can be
  135. 5:07implemented using a mux i do all these
  136. 5:09calculations
  137. 5:10and then i just at the end use the muxes
  138. 5:11to figure out who drives the output line
  139. 5:14and i can use to build an n bit adder
  140. 5:17subtractor
  141. 5:18i can use n one bit adders cascade them
  142. 5:21together
  143. 5:22and use an xor to determine the signed
  144. 5:25assigned overflow
  145. 5:26that's pretty cool this is really good
  146. 5:28stuff so we started we literally if i go
  147. 5:30back four lectures ago
  148. 5:33and several hours in one long recording
  149. 5:35day for me
  150. 5:37i started by talking about a transistor
  151. 5:40and what
  152. 5:40having voltage turning on and a gate to
  153. 5:42be able to have what a bit means
  154. 5:44how do you even go from current flowing
  155. 5:46or not flowing to a bit
  156. 5:48how to wire them to get some basic low
  157. 5:50level structure how to make a nand gate
  158. 5:52how to build up how to look at signals
  159. 5:54and waveforms how to then
  160. 5:55ignore those signals waveforms and think
  161. 5:57about and so some timing in there
  162. 5:58how to think about how would you
  163. 6:02build combinational logic circuits
  164. 6:03what's some boolean algebra behind that
  165. 6:05how do you massage it how do you get
  166. 6:06your hands all stuck with
  167. 6:08lotion to massage a boolean expression
  168. 6:10down to its simplest form
  169. 6:11maybe fewest gates and then how to take
  170. 6:14some of those basic gates
  171. 6:15to build them to higher level blocks
  172. 6:17we're going to use in our data path
  173. 6:18to be able to build together a working
  174. 6:20machine to process risk five machine
  175. 6:23code and actually get this working
  176. 6:24that's the next three lectures i cannot
  177. 6:26wait to see you there awesome folks
  178. 6:27thank you so much for coming to these
  179. 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.