[CS61C FA20] Lecture 31.1 - I/O: I/O Devices — Transcript
Full transcript
- 0:00[Music]
- 0:10hello
- 0:11welcome back to our module that deals
- 0:13with
- 0:14virtual memory and operating system
- 0:16support but now we have figured out
- 0:18pretty much how does
- 0:19virtual memory work so what you would
- 0:21like to do
- 0:22in order to complete our compute system
- 0:26is to add io devices so let's get into
- 0:29that
- 0:31we made tremendous progress so far in
- 0:35this class we
- 0:36build almost a computer so we started
- 0:39with the high level c program and
- 0:41practices that
- 0:42through the first project then we
- 0:45learned the assembly language
- 0:47for this five isa and practiced that and
- 0:50really cemented it
- 0:52through project two then we built a data
- 0:54pod that pretty much can
- 0:55execute our program from project two
- 0:58minus the equals but that's not very
- 1:01difficult although
- 1:03not too educational to implement over
- 1:06there
- 1:06you know they've just added a burden so
- 1:08we can assume that we can build
- 1:10we can run pretty much everything we
- 1:12have built
- 1:13in uh project two and we can also
- 1:16compile our project one and run it over
- 1:19on our core
- 1:20we added cache memory and then we
- 1:23connected the virtual memory so all
- 1:25what we need in order to have a computer
- 1:28is to add
- 1:29io devices such that we can hook up a
- 1:31keyboard and a mouse and display our
- 1:33results
- 1:34on the screen and perhaps connect it to
- 1:38a network
- 1:40the key thing here is you would like to
- 1:42understand the principles how these
- 1:44io devices are connected such that we
- 1:47don't have to do
- 1:48one at a time using some special
- 1:51procedure so let's get into that so how
- 1:55do we interact with the devices
- 1:57so we have a program running on a cpu
- 2:00and then
- 2:01it would like to print something on the
- 2:02printer or receive
- 2:06input from a keystroke so how do we do
- 2:08that
- 2:09so we have our processor and the memory
- 2:11and there is some code that is running
- 2:12on that
- 2:13so we need to have an i o interface for
- 2:16keyboards network mice displays and so
- 2:19on
- 2:20and you would like to do that in a
- 2:23uniform way so that we don't have to do
- 2:25it
- 2:26separately for each one of them
- 2:28generally
- 2:29there will be a plethora of devices and
- 2:31they're going to have very
- 2:32different demands or the ways how they
- 2:36present their data or how do they take
- 2:38their data
- 2:38but you would like to try to treat them
- 2:40in a uniform way
- 2:42they would be generally connected
- 2:43through some hierarchy of buses and the
- 2:46way how we can
- 2:48view these buses are like you know
- 2:51highways um where a lot of data is
- 2:54moving
- 2:55um at a relatively high rate and then
- 2:58there are things
- 2:59connected off ramps to that highway
- 3:04we're only going to get into the depths
- 3:07and details
- 3:08of designing buses we can just view them
- 3:12as something abstract that is connected
- 3:15to the processor
- 3:16memory system
- 3:19then the way how these devices
- 3:23talk to the rest of the world is
- 3:26generally through standardized interface
- 3:29that consists of command
- 3:32and status registers and data registers
- 3:36and generally is the operating system
- 3:39that
- 3:41checks the status where the weather
- 3:42devices are ready to talk to us
- 3:45and then orchestrates how
- 3:48do the processes underneath access these
- 3:51devices
- 3:53so standardized interface they generally
- 3:57have commands
- 3:57let's say print something and then the
- 4:00data register contains
- 4:02what to actually print all right
- 4:07how do we support this kind of
- 4:10i o interfaces through our isa
- 4:14um so it's relatively basic
- 4:17at the very bottom and the leaf level of
- 4:19what does the
- 4:20processor need to do it needs to be able
- 4:22to read the sequence of bytes
- 4:24and write the sequence of bytes whether
- 4:25there are commands
- 4:27or the data so how do we do that
- 4:30well we have two options one design
- 4:32special input output instructions
- 4:34and the matching hardware that would be
- 4:36talking to each type of device this used
- 4:38to be done in the past there used to be
- 4:40io instructions
- 4:41in processors but that is that is turned
- 4:44out not to be a good idea because
- 4:46these devices change we get new
- 4:49standards new interfaces every few years
- 4:52and the old ones get old and
- 4:55abandoned the obsolete and our isa is
- 4:57stuck with supporting
- 4:59stuff that may be 10 or 20 or 40 years
- 5:02old
- 5:03so most of the things nowadays are
- 5:05actually
- 5:07done through something that is called
- 5:08memory mapped i o
- 5:11portion of generally address space some
- 5:14low addresses in our
- 5:16memory space in our memory locations
- 5:20are dedicated to i o that's
- 5:24where our i o command and
- 5:28data registers are placed so we don't
- 5:31use that part of a memory it is not
- 5:33visible to our program
- 5:35it is managed by the os and
- 5:38our processes may be allowed
- 5:41to to to to read or write from there
- 5:46so if they're allowed they can use
- 5:48normal load and store
- 5:50instructions to access them or they
- 5:52would be accessible through system calls
- 5:55and this is the way how risk 5 does it
- 5:58so here is an example
- 6:02there are some addresses in this example
- 6:04all addresses below
- 6:057 ffff
- 6:08are memory are reserved for memory
- 6:10mapped io that's where all our
- 6:12peripheral devices are going to copy
- 6:14their control and status registers and
- 6:16they're going to
- 6:17read and write to them that's going to
- 6:19be our way of communication so our
- 6:21program and data memory is going to
- 6:23start from the address eight
- 6:25zero zero zero zero zero zero and go up
- 6:29to the top of the memory so every single
- 6:32io device is going to have a copy of its
- 6:36registers
- 6:37in the memory mapped i o region
- 6:42one thing to keep in mind there is a
- 6:44variety of devices out there and
- 6:46they may be running at very different
- 6:48speeds so if our microprocessor
- 6:51is uh just a single quarter it's five
- 6:53processor says five stage pipeline
- 6:55operating at one
- 6:56uh gigahertz it can do four
- 6:59gb per second worth of loads and stores
- 7:02it can write in every cycle
- 7:04assuming that a mat is somewhere around
- 7:08one it can in every cycle do one
- 7:11four byte load or four byte store
- 7:16but there is a whole bunch of devices
- 7:18that
- 7:19may not be able to use that or generally
- 7:21will not be
- 7:22able to use them unless they're dram
- 7:25so let's take a look at what is out
- 7:28there
- 7:29so if you're working with a keyboard
- 7:31keyboard really the rate that we talk to
- 7:33a keyboard is
- 7:34something of the order of tensor bytes
- 7:36per second
- 7:38right i mean that's the speed the
- 7:40maximum speed that we can type
- 7:42um you know humans and human fingers
- 7:46can produce few tensor bytes at the max
- 7:48per second if it is me it's you know
- 7:50maybe a few bytes per second
- 7:52um and then if you're dealing with audio
- 7:55signals which are typically
- 7:57associated you know bluetooth is now
- 7:59used to carry uh
- 8:01general audio signals it is few
- 8:04hundreds of cubes per second it can go
- 8:06up to three
- 8:08mega bytes per second and then when we
- 8:11talk about
- 8:12wi-fi and and ethernet
- 8:15and um you know hard disk drives we can
- 8:18go up to higher speeds
- 8:19but none of them get anywhere close
- 8:21they're typically
- 8:23at least an order of magnitude below the
- 8:25speed of what the processor can do
- 8:27until we get to like thunderbolt and
- 8:31newer pressure dram interfaces
- 8:35now those are generally those that
- 8:37exceed the bandwidth of what the core
- 8:40can
- 8:40read and write are designed to support
- 8:43higher
- 8:43end processors and those that have
- 8:45multiple cores because each of these
- 8:47cores
- 8:48may have a desire to load or store the
- 8:51data to the memory
- 8:54so generally
- 8:58common io devices neither deliver nor
- 9:00accept data matching the processor speed
- 9:03we have to have some way
- 9:04to adjust to that and we're going to
- 9:06take a look at a few
- 9:09possible options how to do that after a
- 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.