YouTube2Text

[CS61C FA20] Lecture 07.1 - RISC-V Intro: RISC-V Assembly Language — Transcript

by CS 61C Departmental · 1,855 words · 360 segments · language en · Watch on YouTube

Full transcript

  1. 0:00[Music]
  2. 0:02[Applause]
  3. 0:03[Music]
  4. 0:09welcome to the next module in 61c we are
  5. 0:12going to
  6. 0:13dive down to the next level of
  7. 0:15abstraction
  8. 0:16and cover the risk 5 instruction set
  9. 0:18architecture and the risk 5 assembly
  10. 0:20language
  11. 0:23remember early in the class we talked
  12. 0:25about the
  13. 0:26the ideas of layering different layers
  14. 0:29of abstraction
  15. 0:30to represent complex compute systems on
  16. 0:33the top
  17. 0:34there is a high level language and
  18. 0:36hopefully people have mastered c
  19. 0:37by now below that is the assembly
  20. 0:40language below that is the
  21. 0:42machine readable version of the assembly
  22. 0:44language
  23. 0:45which is the machine code and below that
  24. 0:48are different implementations of the
  25. 0:51architecture
  26. 0:52implemented perhaps as block diagrams
  27. 0:56that can execute that code below that
  28. 0:59level of abstraction there are logic
  29. 1:01gates that actually
  30. 1:03replace things that are inside these
  31. 1:05boxes in the block diagram
  32. 1:08logic gates are not the very bottom of
  33. 1:10the of the
  34. 1:12compute stack they're also an
  35. 1:14abstraction
  36. 1:15uh they're built out of transistors
  37. 1:16transistors are also an abstraction
  38. 1:19um transistors consist of different
  39. 1:22kinds of materials
  40. 1:23they're also wires and all of them
  41. 1:26are there to carry electrons in holes
  42. 1:29and we can talk about deeper than the
  43. 1:31deeper layers of abstraction than that
  44. 1:34c is not the highest level language as
  45. 1:36we already know
  46. 1:38there are more complex things that are
  47. 1:39built on top of it their operating
  48. 1:41systems
  49. 1:42their productivity languages their
  50. 1:44software frameworks
  51. 1:45and this entire world is built or at
  52. 1:48least the software view of the world
  53. 1:49is built on top of that
  54. 1:53it is important to point out that there
  55. 1:55are always well defined in
  56. 1:57interfaces between these layers of
  57. 1:59abstraction
  58. 2:00typically we don't write assembly
  59. 2:03language code
  60. 2:05we can but most commonly it is being
  61. 2:08produced by a compiler
  62. 2:11assembler produces a machine readable
  63. 2:14code
  64. 2:15instruction set architecture is what
  65. 2:17defines
  66. 2:18what will be executed by the hardware
  67. 2:21and
  68. 2:22then there are different layers
  69. 2:23different ways of implementing things
  70. 2:25below that
  71. 2:30when we are thinking about the assembly
  72. 2:32language we think
  73. 2:33about the instructions executed by the
  74. 2:35processor
  75. 2:36the basic job of a cpu is to execute
  76. 2:39lots of instructions when i say
  77. 2:41lots i mean lots when we speak about the
  78. 2:44processor
  79. 2:47that is running at among the speed
  80. 2:49nowadays of one gigahertz
  81. 2:51that means that one cycle in a processor
  82. 2:54lasts for one
  83. 2:55nanosecond and that's approximately a
  84. 2:57time that it takes to execute one
  85. 2:58instruction sometimes more sometimes
  86. 3:00less but let's say
  87. 3:01of the order so each
  88. 3:05processor will execute 1 billion
  89. 3:07instructions per second
  90. 3:09and that's a lot these instructions
  91. 3:13are primitive operations that cpu
  92. 3:16executes
  93. 3:17they essentially
  94. 3:20constitute of some kind of an action
  95. 3:23like a sentence
  96. 3:24where the operations are like verbs
  97. 3:27applied to operands which are objects
  98. 3:29that are processed in sequence
  99. 3:33now there are many different processor
  100. 3:36architectures out there and different
  101. 3:38sets of instructions
  102. 3:40different cpus implement different sets
  103. 3:42of
  104. 3:43instructions
  105. 3:46a particular set of instructions that
  106. 3:48applies
  107. 3:49to a processor or class of processors is
  108. 3:52called the instruction set architecture
  109. 3:54so when we you know there are many known
  110. 3:57instruction set architectures out there
  111. 4:00the most common that you'll encounter
  112. 4:01nowadays is the arm
  113. 4:04instruction set architecture and it is
  114. 4:07deployed in
  115. 4:08pretty much all of the cell phones that
  116. 4:09are out there in the world and many many
  117. 4:11other things
  118. 4:13very popular is intel x86 that is
  119. 4:16implemented in
  120. 4:18laptops desktops and many of the of the
  121. 4:21servers and cloud processors there is
  122. 4:24ibm power
  123. 4:25implemented in servers as well there
  124. 4:27used to be very popular ibm motorola
  125. 4:29power pc that was used in all their
  126. 4:33macs there is mips
  127. 4:36and there is risk five we're going to be
  128. 4:38talking about risk five
  129. 4:40and this module and beyond
  130. 4:44there is a book that
  131. 4:48actually was pointed to me by dan um
  132. 4:51programming from the ground up and i'm
  133. 4:52just gonna read a little bit from its uh
  134. 4:56excerpt from its review the reviewer
  135. 4:58says here
  136. 4:59i found that the key difference between
  137. 5:02mediocre and excellent programmers
  138. 5:04is whether or not they know assembly
  139. 5:07language
  140. 5:08those that do tend to understand
  141. 5:11computers themselves
  142. 5:12at a much deeper level and this really
  143. 5:14strikes deep
  144. 5:16uh with me that's why we are trying to
  145. 5:19cover
  146. 5:20assembly language such that people
  147. 5:22really understand
  148. 5:24how is that software being executed also
  149. 5:27many of the
  150. 5:28um i had quite a bit of experience
  151. 5:30within with the
  152. 5:31assembly language of a particular
  153. 5:33architecture of olden times
  154. 5:35um it was old computers like an apple
  155. 5:38computer just came with a basic
  156. 5:40interpreter
  157. 5:41didn't have really an operating system
  158. 5:43um and if you wanted to do something
  159. 5:45other than write code in basic that was
  160. 5:48a
  161. 5:49language of that time um you had to
  162. 5:51write assembly language for example i
  163. 5:53had to write a lot you know this was my
  164. 5:55first computer
  165. 5:56i still have it not quite sure if it
  166. 5:58works it's a simpler zx spectrum
  167. 6:00that was a british type of machine it
  168. 6:03was very inexpensive you could plug it
  169. 6:04into a tv
  170. 6:06and just keep coding
  171. 6:10it also had a basic but i really wanted
  172. 6:13performance out of it so i had to write
  173. 6:15a lot of assembly code
  174. 6:20back to instruction set architectures
  175. 6:24as the computers were developing
  176. 6:26somewhere in the 70s and the 80s there
  177. 6:28was a trend
  178. 6:29to try to build more and more complex
  179. 6:31instructions
  180. 6:33that led something you know to
  181. 6:37a division or to a trend of building
  182. 6:39something that is called complete
  183. 6:41instruction set architect
  184. 6:43computers um or what's then what
  185. 6:46you know as a as an acronym uh known as
  186. 6:49sisk
  187. 6:54there was in the early 80s
  188. 6:57emerged uh or a little bit earlier than
  189. 7:00that by john in ibm
  190. 7:02to try to build very simple instruction
  191. 7:05sets
  192. 7:05very basic instruction sets that was
  193. 7:08picked up and
  194. 7:09really taken to the full extent by dave
  195. 7:11patterson
  196. 7:12berkeley and john hennessy at stanford
  197. 7:16the idea there was to keep instructions
  198. 7:18that's small and simple
  199. 7:19and make it easier to build fast
  200. 7:23hardware
  201. 7:24so each instruction per cycle would do
  202. 7:27less but you would have fast hard
  203. 7:29hardware and will be able to
  204. 7:31execute more instructions in a given
  205. 7:34time
  206. 7:35and then we'll use software to build
  207. 7:38complicated operations by composing
  208. 7:40simpler ones
  209. 7:42um
  210. 7:44person hennessy one um there was a
  211. 7:47long debate but they eventually won and
  212. 7:50even though there are cisc
  213. 7:52instruction sets out there like x86 if
  214. 7:54you look at the way
  215. 7:56how the the processor is built
  216. 7:59that is really in the essence of it is
  217. 8:03a risk engine and these complex
  218. 8:05instructions are added by
  219. 8:07you know concatenating simpler ones
  220. 8:10inside
  221. 8:11that machine one would say
  222. 8:15he who loves last laughs best person
  223. 8:18hennessey
  224. 8:19as we know won the touring award two
  225. 8:22years ago
  226. 8:24when teaching computer architecture
  227. 8:28people you know both instructors and the
  228. 8:31students have a tough choice
  229. 8:32instructions
  230. 8:32in particular need to choose an
  231. 8:34instruction set architecture
  232. 8:36to teach the architecture in an
  233. 8:38architecture class
  234. 8:42so the choice there is to try to teach
  235. 8:45x86 but that's
  236. 8:46very complex and there is often quite a
  237. 8:49bit of a pushback by students in trying
  238. 8:51to teach
  239. 8:52us some subset of x86
  240. 8:56alternatives to that are
  241. 9:00to try to use some older instruction set
  242. 9:02like maps
  243. 9:03or an old risk or to come up with a made
  244. 9:06up instruction set
  245. 9:09the advantage of teaching x86 you know
  246. 9:11whoever survives the class is that
  247. 9:13then they can run any software on that
  248. 9:15architecture that they will understand
  249. 9:17because there is a rich x86
  250. 9:19you know system built out there but
  251. 9:24then it's easier to understand older
  252. 9:26instruction sets or
  253. 9:27made up instruction sets but the problem
  254. 9:30there is
  255. 9:31there is no really software that you can
  256. 9:33get to run on that
  257. 9:34it's really hard to even get a basic
  258. 9:36compiler running
  259. 9:39so there came risk 5. about 10 years ago
  260. 9:42it was conceptualized
  261. 9:44it really you know took off in the past
  262. 9:47four or five years
  263. 9:50it is open source and license free what
  264. 9:53means there
  265. 9:54is that anybody can use it you don't
  266. 9:57have to pay anybody
  267. 9:59the rights to use those instructions so
  268. 10:04it became very popular in both teaching
  269. 10:07but it immediately jumped into a
  270. 10:08commercial world
  271. 10:10so we have now a rich commercial
  272. 10:12ecosystem
  273. 10:13that builds risk fire from processors
  274. 10:15but there is a well-supported software
  275. 10:17stack
  276. 10:18so we got everything now a simple
  277. 10:20instruction set
  278. 10:21that can be extended and is being
  279. 10:23extended that we can teach in classes
  280. 10:25and there is a soft there is a rich
  281. 10:28collection of software
  282. 10:29that will run on it risk 5 comes in
  283. 10:32different kinds of variants to support
  284. 10:34from tiny microcontrollers to
  285. 10:36big computers it comes with
  286. 10:39in 32 64-bit 128 bit variants if you
  287. 10:43like
  288. 10:44that says how big are these words that
  289. 10:47the
  290. 10:48processor operates on 32 bits are
  291. 10:52four bytes that we have seen before 64
  292. 10:55bits
  293. 10:56are eight bytes that it operates on at a
  294. 10:58time
  295. 11:00in class we are using 32 bits because
  296. 11:03believe me here projects
  297. 11:06you know project 3 is a lot easier to
  298. 11:08implement when it's 32 bits
  299. 11:10than when it's 64 bits but the book
  300. 11:13covers
  301. 11:14a 64-bit version of the architecture
  302. 11:16that is called
  303. 11:17rb64 our variant is called rb32
  304. 11:22um it's what we covering class really
  305. 11:24fits on one page
  306. 11:26this is what i'm going to be talking
  307. 11:27about over the next
  308. 11:29few of these video segments that one
  309. 11:32page
  310. 11:32is the captured entire architecture the
  311. 11:36definition of risk five um and it's
  312. 11:38called the
  313. 11:39green card that is named after the ibm
  314. 11:43360 green card which was very popular
  315. 11:45back in the 60s
  316. 11:46i actually had an opportunity to program
  317. 11:50ibm 360 and when
  318. 11:53i was in high school and use the punch
  319. 11:55cards and
  320. 11:56line printers and really understood what
  321. 12:00does that
  322. 12:00slash n mean in uh in c code
  323. 12:04otherwise it will not return the line if
  324. 12:07it does
  325. 12:07if you don't put that in
  326. 12:12risk five just a few words about where
  327. 12:15it came from and where it's going
  328. 12:17um it started in summer 2010 to support
  329. 12:21classes
  330. 12:21exactly like this one 61c it was built
  331. 12:24for 61c
  332. 12:25but also for 152 and 151
  333. 12:29but a lot of the instructions that
  334. 12:30you'll find there are
  335. 12:33the same instructions that you found in
  336. 12:35the old risk one
  337. 12:37and raise 2 in the 80s
  338. 12:41as risk 5 project matured
  339. 12:45it started getting adopted by industry
  340. 12:48and it got moved into an open source you
  341. 12:50know a
  342. 12:52non-profit foundation that maintains its
  343. 12:55open source description it's called the
  344. 12:58risk5.org
  345. 13:01and there are as i said many uh research
  346. 13:04projects based on risk five
  347. 13:06and their products that may be open
  348. 13:08source but maybe
  349. 13:09pro proprietary
  350. 13:12people say they'll be next year about a
  351. 13:14billion
  352. 13:15processor called course built in risk
  353. 13:17five that is quite
  354. 13:18exciting you can read more about the
  355. 13:21history and the lineage
  356. 13:23in on the risk5.org page
  357. 13:27and i'll jump in the next
  358. 13:30video segment i'm going to jump into the
  359. 13:33elements of
  360. 13:34the architecture see you there

About this transcript

This page contains the full transcript of [CS61C FA20] Lecture 07.1 - RISC-V Intro: RISC-V Assembly Language by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,855 words across 360 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.