hi welcome to an Arduino step-by-step course by Robojax this is for absolute beginners
you just need to have a development board and also some components that is needed for that lecture
and you need to have a pc or mac to start learning Arduino
hi in this lecture we are going to learn about number system and bases the numbers that we
use in our financial calculation and daily transactions is based on decimal or base 10.
so numbers are represented in different ways for example the our decimal number which is base
10 every 10 the numbers increase or change or increment we go from 0 to 9 and after that when
it reaches 10 we go to the next place value for example these 5 3 or 299 these are decimal number
and then we have base two or binary. binary mean two in two ways or two position so we have either
zero or one any number you want to represent we will use zero and one for example one zero
one zero zero is one value or a number or one zero one is another so you have no choice of
using other values because all the calculation in computer and storage and actual calculations are
done based on binary because of simplicity 0 and 1. and then we have hexadecimal decimal we said
is referring to 10 and hex means 6 so that is 6 on top of 10 that is 16 that's why we call it
base 16 or hexadecimal hexadecimal goes from 0 to 9 and after that a b c d it goes up to f and here
a 2 e is a number which I’m going to explain all of those and then 1 4b d is also another number
this is a hexadecimal number and then we have octal octal means 8 and that's base 8 and the
number start from zero to eight and after eight it increments back to zero and up to
eight and eight base eight is an eight and five and then fourteen this fourteen is not
equivalent of our own 14 of decimal which I am going to show you how you can create that
we will start explaining with the base 10 which we use this is a decimal and for example when we
write 245 in decimal how we have determined the value of this actually we have this is the first
place of value this is the second place of value and this is the third one and this number goes
from zero to nine which is ten different values and after that because it's repeating when we
have to add here one more and then continue and then when it when this one reaches up to nine and
this reaches nine so will be 99 after that we have no more room to display and we have no choice but
to add one more and this will be one so that's why we read hundred now let's see what it means
first the position 0 the position 1 the position 2 this 5 means because it's base 10
put 10 and put the position at the power and then multiply it by the value now any number to
the power 0 is 1. that's first thing that you have to remember and then 1 times 5 5 so we got 5 here
then 10 to the power because this is a position of this one is 1
10 to the time to the power 1 is 10 times 4 because this is 4 that is 40.
and then this is to the power 2 so 10 to the power 2 times the value is 2 times 2
that is 200. now if we add them all together this would be 245 that's why the value is 245
and now let's have a look at the binary or base 2.
b2 is the same the same principle applies we have one and zero and one so this is a one zero
one a value and the place or position starts from this side position zero position one position two
same thing because this is base two we put the base as a two and then the position
as a power to two to the power zero we said anything to the power zero is one
multiplied by the value one so we got 1 here and then here base 2 to the power the position 1 that
is 2 to the power 1 is 2 multiplied by 0 the value is 0. and here we have the position is 2 so base 2
to the power the position 2 2 to the power 2. pay attention this is 2 to the power 0 2 to the power
1 2 to the power 2 multiplied by 1 this is 4 if we add them all we are getting 5. so this is actually
5 in decimal and the answer because this is in decimal we have to show it at the lower right
corner a number either 8 16 or 10 so that's 10 means this 5 is base 10 so this is a decimal value
now let's have a look at the octal we have 1 6 4 or 164 but this is not decimal this is octal
base 8 the position is the same as before is 0 1 and 2 and let's see the value it goes from 0 to 7
and we don't have any other value when this position reaches 7 we add one more here
and if you see here 1 and 4 then this doesn't mean 14 you will see it
now this is base eight we put a to the power of zero anything to the power of zero is one multiply
by four the position is zero so the value is 4 and here 8 to the power 1 times 6 the value this one
is the position pay attention x 8 to the power 0 1 and then the next one will be 2 and if we have
more we will continue times so this value is 8 times 6 that is 48 and here 8 to the power 2 8
8 is 64 8 times 8 times 1 that is 64. if we add it all together the value is 116. you see now we are
representing a number with lower value and this 10 means base 10 so this is 116 of decimal value
now let's have a look at the hexadecimal or base 16 hexadecimal hex and decimal
and we have 2 b f the position starts from the right 0 1 2
it goes this way and we apply the same rule but before that we have to know some values
the numbers start from 0 to 9 and then we have a b c d e and f and each of these letters have
a value a is 10 b is 11 and c is 12 up to f is 15. so we have to keep this in mind and then
go for example this f means 15. now let's see because this base is 16 we put the base
to the power of the position 16 anything to the power 0 is 1 times this f is 15 so this means 15
and for b 16 to the position 1 times b the value of b is 11 so this b is 176
at this position and if b was here this would have been 11.
and now to the position of 2 so 16 to the power 2 that's the position multiplied by 2 the value and
this is 512. now if we add them together you will see that we got 703 and this is base 10. I’m using
this windows calculator and you can open it by clicking on the start and type calculator
and from here select programmer it has so many other options for different purposes but when
you go for programmer now you can see this bar on the left side of binary we are in binary mode
and in binary we have only zero and one for that reason everything else has been disabled
and all of the numbers so we can enter only one and zero I can just
do some random numbers and it automatically calculates here the decimal value is 365
and binary is this now you can automatically convert it to octal so 555 and in terms of hex
it's one sex d now pay attention here let's go for hex when we go for hex a b c d and f is also
activated now if I use pay attention here if I use 3 f now look at the value in terms of decimal this
is 4095. so with three values which can occupy three spaces we can represent a number that goes
up to four thousand while four thousand you can see occupies four spaces
so that is the beauty of hex you can represent a larger number with smaller
a few characters and if I go further these are like that and you can see
now it's already 16 million but binary takes huge amount of space and this is the way that data is
being processed and stored in memory so you can play with this calculator to get the value because
in Arduino we will be using a lot of hex value and also binary values for that reason we need
to understand this number system and basis please make sure to subscribe by clicking on
the subscribe button in here thank you thank you for watching tutorial from Robojax if you learned
something and found this useful please thumb up as this will help my video in the search algorithm of
YouTube if you have comment or question please post it at the comment section below I try to
answer and reply and don't forget to subscribe so you get updates on my upcoming videos you