This section will introduce you to the various ways data is stored and
utilized inside our computing devices.
Topics will include binary, hexadecimal, ASCII, unicode,
integers, real numbers, textual data, images and video.
Examples for each will be given and explained.
People worldwide have standardized on the decimal number system.
Today's computers have standardized on the binary number system.
We're going to explore these two topics in this video.
My name is Tim Buchalka from the Learn Programming Academy.
This is my learn to code series here on Youtube.
Counting is a basic concept in society today we all count.
How many players are on the playing field at one time for a baseball team?
How many classes are you taking right now?
How many months left in this calendar year, etc.
Our answers utilize the decimal number system: 9, 2 and 5, for example.
Most of us learn the decimal number system also known as
base 10 when we were very young.
The decimal number system has 10 digits to represent any number.
As you know, these digits are 0 1 2 3 4 5 6 7 8 and 9.
To represent any number, we use a combination of these digits.
For example, 439 is expressed in decimal notation by
using a 4 a 3 and a 9, 439.
Each position in any notation including the decimal notation
is associated with the quantity.
In our 439 example, the 9 is the position associated
with the quantity 1.
The 3's position associated with the quantity 10 and the 4th the position
associated with the quantity 100.
To find the value of the entire 439 expression, we multiply the value of
each digit by the quantity associated with that digit's position and then
add the resulting products together.
For example 4 times 100 plus 3 times ten plus nine times one equals 439.
To summarize, in the decimal number system, the right most
position is the quantity of one.
Moving one position to the left, the quantity is ten.
Moving one more position to the left the quantity is 100.
One more to the left, the quantity is one thousand, then ten thousand,
one hundred thousand and so on.
You and I probably do this every day, but we really look
at the mechanics behind the numbering system we're using.
You simply take it for granted.
Computers perform all its operations in binary, also known as base 2 and
stores this data in binary, no matter what storage device is being used.
However, an app or a program can then convert or show the
manipulation of the data in any format needed, including decimal.
The computer is using binary behind the scenes and you're
insulated from that and don't actually have to work in binary
yourself unless you really want to.
As someone who did a lot of work in binary or more correctly machine code
back in the early 80s when I started out, not having to deal with binary
very much itself is a wonderful thing.
Just to be clear though before i go on any further, you don't have to
program or use binary in this course, and it will be relatively rare that
you will ever need to use it when or if you're programming, knowing
that a computer system uses binary will in my opinion make you a better
programmer and consumer because you know what's happening under the hood.
Rather than the computer being a magic box, you'll understand
what the computer is doing.
All right, so now on to a brief discussion of
the binary number system.
In the binary number system, there's only two digits available 0 and 1.
Now this is perfect for our digital computing devices as a digital
signal is in one of two states either a 0 or a 1 or in other terms
a yes or no, a true or a false and on and off, open or closed,
positive or negative et cetera.
The computer simply cannot store 439 as a decimal number and so
it converts it to a binary number that represents decimal 439.
In this case, that would be 1 1 0 1 1 0 1 1 1.
Each decimal position moving from right to left is an order of magnitude
of power larger, for example 1, 10, 100, 1,000, 10,000, 100,000
etcetera for the decimal system.
But in the binary system, the order of magnitude is a power of
two rather than a power of ten.
For example 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024 etc.
It's interesting that we use a decimal number system to show
you the binary position values.
To find the value of the entire 439 expression using the binary
number system, 1 1 0 1 1 0 1 1 1, we multiply the value of each digit
0 1 by the quantity associated with that digit's position we then add
the resulting products together.
For example, 1 times 256 plus 1 times 128 plus 0 times 64
plus 1 times 32 plus 1 times 16 plus 0 times 8 plus 1 times 4
plus 1 times 2 plus 1 times 1 equals 439.
Keep in mind that you and I might type decimal 439 on our
keyboard and it'll show on the display monitor decimal 439.
But inside the computer, it's encoded into binary 1 1 0 1 1 0 1
1 1 for manipulation and storage.
Only when it's needed for display or print out to humans is it
converted back to decimal 439.
One final thought about binary, each digital position is considered a
bit which is short for binary digit.
Computers group eight bits together and call those a byte.
The largest number that a byte can represent is 255.
Calculate this by adding the decimal equivalent for each bit
moving left to right, 128 plus 64 plus 32 plus 16 plus 8 plus
4 plus 2 plus 1 equals 255.
This decimal number is not very large so computers group more 8-bit values
together for example 32 bits or 4 bytes, 4 groups times 8 bits equals
32 and then the largest decimal value that all these 32-bits can represent
assuming each bit position is a 1 not a 0 would be greater than 2 billion.
Before going on to the next video, I suggest you try to convert a few
decimal numbers into binary and check your results with this slide.
Perhaps, pause the video right now as you try this using paper
and pencil and have some fun.
So I hope you had some fun with the binary challenge and that your results
matched what you saw on the slide.
If not, perhaps a review of this video would be helpful.
Moving on to the next video, I'll introduce some other data
representation schemes, namely hexadecimal, ASCII and Unicode.
See you in the next video.
Thanks as always for watching.
This is the part of the video where I meant to get all enthusiastic
and to ask you will quite literally beg you to subscribe to my channel
and to like the video, leave a comment and all that stuff.
Well, I'm going to leave that decision in your capable hands
to decide whether I've earned a like or a subscriber or a comment.
I'd be grateful if you do one, both or all three.
More videos will get out there in front of a bigger audience if
I get that level of engagement, but obviously it's your choice.
All right, so remember that this series was meant to
be watched in order so.
If you haven't watched from the start, then how dare you watch
my video series out of order.
Click the link over here to get to the first video in the series and
watch that if you want to see the entire series in order or come over
here and click to view the previous video in the series again your choice.
All right, I'm done catch you in the next video.