[CS61C FA20] Lecture 18.4 - Single-Cycle CPU Datapath I: Sub Datapath — Transcript
Full transcript
- 0:01[Music]
- 0:09hey welcome back to risk 5 cpu design
- 0:12module
- 0:12we just designed a data path that
- 0:15supports
- 0:16register based additions let's see if we
- 0:19can generalize it a bit
- 0:21can we perhaps modify it to support
- 0:24the subtraction so
- 0:28remember subtraction is an instruction
- 0:31of the same
- 0:32r type and it looks very similar it
- 0:34actually
- 0:35has the same op code
- 0:38same place where we use the same fields
- 0:41where you'll find the destination
- 0:43registers
- 0:44rs1 and rs2 source registers and the
- 0:47same
- 0:49funct 3 field there is only one
- 0:51difference that differentiates them
- 0:53it is in the func 7 field and that is
- 0:57the instruction bit theory that selects
- 1:00whether we are doing addition or
- 1:02subtraction
- 1:03so let's see what should we do to our
- 1:05data path
- 1:06to support subtraction here is our
- 1:09data path that is capable of doing
- 1:12register based addition
- 1:14so we had our our program counter
- 1:17our adder fixed adder for incrementing
- 1:21the program counter by four bytes to
- 1:23point to the next instruction
- 1:25our instruction memory our register file
- 1:28and
- 1:28our alu that alu before was
- 1:31just an adder but now we need an alu
- 1:34that is capable of doing
- 1:36both addition and subtraction and all
- 1:39what we need to
- 1:40tell that tail you is to perform
- 1:42addition or subtraction to support
- 1:45add or sub instructions and that's all
- 1:48we're pretty much done so we just need
- 1:51to be able to do
- 1:52these two different instructions we need
- 1:56to provide another control bit and that
- 1:59control bit in this case
- 2:01is alu cell that tail you sell if
- 2:05it is a zero blu will perform addition
- 2:08if it is
- 2:09set to 1 it'll perform subtraction
- 2:15done well we can go one step
- 2:18beyond from that we can implement all
- 2:21the other
- 2:22our format instructions just by having a
- 2:25capable arithmetic logic unit
- 2:27so this alu now needs to support all the
- 2:30instructions that we have
- 2:32of the r format which are add sub
- 2:36shift left logical set less than
- 2:39set less than unsigned xor
- 2:43s shift write logical
- 2:46shift right arithmetic or an end and
- 2:49that's it
- 2:50we just need to decode the appropriate
- 2:53function and function fields
- 2:57and set alu the to perform appropriate
- 3:01arithmetic or logic operation
- 3:05that's it let's in the next module see
- 3:08how we expand this data path
- 3:10to support another instruction type see
- 3:12you there
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 18.4 - Single-Cycle CPU Datapath I: Sub Datapath by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 398 words across 74 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.