[CS61C FA20] Lecture 02.1 - Number Representation: Intro, Bits can be anything — Transcript
Full transcript
- 0:01welcome to 61c's lecture on
- 0:03number representation
- 0:05[Applause]
- 0:08great to have you here let's jump right
- 0:09in
- 0:11one of the things you're going to see
- 0:12about data that lives all around us
- 0:15is that typically the data begins in the
- 0:18analog domain
- 0:19and we need to convert it to the digital
- 0:21domain so the real world is analog
- 0:23everything you hear and see
- 0:25and smell is all analog it's all fine
- 0:28real numbers but you need to then
- 0:29convert those to digital numbers to be
- 0:30able to work with them and do things
- 0:32with them
- 0:32so in order to convert analog data to
- 0:35digital data we must do two things
- 0:37number one we have to sample so that
- 0:39means we have to ask it
- 0:41at every time step what's your value and
- 0:44that usually is a regular interval
- 0:46and for example for music for cds that's
- 0:4844
- 0:49100 times a second we're asking it what
- 0:51its height is
- 0:53but then the problem is the height might
- 0:54come out at some fractional number and
- 0:56we need to then quantize that which
- 0:58means divide it up
- 0:59kind of in in in its amplitude
- 1:03and you ask it what is its amplitude on
- 1:04some yardstick and so
- 1:06we will we'll see how to do this this
- 1:09lecture this series of lectures
- 1:11we divide it up into a 16 bit number so
- 1:13that's
- 1:142 to the 16 possible tick marks on a
- 1:17yardstick
- 1:18or 65 536 different tick marks and we
- 1:21say
- 1:22where are you and some of these might
- 1:23not exactly align so it kind of snaps to
- 1:25the closest tick mark to figure what
- 1:26that is
- 1:27when we're all done we have a set of
- 1:29samples and then we can work with that
- 1:31so that's how we bring
- 1:32analog data into the computer
- 1:36however not all not all data digital
- 1:38data is necessarily boring analog
- 1:40sometimes you can just go into a system
- 1:42and create
- 1:44art create music create videos create
- 1:46sound completely without any analog
- 1:49reference so here are two pictures uh by
- 1:52pavre pavre is a animation software
- 1:55a rendering software really amazing free
- 1:57open source go check it out
- 1:58and here are two beautiful pictures that
- 2:00existed only in the author's head and
- 2:02the artist's head
- 2:03until they hear are at beautiful digital
- 2:05images so they don't necessarily
- 2:06come from the outside world they can
- 2:08sometimes come from the pure digital
- 2:10world
- 2:12the big idea in this first lecture this
- 2:14first snippet of this module
- 2:16is that bits can represent anything they
- 2:19can represent characters well i've got
- 2:2126 characters
- 2:22a through z so i'm going to use five
- 2:24bits two to the five is 32 and so i'll
- 2:26have one of these bit
- 2:27patterns for each of those characters
- 2:29well actually probably i want to have
- 2:31uppercase and lowercase and some
- 2:32punctuate punctuation
- 2:34so let's do seven bits and in fact we'll
- 2:37reserve eight bits for it but actually
- 2:39we'll only use seven bits for all the
- 2:40characters we'll need
- 2:41and that's called ascii american
- 2:43standard code for information
- 2:44interchange
- 2:46then you're gonna say well dan that's a
- 2:47little uh american centric and i'd say
- 2:50you're right that that's what the a was
- 2:51for and ascii
- 2:53so it turns out that a group of folks
- 2:55says well how about my language and my
- 2:56language and my language and so
- 2:58a consortium came around called unicode
- 3:00with the idea that
- 3:02you would have the ability to store all
- 3:04the world's symbols
- 3:05used in all the world's languages it
- 3:07turns out there's a lot of those symbols
- 3:09so they then had different versions they
- 3:11have an 8-bit a 16-bit and a 32-bit
- 3:13version of unicode
- 3:15and so you can now by the way emojis are
- 3:17also part of unicode it's pretty cool so
- 3:19you can have many many symbols all the
- 3:21chinese characters all the
- 3:23you know all the other languages
- 3:24characters uh
- 3:26beautiful beautiful language beautiful
- 3:27patterns of how those characters
- 3:29represented
- 3:29all represented in in the unit code
- 3:31probably you need more than eight bits
- 3:33for that though
- 3:34you also represent logical values zero
- 3:37is false one is true is a common way we
- 3:38do that
- 3:39how about colors here's r g and b red
- 3:41green and blue
- 3:42uh zero zero is red zero one is green
- 3:45and
- 3:46one one is blue that's just to make it
- 3:48there you can you don't have to have it
- 3:49in order by the way you could do that
- 3:50that way
- 3:51locations addresses commands emotions
- 3:56happy is zero zero kind of grumpy is
- 3:59zero one
- 4:00you can end up having a bit pattern for
- 4:01everything anything you can
- 4:03itemize you can digitize it's pretty
- 4:05exciting so
- 4:06here's the big idea of this lecture
- 4:08memorize this remember i'm gonna have
- 4:10a couple of times during this lecture
- 4:11i'm gonna say memorize this this is one
- 4:13of those times
- 4:14n bits is two to the n things
- 4:18or said another way if i've got two to
- 4:20the n i've got some number of things how
- 4:22many bits do i need
- 4:23i take the log base two of that and take
- 4:25the ceiling of that and that's the
- 4:26number of bits i need okay so
- 4:2828 26 character 26 letters as example 26
- 4:31letters okay
- 4:32log base 2 of that is 4 point something
- 4:35the ceiling of that is 5 therefore i
- 4:37need 5 because 2 to the 5 is 32
- 4:39so it's the biggest power of 2 bigger
- 4:40than the number of things i want to
- 4:41store
- 4:42all right see the next video
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 02.1 - Number Representation: Intro, Bits can be anything by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 929 words across 154 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.