[CS61C FA20] Lecture 24.1 - Caches I: Binary Prefix — Transcript
Full transcript
- 0:10oh
- 0:11sorry i didn't see you there didn't see
- 0:13you there hold on let me
- 0:14just pass this on to my friend welcome
- 0:17to cs61c
- 0:19cache is part one great to see you as
- 0:22always
- 0:23let's get right in so we're first going
- 0:25to learn about something called the
- 0:26binary prefix
- 0:28this is really important as you're
- 0:29learning about caches and as you're
- 0:30learning about how to work with
- 0:32um two to the blank blank what does that
- 0:35even mean
- 0:35how to think about how many bits and
- 0:37code a certain space all those things
- 0:38were learned
- 0:39in this next very short video so let's
- 0:41go back in time
- 0:48and these were commonly used s.i system
- 0:51international i believe it's called
- 0:53uh prefixes that we use for things so if
- 0:56you had
- 0:57uh i got a a kilo oh dude i got a key
- 1:00this is like uh
- 1:01scarface i got a key if you got a key of
- 1:03something that's a kilo it's a thousand
- 1:05of something
- 1:06but in fact people were using a kilo to
- 1:08describe powers of two you know they had
- 1:11you notice that the difference there's a
- 1:12big difference between
- 1:14only a very small difference between
- 1:15something you know here's base 10 a kilo
- 1:18of something
- 1:18and this thing that we didn't have a
- 1:20name for uh 1024 adds a little bit
- 1:23but as you continue to grow well how
- 1:24about a mega i got a mega something it's
- 1:26a million
- 1:27but you know here is you know it started
- 1:30at 48 000. now it's a little bit bigger
- 1:31than that so
- 1:32and as you as you continue to grow
- 1:34notice it here it's you're now off by a
- 1:36full
- 1:37say 20 so there's an issue and we never
- 1:40really had a solution
- 1:42um to this there is a historical note
- 1:45you see there in the second bullet which
- 1:46is
- 1:47hard disk manufacturers started years
- 1:50and years ago by using powers of two you
- 1:52notice powers of 10 are smaller than
- 1:53powers of two
- 1:54and so they'd say you know i i have a
- 1:57hard drive that was a 10
- 1:58meg hard drive they used to be two to
- 2:01the
- 2:0220 times 10 so uh
- 2:05that was 10 of mega which is 2 to the 20
- 2:08bytes
- 2:09and they realized wait if we actually
- 2:12use the proper terminology mega is a
- 2:15million and a million is smaller than
- 2:16this 2 to the 20.
- 2:17so they decided to then move to using
- 2:20that so in fact if you get a 10
- 2:22meg drive and nobody gets to me you know
- 2:2310 gig drive now 10 terabyte drive
- 2:25it's not the left column of powers of
- 2:28two it's it's the right column of powers
- 2:30of 10.
- 2:30and so they realize they can be a little
- 2:32cheap on things so when you format it
- 2:33not only
- 2:34formatting is also some overhead but the
- 2:35point is you don't get a drive that's
- 2:37actually into power too
- 2:38even raw bits it's the power of 10
- 2:40powers of two and we also use
- 2:41in networking we use uh the base 10
- 2:45for networking so if i have a gigabit
- 2:47network it is a
- 2:4810 to the ninth bits per second that's
- 2:50that's always been that way and that's
- 2:51fine so
- 2:52network transmission is base 10 hard
- 2:54riser base 10 everything else caches
- 2:56memory everything else is base two and
- 2:59so
- 3:00we want to make sure we talk about this
- 3:01in the right way i can't just say a kilo
- 3:03how much how big is your cash a kilo
- 3:05it's a kilobyte well do you mean a
- 3:06thousand bytes or do you min 1024
- 3:08let's actually make sure we have a
- 3:09distinct word for that we can't just
- 3:10keep using kilo
- 3:12we can't overlook keep overloading kilo
- 3:15enter the iec um international
- 3:18electro technical commission in 1999 a
- 3:21big deal introduced these
- 3:22binary prefixes and the idea was they
- 3:25kept the same
- 3:26columns as you had before k m as you see
- 3:29up top k
- 3:29m g t p e z y except
- 3:33that they added a little bit of an i
- 3:35here so each of these you see there's a
- 3:36little i in front of them
- 3:38um and in fact the way they pronounce
- 3:40them
- 3:41is um it's like the kilo and the mega
- 3:44and they give you so the first two
- 3:45letters are the same
- 3:46but then you add bi for binary to make
- 3:48it distinct
- 3:49but rather than call it bi so rather
- 3:51than kid buy
- 3:53me buy they wanted it maybe they sounded
- 3:55better
- 3:56to call it b so it's maybe kibby mebby
- 3:59gibby
- 4:00tabby pebby eggs be zebby and yabby
- 4:02that's how you pronounce them
- 4:03okay and now we have distinct meanings
- 4:05and that's just great so now we can be
- 4:06just saying oh i got a 10
- 4:08teddy drive i know i you know i'm 10 2
- 4:10to the 2 to the
- 4:11uh 40 not 10 to the
- 4:1512. so that's great much much better
- 4:17there
- 4:20you're going to ask yourself well how do
- 4:21you memorize these things if i say that
- 4:22and you want to be able to make a
- 4:23connection between
- 4:24what these what the or at least the
- 4:26order of it is so this is a fun
- 4:28challenge that i offered to 61c students
- 4:30years ago
- 4:31and i said come up with a mnemonic come
- 4:34up with a way to remember this sequence
- 4:36that no one else has i think this is a
- 4:38berkeley invention this is the way to
- 4:39remember these so
- 4:40feel free to use any of these 10 i'm
- 4:41going to show you whichever one kind of
- 4:43rings true to you so let's jump right in
- 4:46kid meets giant texas people exercising
- 4:49zen like yoga
- 4:50and i try to actually give credit to the
- 4:51student who did that i want to give them
- 4:52anybody with the last name but i gave
- 4:54their first name
- 4:54um and in the challenge i made sure the
- 4:57first two letters are the same first two
- 4:58letters everybody so you can
- 4:59once you say ki make any word with ki
- 5:01star uh you know it's a me star et
- 5:04cetera
- 5:04okay kind men give ten percent
- 5:07extra zestfully that's pretty cool
- 5:10some of these are pretty good kissing
- 5:12mentors gives testy persistent
- 5:14extremists
- 5:15zealous youthfulness kindness means
- 5:19giving
- 5:20teaching permeating excess zeal
- 5:23yourself i feel i feel like connected to
- 5:26that one myself
- 5:27killing messengers don't kill the
- 5:29messenger right killing messages give it
- 5:30gives terrible people
- 5:32exactly zero yo you have to do the hand
- 5:34yo either the hand
- 5:35i know the help this is the yohan i'm up
- 5:37i'm giving some gang sign out there
- 5:39um kindergarten means giving teachers
- 5:42perfect examples of zeal in youth i love
- 5:45that
- 5:48kissing mediocre giraffes teaches people
- 5:50to expect zero from you
- 5:52kinky mean girls teach people exciting
- 5:56zen yoga kissing mel gibson
- 5:59teddy pendergrass exclaimed zesty yo
- 6:03that's the one i remember actually when
- 6:05i'm thinking is it z y i'll actually say
- 6:07that one i'll say
- 6:08i'm revealing a little bit of my head
- 6:10here i actually say that one when i try
- 6:12to remember it if i
- 6:13said easy is it easy y-e-y-z i use that
- 6:15one if i get stuck
- 6:16and here's my favorite one and it's not
- 6:18the one i use but it's my favorite one
- 6:19kissing me gives 10
- 6:21extra zeal in youth so tell that to your
- 6:23friends tell their friends
- 6:24not talking about kissing dan but
- 6:25kissing yourself you know hey
- 6:27ralph what sue kissing me gives 10 extra
- 6:30zeal in youth
- 6:31okay anyway whatever you decide to use
- 6:34pick one of these
- 6:35pick make your own up but remember this
- 6:37sequence
- 6:38this year where all of our uh all of our
- 6:40exams are going to be open book but in
- 6:42the future
- 6:42we might go back to closed book and we'd
- 6:44like to be able to have you memorize
- 6:46this so this is a good thing
- 6:47what is 2 to the 34 how many bits to
- 6:49address that uh how many bits to address
- 6:512.5 tebby b
- 6:52uh heavy bytes of something so these are
- 6:55two questions that you might
- 6:57um want to be able to answer quickly and
- 6:59in fact i
- 7:00encourage you as a 621c soon-to-be
- 7:02graduate
- 7:03to be able to be fluent in this space so
- 7:06the way i think of it
- 7:07is i want you to memorize these two
- 7:09tables in fact i'm going to actually
- 7:10have a little have a little sound here
- 7:12to say please do think about memorizing
- 7:15these tables and the way
- 7:16to do this the way to to know how to do
- 7:18this is the following
- 7:202 to the xy x is the tens column and y
- 7:22is kind of the ones column
- 7:25i start with the ones column and it's
- 7:27really easy to memorize this one let me
- 7:28just grab
- 7:29so you want to be memorizing this this
- 7:31sequence right here
- 7:32okay so zero one two
- 7:36four eight sixteen thirty two we're up
- 7:38five now six
- 7:39sixty four i'm not even looking i'm
- 7:40closing my 64 128
- 7:42256 is eight that's another important
- 7:45one because eight bits
- 7:46used to control 256 different color
- 7:49channels for a
- 7:50standard old-school monitor including
- 7:52the ppms you worked with
- 7:53um if you did uh 61c this semester when
- 7:56we did that
- 7:57assignment that had ppms 9 5 12
- 8:00and then 10 well 10 is the next one okay
- 8:02so that's all you remember so those nine
- 8:04and then you go back to the kibi member
- 8:07gibby
- 8:08tabby pebby eggs be zebby yabby and you
- 8:10have that sequence
- 8:11and that is the x that's the tens column
- 8:13so you hit very quickly ready
- 8:1534. in my brain i'm saying 4
- 8:18is 16. okay see look i'm looking 4 is 16
- 8:22okay 30s well the 30s is gibby so i'd
- 8:25say 16 gibby
- 8:26did i get it right i did okay that's
- 8:29pretty cool
- 8:30so let's do another one uh i almost feel
- 8:33like i have a random thing here we go
- 8:3547 128 tabby
- 8:38pretty cool 64. man i got a 64-bit
- 8:42address space
- 8:43how many bytes of memory can i access
- 8:4564.
- 8:4616xb wow that's pretty cool
- 8:50so continue to think about that and now
- 8:51the reverse of that is the following
- 8:53if i say i want to be able to address
- 8:552.5 tabi bytes
- 8:57well how many is that well what you do
- 8:58is you take 2.5
- 9:00and you take the ceiling of that what's
- 9:01the next biggest power of 2 above that
- 9:022.5 is bigger than 2 so it would be 4.
- 9:05so i'd say 4 that'd be 2. okay so i'm
- 9:07going to say
- 9:08something two tabby is four so i'd say
- 9:1142
- 9:12i think you need 42 bits to address 2.5
- 9:15tubby bytes
- 9:16because 42 bits is 4 tepe and 4 tibia is
- 9:19the next big power of 2
- 9:20above 2.5 tubey bytes okay so
- 9:23we often call this the iec numbers but
- 9:25here binary prefixes is the right name
- 9:27so from now on this is the beginning
- 9:29lecture on caches
- 9:30and this lecture really could have gone
- 9:32in fact maybe
- 9:33i'm moving flying these lectures into
- 9:35small pieces could have really gone the
- 9:37first lecture because
- 9:38it would be fun to have this kind of be
- 9:39fluent about this from the beginning of
- 9:41the semester but you don't really need
- 9:42it until caches and so this is in the
- 9:44cache lecture but i hope in the future
- 9:46this lecture's in the front and
- 9:47feel free to ignore this little bit
- 9:48about it if it actually is in the front
- 9:49why we should move it because it already
- 9:51has moved
- 9:51if we happen to do that okay you
- 9:53understand that but it's fine all right
- 9:54we'll see the next lecture and we'll
- 9:56learn more about caches thanks
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 24.1 - Caches I: Binary Prefix by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,990 words across 317 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.