[CS61C FA20] Lecture 19.5 - Single-Cycle CPU Datapath II: Adding JAL — Transcript
Full transcript
- 0:01[Music]
- 0:08hi
- 0:08welcome back to our design of risk 5 cpu
- 0:12this time we'll add support for the jowl
- 0:15instruction gel instruction
- 0:16is stands for jump and link and is the
- 0:20only
- 0:20instruction that we have in the j format
- 0:23g format
- 0:24has a 20 bit wide immediate
- 0:28and then for field for a destination
- 0:31register and the op code
- 0:33it does two updates to the state of the
- 0:36processor it saves the value of pc plus
- 0:404
- 0:41in the destination register so we have
- 0:43the return address
- 0:45and sets the new value of a program
- 0:48counter to be equal to the
- 0:50current value of program counter plus
- 0:52the offset
- 0:53and the offset is set by the immediate
- 0:58so it performs a program counter
- 1:01relative jump
- 1:02where we can jump anywhere that that
- 1:05these 20 bits of the immediate allow us
- 1:07to do
- 1:08um so the target will be anywhere
- 1:12within two to plus minus two to the 19
- 1:15locations and these locations are said
- 1:17to be
- 1:17two bytes apart to support the
- 1:19compressed instruction set
- 1:21which means that we can jump anywhere
- 1:23from
- 1:24minus 2 to the 18th to plus to the
- 1:272 to the 18th 32-bit words
- 1:31in our code
- 1:35we have all the hardware that we need to
- 1:37implement
- 1:38jump in link we just need to have a way
- 1:41to generate a j
- 1:43type immediate so if you look at the
- 1:46data path we'll see that we really
- 1:49actually have everything we need
- 1:51the only update is immediate generation
- 1:53has to become
- 1:54of j type and j type is similar to a b
- 1:57type immediate we just need to add a few
- 2:00more
- 2:01multiplexers to multiplexing
- 2:04more most significant bits the top eight
- 2:07significant
- 2:08bits so
- 2:11when we look at the data path we have
- 2:13the two mechanisms that we are
- 2:15borrowing from gel
- 2:18r and branch to implement jowl
- 2:22so the first thing that we need to do
- 2:25we need to save the value of pc plus 4
- 2:29in the destination register rd we do
- 2:32that by using the same mechanism that we
- 2:34have added
- 2:35for gel r we
- 2:39send the pc plus 4 value to the right
- 2:42back select register
- 2:43right back select is set to have the
- 2:46value of 2
- 2:47that enables us to write into the
- 2:50destination register rd the second
- 2:53mechanism we are borrowing from the
- 2:55branch
- 2:56what we need to do we need to make the
- 2:57alu add the value of bc
- 3:00at its input a
- 3:04with the new immediate value and
- 3:07send that result back to the program
- 3:09counter we're going to set
- 3:11the pc select signal to be always taken
- 3:15and that's it let's light up the jowl
- 3:18data path
- 3:20we start with the instruction fetch and
- 3:23we proceed to the decode
- 3:26after so few things that i would like to
- 3:28highlight here we are sending the pc
- 3:31to the a select multiplexer
- 3:35and we are sending the pc plus 4 to the
- 3:38right back select when we decode the
- 3:41instruction
- 3:42we set the control bits appropriately
- 3:46simultaneously well that will
- 3:49generate the immediate that is of a j
- 3:52type
- 3:53and then we have the right operands in
- 3:55front of the alu
- 3:56the alu multiplexer inputs are set
- 4:00to pick the program counter
- 4:03and the immediate and the output of the
- 4:06alu
- 4:07will be sent back to the pc cell
- 4:09multiplexer
- 4:11pc cell multiplexer also has a pc plus 4
- 4:15but it will not take it because pc
- 4:18cell is all signal is always sent set
- 4:21to be taken finally we
- 4:25just use the right back select
- 4:28multiplexer
- 4:29to pick pc plus 4 to be written back in
- 4:32the destination register rd
- 4:35on the next clock tick
- 4:38the destination register and the program
- 4:40counted there
- 4:41are updated to the new values
- 4:44and that is it that is what chal does
- 4:48see you in a bit with the long
- 4:51immediates
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 19.5 - Single-Cycle CPU Datapath II: Adding JAL by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 650 words across 116 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.