[CS61C FA20] Lecture 24.1 - Caches I: Binary Prefix OLD VIDEO — 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've got a key
- 1:03of something that's a kilo it's a
- 1:05thousand of 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:11um we can't overlook keep overloading
- 3:13kilo
- 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 it's a maybe they
- 3:55sounded better
- 3:56to call it b so it's me b 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 him
- 4:52some anybody with the last name but i
- 4:54gave her their 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 what i remember actually when i'm
- 6:05thinking 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:47now this important one if i tell you 2
- 6:51to the 34
- 6:52how many bits would be needed to address
- 6:552 to the 4 2 to the 34 different things
- 6:57you remember that
- 6:57you know two to the some number how many
- 7:00how many bits is this to encode n things
- 7:03it's two to the
- 7:04n things to and i can go
- 7:07i'll start again
- 7:11what is two to the 34 how many bits to
- 7:13address that uh how many bits to address
- 7:152.5
- 7:16tebby b uh heavy bites of something
- 7:19so these are two questions that you
- 7:20might um want to be able to answer
- 7:23quickly
- 7:23and in fact i encourage you as a 61c
- 7:26soon-to-be graduate
- 7:27to be able to be fluent in this space so
- 7:30the way i think of it
- 7:31is i want you to memorize these two
- 7:33tables in fact i'm going to actually
- 7:35have a little have a little sound here
- 7:37to say please do think about memorizing
- 7:39these tables and the way to do this
- 7:40the way to to know how to do this is the
- 7:43following
- 7:442 to the xy x is the tens column and y
- 7:46is kind of the ones column
- 7:49i start with the ones column and it's
- 7:51really easy to memorize this one let me
- 7:53just grab
- 7:53so you want to be memorizing this this
- 7:55sequence right here okay
- 7:57so zero one two four eight
- 8:01sixteen thirty two we're up five now six
- 8:03sixty four i'm not even looking i'm
- 8:04closing my
- 8:0564 128 256 is eight that's another
- 8:09important one because eight bits used to
- 8:11control
- 8:12256 different color channels for a
- 8:14standard old-school
- 8:15monitor including the ppms you worked
- 8:17with um if you did
- 8:18uh 61c this semester when you had a
- 8:21assignment that had ppms
- 8:239 512 and then 10 well 10 is the next
- 8:26one okay so
- 8:27that's all you gotta remember so those
- 8:28nine and then you go back to the
- 8:31kibi member gibby tabby pebby eggs be
- 8:33zebby yabby and you have that sequence
- 8:35and that is the x that's the tens column
- 8:38so you hit very quickly ready
- 8:3934. in my brain i'm saying 4
- 8:42is 16. okay see look i've been looking 4
- 8:45is 16
- 8:46okay 30s well the 30s is gibby so i'd
- 8:49say 16 gibby
- 8:51did i get it right i did okay that's
- 8:53pretty cool
- 8:55so let's do another one uh i almost feel
- 8:57like i have a random thing here we go
- 8:5947 128 tabby
- 9:02pretty cool 64. man i got a 64-bit
- 9:06address space
- 9:07how many bytes of memory can i access
- 9:0964.
- 9:1116xb wow that's pretty cool
- 9:14so continue to think about that and now
- 9:15the reverse of that is the following
- 9:17if i say i want to be able to address
- 9:192.5 tebby bytes
- 9:21well how many is that well what you do
- 9:22is you take 2.5 and you take the ceiling
- 9:25of that what's the next biggest power of
- 9:262 above that 2.5 is bigger than 2 so
- 9:28it'd be 4.
- 9:29so i'd say 4 that'd be 2. okay so i'm
- 9:32going to say
- 9:32something 2. tebby is 4. so i'd say 42
- 9:36i think you need 42 bits to address 2.5
- 9:39tabby bytes
- 9:40because 42 bits is 4 tepe and 4 w is the
- 9:43next big power of 2
- 9:44above 2.5 tube bytes okay so
- 9:47we often call this the iec numbers but
- 9:49here binary prefixes is the right name
- 9:51so from now on this is the beginning
- 9:53lecture on caches
- 9:54and this lecture really could have gone
- 9:56in fact maybe
- 9:58mookifying these lectures into small
- 9:59pieces could have really gone the first
- 10:01lecture because it would be fun to have
- 10:03this
- 10:03kind of be fluent about this from the
- 10:05beginning of the semester but you don't
- 10:06really need it until caches
- 10:08and so this is in the cache lecture but
- 10:09i hope in the future this lecture is in
- 10:10the front and
- 10:11feel free to ignore this a little bit
- 10:12about it if it actually is in the front
- 10:14why we should move it because it already
- 10:15moved
- 10:15if we happen to do that okay you
- 10:17understand that but it's fine all right
- 10:19we'll see the next lecture and we'll
- 10:20learn more about caches thanks
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 24.1 - Caches I: Binary Prefix OLD VIDEO by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 2,059 words across 328 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.