YouTube2Text

[CS61C FA20] Lecture 31.1 - I/O: I/O Devices — Transcript

by CS 61C Departmental · 1,347 words · 237 segments · language en · Watch on YouTube

Full transcript

  1. 0:00[Music]
  2. 0:10hello
  3. 0:11welcome back to our module that deals
  4. 0:13with
  5. 0:14virtual memory and operating system
  6. 0:16support but now we have figured out
  7. 0:18pretty much how does
  8. 0:19virtual memory work so what you would
  9. 0:21like to do
  10. 0:22in order to complete our compute system
  11. 0:26is to add io devices so let's get into
  12. 0:29that
  13. 0:31we made tremendous progress so far in
  14. 0:35this class we
  15. 0:36build almost a computer so we started
  16. 0:39with the high level c program and
  17. 0:41practices that
  18. 0:42through the first project then we
  19. 0:45learned the assembly language
  20. 0:47for this five isa and practiced that and
  21. 0:50really cemented it
  22. 0:52through project two then we built a data
  23. 0:54pod that pretty much can
  24. 0:55execute our program from project two
  25. 0:58minus the equals but that's not very
  26. 1:01difficult although
  27. 1:03not too educational to implement over
  28. 1:06there
  29. 1:06you know they've just added a burden so
  30. 1:08we can assume that we can build
  31. 1:10we can run pretty much everything we
  32. 1:12have built
  33. 1:13in uh project two and we can also
  34. 1:16compile our project one and run it over
  35. 1:19on our core
  36. 1:20we added cache memory and then we
  37. 1:23connected the virtual memory so all
  38. 1:25what we need in order to have a computer
  39. 1:28is to add
  40. 1:29io devices such that we can hook up a
  41. 1:31keyboard and a mouse and display our
  42. 1:33results
  43. 1:34on the screen and perhaps connect it to
  44. 1:38a network
  45. 1:40the key thing here is you would like to
  46. 1:42understand the principles how these
  47. 1:44io devices are connected such that we
  48. 1:47don't have to do
  49. 1:48one at a time using some special
  50. 1:51procedure so let's get into that so how
  51. 1:55do we interact with the devices
  52. 1:57so we have a program running on a cpu
  53. 2:00and then
  54. 2:01it would like to print something on the
  55. 2:02printer or receive
  56. 2:06input from a keystroke so how do we do
  57. 2:08that
  58. 2:09so we have our processor and the memory
  59. 2:11and there is some code that is running
  60. 2:12on that
  61. 2:13so we need to have an i o interface for
  62. 2:16keyboards network mice displays and so
  63. 2:19on
  64. 2:20and you would like to do that in a
  65. 2:23uniform way so that we don't have to do
  66. 2:25it
  67. 2:26separately for each one of them
  68. 2:28generally
  69. 2:29there will be a plethora of devices and
  70. 2:31they're going to have very
  71. 2:32different demands or the ways how they
  72. 2:36present their data or how do they take
  73. 2:38their data
  74. 2:38but you would like to try to treat them
  75. 2:40in a uniform way
  76. 2:42they would be generally connected
  77. 2:43through some hierarchy of buses and the
  78. 2:46way how we can
  79. 2:48view these buses are like you know
  80. 2:51highways um where a lot of data is
  81. 2:54moving
  82. 2:55um at a relatively high rate and then
  83. 2:58there are things
  84. 2:59connected off ramps to that highway
  85. 3:04we're only going to get into the depths
  86. 3:07and details
  87. 3:08of designing buses we can just view them
  88. 3:12as something abstract that is connected
  89. 3:15to the processor
  90. 3:16memory system
  91. 3:19then the way how these devices
  92. 3:23talk to the rest of the world is
  93. 3:26generally through standardized interface
  94. 3:29that consists of command
  95. 3:32and status registers and data registers
  96. 3:36and generally is the operating system
  97. 3:39that
  98. 3:41checks the status where the weather
  99. 3:42devices are ready to talk to us
  100. 3:45and then orchestrates how
  101. 3:48do the processes underneath access these
  102. 3:51devices
  103. 3:53so standardized interface they generally
  104. 3:57have commands
  105. 3:57let's say print something and then the
  106. 4:00data register contains
  107. 4:02what to actually print all right
  108. 4:07how do we support this kind of
  109. 4:10i o interfaces through our isa
  110. 4:14um so it's relatively basic
  111. 4:17at the very bottom and the leaf level of
  112. 4:19what does the
  113. 4:20processor need to do it needs to be able
  114. 4:22to read the sequence of bytes
  115. 4:24and write the sequence of bytes whether
  116. 4:25there are commands
  117. 4:27or the data so how do we do that
  118. 4:30well we have two options one design
  119. 4:32special input output instructions
  120. 4:34and the matching hardware that would be
  121. 4:36talking to each type of device this used
  122. 4:38to be done in the past there used to be
  123. 4:40io instructions
  124. 4:41in processors but that is that is turned
  125. 4:44out not to be a good idea because
  126. 4:46these devices change we get new
  127. 4:49standards new interfaces every few years
  128. 4:52and the old ones get old and
  129. 4:55abandoned the obsolete and our isa is
  130. 4:57stuck with supporting
  131. 4:59stuff that may be 10 or 20 or 40 years
  132. 5:02old
  133. 5:03so most of the things nowadays are
  134. 5:05actually
  135. 5:07done through something that is called
  136. 5:08memory mapped i o
  137. 5:11portion of generally address space some
  138. 5:14low addresses in our
  139. 5:16memory space in our memory locations
  140. 5:20are dedicated to i o that's
  141. 5:24where our i o command and
  142. 5:28data registers are placed so we don't
  143. 5:31use that part of a memory it is not
  144. 5:33visible to our program
  145. 5:35it is managed by the os and
  146. 5:38our processes may be allowed
  147. 5:41to to to to read or write from there
  148. 5:46so if they're allowed they can use
  149. 5:48normal load and store
  150. 5:50instructions to access them or they
  151. 5:52would be accessible through system calls
  152. 5:55and this is the way how risk 5 does it
  153. 5:58so here is an example
  154. 6:02there are some addresses in this example
  155. 6:04all addresses below
  156. 6:057 ffff
  157. 6:08are memory are reserved for memory
  158. 6:10mapped io that's where all our
  159. 6:12peripheral devices are going to copy
  160. 6:14their control and status registers and
  161. 6:16they're going to
  162. 6:17read and write to them that's going to
  163. 6:19be our way of communication so our
  164. 6:21program and data memory is going to
  165. 6:23start from the address eight
  166. 6:25zero zero zero zero zero zero and go up
  167. 6:29to the top of the memory so every single
  168. 6:32io device is going to have a copy of its
  169. 6:36registers
  170. 6:37in the memory mapped i o region
  171. 6:42one thing to keep in mind there is a
  172. 6:44variety of devices out there and
  173. 6:46they may be running at very different
  174. 6:48speeds so if our microprocessor
  175. 6:51is uh just a single quarter it's five
  176. 6:53processor says five stage pipeline
  177. 6:55operating at one
  178. 6:56uh gigahertz it can do four
  179. 6:59gb per second worth of loads and stores
  180. 7:02it can write in every cycle
  181. 7:04assuming that a mat is somewhere around
  182. 7:08one it can in every cycle do one
  183. 7:11four byte load or four byte store
  184. 7:16but there is a whole bunch of devices
  185. 7:18that
  186. 7:19may not be able to use that or generally
  187. 7:21will not be
  188. 7:22able to use them unless they're dram
  189. 7:25so let's take a look at what is out
  190. 7:28there
  191. 7:29so if you're working with a keyboard
  192. 7:31keyboard really the rate that we talk to
  193. 7:33a keyboard is
  194. 7:34something of the order of tensor bytes
  195. 7:36per second
  196. 7:38right i mean that's the speed the
  197. 7:40maximum speed that we can type
  198. 7:42um you know humans and human fingers
  199. 7:46can produce few tensor bytes at the max
  200. 7:48per second if it is me it's you know
  201. 7:50maybe a few bytes per second
  202. 7:52um and then if you're dealing with audio
  203. 7:55signals which are typically
  204. 7:57associated you know bluetooth is now
  205. 7:59used to carry uh
  206. 8:01general audio signals it is few
  207. 8:04hundreds of cubes per second it can go
  208. 8:06up to three
  209. 8:08mega bytes per second and then when we
  210. 8:11talk about
  211. 8:12wi-fi and and ethernet
  212. 8:15and um you know hard disk drives we can
  213. 8:18go up to higher speeds
  214. 8:19but none of them get anywhere close
  215. 8:21they're typically
  216. 8:23at least an order of magnitude below the
  217. 8:25speed of what the processor can do
  218. 8:27until we get to like thunderbolt and
  219. 8:31newer pressure dram interfaces
  220. 8:35now those are generally those that
  221. 8:37exceed the bandwidth of what the core
  222. 8:40can
  223. 8:40read and write are designed to support
  224. 8:43higher
  225. 8:43end processors and those that have
  226. 8:45multiple cores because each of these
  227. 8:47cores
  228. 8:48may have a desire to load or store the
  229. 8:51data to the memory
  230. 8:54so generally
  231. 8:58common io devices neither deliver nor
  232. 9:00accept data matching the processor speed
  233. 9:03we have to have some way
  234. 9:04to adjust to that and we're going to
  235. 9:06take a look at a few
  236. 9:09possible options how to do that after a
  237. 9:11quick break see you then

About this transcript

This page contains the full transcript of [CS61C FA20] Lecture 31.1 - I/O: I/O Devices by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,347 words across 237 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.