In Today's video we will look at
how real information can be represented
in our digital computing system or how
does the digital computing system
represent real information. To do that,
let's take a look. So here I am speaking
on the microphone right now. This is
how most of the sensors are.
Real world is not a 0 or a 1 or a
true or false. This microphone that I am
speaking on right now is connected to my
computer. So what is the computer here
well as I speak sound waves I'm creating
sound waves that propagate that hit the
membrane of the microphone that vibrates
that vibration basically resolves in a
waveform that looks like this
now this waveform is a let's say a plot
of value which is let's say voltage on
the y-axis and time in the x-axis so as
I speak and as I change the loudness or
the frequency my of the voice the sound
gets recorded as separate voltage values
if I replayed the if I recorded then it
replayed that I would hear back those
sound values that were recorded now when
this thing is recorded this gets
recorded as an analog value because it
has different possible that in fact it
has infinite possible values between any
voltage range so even if I'd restricted
my voltage range from 0 to 5 some
particular point on this particular
graph might be let's call this point
right here it's call that 1 volts the 1
directly to the right amount of that
might be 1.0 1 volt or it could be 1.0 2
volts or 1.0 9 volts and so forth so
there's infinite possibilities in
real-world signals and the and the
problem here is how do we represent that
in a digital computing system so just
quick recap so most analog most signals
that we have are analog and our goal is
to
represent these analog signals as
digital signals to a computing system or
a processing system that's mostly
digital in nature so here's another
example of potentially a voice value
that was recorded over some time if I
wanted to represent this with a binary
number that we've seen so far let's say
this one goes from zero to five right
here so let's draw a line right in the
middle and say anything below this is
zero anything above that is a 1 so what
have we done
so we basically drawn a threshold line
and indicated that anything above that
is a logic 1 and anything below that is
a logic 0 and what does that signal look
like in that case well if I reproduce
that then this part of the waveform that
was underneath that line is represented
as a zero this peak right here that was
above that threshold line is represented
as a 1 so if I look at the binary
information that I just recorded it is
nowhere similar to the shape of that
waveform so I might be able to capture
some information but there is a lot of
information being lost so I'm not gonna
sound very good so in light of that how
do we represent this kind of information
from physical world or analog world into
a digital computing system that's the
goal for today all right so this
waveform looks complicated so let's go
to a very simple looking waveform which
is a simple sine wave so here's a here's
an example of a sine wave I have 300
samples of that sine wave goes from 0
until 1 so this is the voltage right and
this let's say is the time or the sample
okay now here's a sine wave and just
like before
since the sine wave goes from 0 to 1
let's draw a line right in the middle at
0.5 this way we'll call that line the
threshold line and anything above that
or below that so anything above that is
a logic one anything below that is a
logic zero so
that's what we get so well in this case
since it was a simple sine wave the
information loss is not that great I
mean that square wave if you really
pretend and has the shape of a sine wave
but you really have to pretend to do
that okay now can we do so by the way
what is what is this one bit
representation really mean well it
basically means that there is a on a
digital computer there is a transistor
let's turn on or off so that's that
transistor right there our transistor is
nothing more than a switch okay and a
computing system is built out of
billions of transistors these days and
every bit has a physical meaning it is
when a a particular value is a one that
means that transistor is on it mean one
means on and zero means off all right so
the transistor actually has a meaning so
bits 1 and 0 actually have physical
meaning inside a computing system so
well if if bits are just transistors
what if we represented two transistors
for every number so two bit
representation what that means is we
have two transistors and we'll say that
both transistors are off meaning 0 0 or
it could be that this particular
transistor is on so I could have 0 1 or
it could be that the first transistor is
on and the second one is off so it could
be 1 0 or it could be 1 1 so if I have a
2 bit trend destroyer two switches so I
have two switches like this
well I'm basically enumerated all
potential cases that these switches can
have between on versus off so same
example with a 2 bit representation
here's a sine wave again now with since
I can represent it as two bits let's
call that bottom part 0 0 and there's a
threshold line right here right here
between that we'll call that 0 1 let's
call that 1 0 and then we'll the top
part we'll call it 1 1 so we can now
partition this particular sine wave into
four different chunks
each song is represented by two switches
so 2 bit representation meaning two
switches are dedicated for that or two
transistors are dedicated for that or
two rows of memory are dedicated for
that so here we go so if we do this then
our representation goes from a perfect
square wave to a little funkier and that
funkier wave looks a lot closer to that
sine wave then it did a while back so
what if we did three bits now if we have
three bits we have three switches and
each of the switch could have value 0 0
0 0 0 1 0 1 0 0 1 1 all the way to 1 1 1
so with 3 switches we can represent it
different levels so here it is 0 0 1 0 1
0 0 1 1 1 0 sorry 0 0 0 0 0 1 0 1 0 0 1
1 1 0 0 1 0 1 1 1 0 and a 1 1 1 so those
are the eight different levels now if I
partition this sine wave in those 8
different levels what I see or what I
get is a lot more realistic looking
sadder it's not perfect but it's getting
much much closer to a sine wave than it
did just a second ago with this square
square wave right so the higher the
number of bits the closer we get to
representing a physical quantity that is
actually measured so so far what we
looked at was just 1 bit and now we find
out that a collection of bits is
actually necessary to represent our
signals that are that are being captured
from real-world sensors so
what so here's an example of eight bits
being dedicated or eight switches being
dedicated okay so here's eight bits of
data 1 0 0 0 1 0 0 1 this bit is called
a most significant bit and this one is
called a least significant bit and since
now we have more than one bit
we called 8 bits a collection of 8 bits
like this is called 1 byte B yte a
collection of 1024 bits is called a 1
kilo bit thousand 24 kilo bits is
collected and it's called 1 megabit
thousand 24 megabit gives rise to one
gigabit and so forth so collection of
bits
here's to represent
the number system right now well now why
does a computer use a binary number
system anyway well let's ask another
question instead of asking why binary
let's ask ourselves well why do we use
the decimal number system why do u is
zero through nine almost likely it's
because it's easier to count in the
hands and if I count in my hands I have
exactly ten fingers so zero through nine
becomes much more intuitive similarly on
the computer side the transistor can be
represented as either on or off so we
can count in a on a computer using this
transistor switches as either on or off
so that's why we have a binary number
system now next we're gonna look at how
do we count so well let's before we
figure out how do we how do we count as
a computer count let's go and look at
how do we count so typically when we
count right so typically when we can we
count from zero through nine we count
zero through nine what happens after we
get to nine we run out of our digits so
we start pairing digits right so how do
you pair it is it so we basically say
okay well zero through nine well that's
done so let's grab this one place it
here and call it one and then we'll
basically repeat zero through nine with
a 1 written in front of it well that's
all done and then we go to the next row
of the first column and say well let's
grab that two and let's start adding
to their and so forth and so on and we
eventually get all the way to 89 and
then what happens we basically say well
let's write down zero to nine again but
this time we're gonna grab this nine so
90 91 92 93 94 95 96 97 98 99 when we're
done with that we're done with every
single view every single digit on the
first column so we say okay let's grab
one zero bring it here and write down
one zero and basically pair zero one
zero put a 1 through it and so forth
until one zero and we got a nine and
then we move on to the next column and
and start writing our next row and start
writing 1 1 and a 0 and all the way
through 1 1 9 and so forth that's
exactly how we count so in binary the
counting is actually even easier because
we only have 0 & 1
well we only have 0 & 1 so well it got
lost in that mess right there but let's
say in binary we only have 0 & 1
well we're done well just like before
now let's let's start collecting our
grouping more than 1 bits so in that
case now what do we have well we're done
with 0 & 1 so let's just write down 0 &
1 and take this one right here and add a
1 0 and a 1 1 well we're done with the
first column let's move on to the second
column so again we write a 0 and a 1 and
basically add a 1 0 in front of this a 1
0 in front of that while we're done with
that rule well let's add a 0 and a 1
again and use this and we write the 1 1
0 1 1 1 well we counted from 0 1 2 3 4 5
6 7 so far so that's how we count in
binary so here's a quick count so here's
a count of 0 through 15 decimals and a
corresponding count in binary in the
next video we'll continue with this and
go in a little bit depth between decimal
our number system and the binary number
system.