Have but what's going on this is Caleb with Debb slopes dot com.
And in this video we're going to be talking about binary.
Now they say there are only two kinds of people in the world.
Those who understand binary and those who don't.
Now if you didn't get that you will understand it by the end of this video.
And the reason for that is that binary is a system of numerical representation that uses a base two
system.
That means there are only two values 0 and 1.
OK.
Now we use a decimal number system meaning it's base 10.
And there are 10 values 0 through 9 and we combine those to make other values of course with place value
etc. etc. but binary simply has 0 and 1.
And in the computer world those values represent two off meaning zero and on meaning 1 K.
This is called boolean logic on or off true or false.
That's that's how it works.
That's binary.
And of course those ons and offs zeros and ones can be combined to perform all kinds of crazy complex
functions and stuff like that.
But let's actually begin with an example that's common to all of us.
The gigabyte right you're probably familiar with the gigabyte.
Our phones come with a certain amount of gigabytes you know often not anywhere near as much as we would
like.
But this video is called Understanding binary So why the heck am I talking about gigabytes.
I'll get to that.
But something we need to know ahead of time is that a gigabyte is made up of megabytes 1024 to be exact
a megabyte is made up of 1024 kilobytes a kilobyte.
Can you guess it made up of 1024 bytes now.
A Byte This is where things get a little mixed up.
A byte is made up of 8 bits.
Ok keep that in your brain a byte is made of 8 bits and if you cut a byte in half guess what you get.
You get a nibble.
Yes.
Seriously go go look it up you can google it it's called a nibble.
That's funny funny funny funny.
All right.
But that's not going actually help us here.
So I want to show you an exploded view of one bit.
OK.
Now here it is.
There are eight different channels.
OK 8 bits right in one bite.
Like I just said and each slot has a value and we're going to star on the far right side with the value
one case of the far right channel is worth one then if we go to the next channel over we're going to
go ahead and up it to two we actually multiply it by two.
The next channel is going to get multiplied by two as well so it's equal to for the next channel 8 then
16 then 32 then 64 and finally 128.
So basically from right to left we are multiplying each channel by two for the next channel.
Now of course this does continue you can go up to 2:56 than 512 than 10:24 et cetera et cetera.
But one bit has eight channels.
OK.
And each of those channels you can see the values for right here.
But what are we going to actually put in these channels what are we going to use it for.
We're going to use binary.
So we're going to basically put a zero in the channels that we don't care about that we don't want and
we're going to put a one in the channels that we do care about.
So here's an example.
0 1 0 0 1 1 0 1.
Well that's great.
But you just said ziran won a bunch of time.
So what does that supposed to mean for me.
Well in order to convert binary into a decimal number all we need to do is simply add the values where
there's a 1 because that means on and off is zero and it means that there is no value.
So from left to right we can add 64 plus eight plus four plus one.
And that gets us 77 so this value 0 1 0 0 1 1 0 1 in binary is the same thing as the decimal number
77.
That's pretty amazing.
That's how binary works honestly it's that easy.
Now if you were to put a one in every single slot 8:1 all the way across and add those up you would
get 255 and if you've ever done any graphic design work or web development work or any type of development
that number's probably familiar when working with color R.G. be colored to be exact now.
RG bead color each channel.
Red Green Blue can go up to a max of 255 and that's because each pixel has a value stored in one bit.
Right.
So Red would be you know maybe 255 unread and maybe 10 on green and 10 on blue it's going to be mostly
red.
And each of those pixels is linked to a particular bit in memory.
That's really cool so that's how it works.
And that's why it's 255 all those values can be stored in a single bit.
Pretty amazing.
Now it's time for a challenge a binary challenge.
I'm going to give you 20 seconds to convert the following three binary numbers into their decimal counterparts.
Be ready be prepared.
You got your notebook you get your pen your keyboard whatever you're going to use maybe your whiteboard
your chalkboard 20 seconds starting now.
All
did you get 19 109 and 238.
Nice.
Awesome work if you didn't go back.
Check it again make sure you did the right thing.
Make sure that you look at the correlation chart.
Get it all down make sure you got it down.
And now we're going to move on.
So we've covered numbers in the decimal system but what about letters.
Obviously when we type binary information gets sent into our keyboard.
But how does that actually turn into a letter.
Of course typing letters and showing numbers on the screen that's not going to work.
So what people decided to do was to create something called ASCII see I.
All right.
And Aski is essentially a correlation chart from a binary value into a letter.
So there's a chart a particular binary value is going to be equal to a particular letter.
Now it could be super duper complicated but it's actually really really easy.
Basically the ASCII to binary and binary to ASCII conversion chart takes the binary representations
of the numbers 1 through 26 for each of the letters in our alphabet and it compares that number with
the place in the alphabet so the value 3 would be the letter C 5 would be e 26 would be Z or Zed depending
on where you from.
And so since the highest placeholder in our binary chart that we'll ever have to use is 16 that gets
you 26.
That's the highest you're ever going to need.
Those are going to be stored in those first five channels and the top three channels are going to help
us know whether or not the letter is capital or lowercase.
Pretty cool.
So we're going to store the number value for 1 through 26 then 128 is always going to be zero.
OK.
It'll never have a 1 unless you're getting into different characters.
But we're just talking about letters for now.
And basically if you want to convert a capital letter you're going to have a one in the Sixty-Four place
and a 0 in the 32 place for a lowercase letter.
You have a 1 in both 64 and 32.
Then after that you basically just read the last five channels and whatever value that ends up converting
into your number or your letter I guess from 1 through 26 right.
Based on the place.
So it's time for a challenge.
You ready prepared.
Good to go.
Here we go you have 30 seconds to convert the following binary word into the ASCII counterpart.
Are you ready 30 seconds starting now.
An
did you get the word code nice if you didn't go back and check should be a capital C lowercase o d e.
Amazing job.
So believe it or not this is how binary works.
Easy is that it's not as intense or scarier.
You know the matrix like as you might think.
No fool it's super easy really cool to work with.
You know thankfully we don't have to actually use binary to program Nowadays we have programming languages
that get converted into assembly language then machine language and then it gets converted down into
binary some super super super smart engineers built that all for us which we can be very grateful for.
So yeah that's binary.
Let's head over to the next video and let's continue learning.
This is Caleb with Deb's slopes dot com.