Welcome to our new lecture
In the last lecture we saw
What are memory units? and how data is represented
We know that in low level language the data is written in
101 which is understood by computer we also saw conversion
decimal to binary and in the last video we also saw what
are our memory units they are bit byte, nibble and data is
stored in word so
we saw that 1 byte how it is decided? it is decided on data
type what type of data we are trying to store if that data
is of integer type then it will take 4 byte that also
depends on the compiler that it will be 4 byte or 2 byte
some compilers are like
this which allocate space of 2 byte some are like this if I
talk about modern compilers they allocate 4 byte so we
understood this thing that in 1 byte there are 8 bits and
if someone ask you that how many nibbles are there in 1
byte you can say that
there are 2 nibbles so this was clear to me we saw till
here and we also saw that if I try to store character type
data then I have to convert equivalent decimal value in
binary then only our machine can understand is it clear?
let's move ahead there
are some number conversions in which we have seen many
examples we will understand those examples one by one and
we will see why this conversion is done what is the need of
hexadecimal what is the need of octal when I had binary and
we can understand
binary but if I go to binary and take a big number say I
took a big number 35000 if I convert it in binary then what
will be the hypothetical number suppose it comes like this
1010101111100 to tell this I will not be able to remember I
will not be able
to keep it so octal made it smaller hexadecimal made it
smaller you can also represent data in the form of ABCDEF
you can tell what will be the number in your hexadecimal
you can tell 20FX no it will not be X because it is from A
to F so you can say 256ACD
we also saw this in the last video so let's open our
whiteboard and see what notes we have let's try to
understand things under the line let's break things so I
have opened the whiteboard what we will see number
conversion we have seen many types of number
conversion see here decimal to other base system let's see
what is written in number conversion there are many methods
or techniques which can be used to convert numbers from one
base to another now I know base can be anything base can be
2, base can
be 8 base can be 16 base can be 10 if there is a base of
any number then what I say
I can recognize it that it is a binary number similarly if
I have a base 8
I can recognize it that it is an octal number similarly if
I have a base 16
I can recognize it that it is a hexadecimal number
similarly if I have a base 10
I can recognize it that it is a decimal number
I can recognize it now why we need a base suppose here 20
is written and here also if I write 20 here then how I can
recognize that it is an octal number or hexadecimal number
or decimal number so for this we can use a simple base from
which I can recognize
that it is a base from this base we can convert other
numbers we will demonstrate here the following we are going
to see all these things decimal to other base system if a
decimal is given then I can convert that decimal
I can convert it in binary
I can convert it in octal
I can convert it in hexadecimal other base system to
decimal means vice versa
I can convert binary in decimal
I can convert hexadecimal in decimal or I can convert
octimal in decimal other base system to non decimal means
hexadecimal, octal and binary there are some shortcut
methods if you want to convert octal from binary then this
is the shortcut method it
will be done in a snap in competitive exams you should know
about shortcuts for octal to binary
I have a shortcut method if you want to convert hexadecimal
from binary then you will get a shortcut method for that
also there is a shortcut method for hexadecimal to binary
so we are going to see all these shortcut methods with
example so let's see
first we have decimal to other base system means I have a
decimal number how to convert it in other base system there
are some steps let's see what are the steps first step want
the decimal number to be converted by the value of the new
base means if
you are converting decimal number in binary then you will
divide it by 2 ok you will divide it by that new base if
you are doing my decimal number you are converting it in
octal for octal you have to divide new base by 8 if you are
converting it in hexadecimal
then your base is 16 that is 16 so you will divide it by 16
second step is get the remainder from step 1 whatever is
the remainder from step 1 is the right most digit least
significant digit of new base number so you have to take
that remainder now we
will see if you are not able to understand what is the
remainder in step 1 then we will visit it again in step 3
you have to take the quotient of previous divided by the
new base means whatever is the quotient you have to divide
it again in the end record
the remainder from step 3 as the next digit to left of the
new base number before going anywhere we will show you
repeat steps 3 and 4 getting remainders from right to left
until the quotient becomes 0 in step 3 the last remainder
thus obtained will be
most significant digit you have to divide it again in the
end record the remainder from step 3 as the next digit to
left of the new base number before going anywhere record
the remainder from step 3 as the next digit to left of the
new base number before
going anywhere record the remainder from step 3 as the next
digit to left of the new base number before going anywhere
record the remainder from step 3 as the next digit to left
of the new base number before going anywhere record the
remainder from step
3 as the next digit to left of the new base number before
going anywhere record the remainder from step 3 as the next
digit to left of the new base number before going anywhere
record the remainder from step 3 as the next digit to left
of the new base
number before going anywhere record the remainder from step
3 as the next digit to left of the new base number before
going anywhere record the remainder from step 3 as the next
digit to left of the new base number record the remainder
from step 3 as
the next digit to left of the new base number before going
anywhere record the remainder from step 3 as the next digit
to left of the new base number before going anywhere record
the remainder from step 3 as the next digit to left of the
new base number
before going anywhere record the remainder from step 3 as
the next digit to left of the new base number before going
anywhere record the remainder from step 3 as the next digit
to left of the new base number record the remainder from
step 3 as the next
digit to left of the new base number before going anywhere
record the remainder from step 3 as the next digit to left
of the new base number before going anywhere record the
remainder from step 3 as the next digit to left of the new
base number before
going anywhere record the remainder from step 3 as the next
digit to left of the new base number before going anywhere
record the remainder from step 3 as the next digit to left
of the new base number record the remainder from step 3 as
the next digit
to left of the new base number before going anywhere record
the remainder from step 3 as the next digit to left of the
new base number before going anywhere record the remainder
from step 3 as the next digit to left of the new base
number before going
anywhere record the remainder from step 3 as the next digit
to left of the new base number before going anywhere record
the remainder from step 3 as the next digit to left of the
new base number record the remainder from step 3 as the
next digit to left
of the new base number before going anywhere record the
remainder from step 3 as the next digit to left of the new
base number before going anywhere
Again, I'm repeating
Repeat Step 3 and Step 4
Write most significant digit of the new base number
Repeat Step 4 and Step 5
Write most significant digit of the new base number
Write least significant digit of the new base number
1 1 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 Step 1 is step 2 is how can
you convert binary to octal directly divide the binary digit
Into groups of three starting from the right
Okay, after that convert each group of three binary digit
to one octal digit
Simple is what it means to say whatever number has been
given to you, divide it into three groups.
What number has been given to me is 1 0
1 0 1 its base is 2 Step 2 is divide it into groups of 3
Step 3 is 1 0 1
Step 4 is 0 1
Step 5 is 0 1
Step 6 is 0
Step 7 is 0
Step 8 is 0
Step 9 is 0
Step 10 is 0
Step 11 is 0
Step 12 is 0
Step 13 is 0
Step 14 is 0
Step 15 is 0
Step 16 is 0
Step 17 is 0
Step 18 is 0
Step 19 is 0
Step 20 is 0
Step 21 is 0
Step 22 is 0
Step 23 is 0
Step 24 is 0
Step 25 is 0
Step 26 is 0
Step 27 is 0
Step 28 is 0
Step 29 is 0
Step 30 is 0
Step 31 is 0
Step 32 is 0
Step 33 is 0
Step 34 is 0
Step 35 is 0
Step 36 is 0
Step 37 is 0
Step 38 is 0
Step 39 is 0
Step 40 is 0
Step 41 is 0
Step 42 is 0
Step 43 is 0
Step 44 is 0
Step 45 is 0
Step 46 is 0
Step 47 is 0
Step 48 is 0
Step 49 is 0
Step 50 is 0
Step 51 is 0
Step 52 is 0
Step 53 is 0
Step 54 is 0
Step 55 is 0
Step 56 is 0
Step 57 is 0
Step 58 is 0
Step 59 is 0
Step 60 is 0
Step 61 is 0
Step 62 is 0
Step 63 is 0
Step 64 is 0
Step 65 is 0
Step 67 is 0
Step 68 is 0
Step 69 is 0
Step 70 is 0
Step 71 is 0
Step 72 is 0
Step 73 is 0
Step 74 is 0
Step 75 is 0
Step 76 is 0
Step 77 is 0
Step 78 is 0
Step 79 is 0
Step 80 is 0
Step 82 is 0
Step 83 is 0
Step 84 is 0
Step 85 is 0
Step 86 is 0
Step 87 is 0
Step 88 is 0
Step 89 is 0
Step 90 is 0
Step 91 is 0
Step 92 is 0
Step 93 is 0
Step 94 is 0
Step 95 is 0
Step 96 is 0
Step 97 is 0
Step 98 is 0
Step 99 is 0
Step 100 is 0
How to convert binary to hexadecimal?
How to make 5 from 4 and 1?
It means 1 0 1 1 0 1 0 and here 2
How to know 1 0 1?
Make a short cut 1 2 4 8 16 4 and 1
Make 5
Write 1 1
Write 0 0
Make 4
Remove 2
Write 0 0 0 1 0 1 0 1 and here 2 Now I know my hexadecimal
number is 15
How to convert it in binary? 1 0 1 0 1
Now How to convert my decimal number in octal?
Here is an example
This is your decimal number
Can be done by dividing the number by 8
It means, if you want to convert it directly in decimal to
octal, then convert it by 8
It is very easy to understand that I have a decimal number
Ok What I used to do?
If I had a decimal number and I asked to convert it in
binary
You will say, ok convert it in binary and divide it by 2
I said, do one thing
If you have a decimal number, then convert it in octal and
not in binary
So, you know
Octal has a base of 8
So, if I divide it by 8 directly then it is very easy to do
it
So, How to divide 8 by 8?
This can be done by dividing the number by 8
That's all we know
Using repeated division method
Double double method
Remember, what is the meaning of double double method?
The repeated division is done and the remainder is taken
It can be done as follow
Example, find the octal equivalent to 158
I have 158
Take it
Divide it by 8
I divided it by 8
When I divided it by 8
Then how much it is?
It is 19 Let's multiply it 8 multiplied by 9 72 27 8
multiplied by 1 19 9 multiplied by 8
How much it is? 8 multiplied by 1 16 72 It is 152
And Remainder is 6
It is 19
Remainder is 6
Then I divided it by 8
When I divided it by 8
Then how much it is?
It is 2
Remainder is 3
Now, I will try to divide it by 8
It is not possible
So, I have 2 3 and 6
The equivalent number in octal system is 2, 3, 6 8 It means,
You have taken 2, 3
You have taken the remainder 2, 3, 6 8 It is in octal system
You have taken the decimal number 158 It is 236
When there is a number in fraction or after the decimal
point that can be converted as 0.42 Suppose It is given in
this way
If there is a number in decimal point
Then you have to do like this
Suppose, there is 0.40
Then you have to multiply it by 8
And the number 3.20 You have to take 3 1.6 4.80 6.40 Now,
here
Floor and ceiling 1.5 I should have taken 2 1.60 Still,
they have taken 1
So, we see that the number is repeated
This will go on and it will be a never ending process
It happens that you divide it and after the decimal point
you add 0 and it repeats 2.9999999 It is said in this way
So, we can approximate the result as 0.3146 0.3146 0.3146
0.3146 0.3146 0.3146 0.3146 0.3146 0.3146 0.3146 0.3146
0.3146 0.3146 0.3146 0.3146
0.3146 0.3146 0.3146 0.3146 0.3146 0.3146 0.3146 0.3146
0.3146 0.3146 0.3146 0.3146
0.3146 0.3146 0.3146 0.3146 0.3146 0.3146 0.3146 0.3146
0.3146 0.3146 0.3146 0.3146
0.3146 0.3146 0.3146 0.3146 0.3146 0.3146 0.3146 0.3146
0.3146 0.3146 0.3146 0.3146
0.3146 0.3146 0.3146 0.3146 0.3146 0.3146 0.3146 0.3146
0.3146 0.3146 0.3146 0.3146 0.3146
I hope you like this video, if you like this video then
please like this video, share this video with your friends
and tell us in the comment section.
If you have any doubt then please play this video again. I
will meet you in the next video, till then good bye.
If you are ready for undergraduates, to your friends and
they sign up using your referral code, you'll get some
awesome rewards.
That sounds interesting.
For every friend you refer, you earn points that you can
redeem for discounts or even cash rewards, and also get the
job guarantee.
Count me in. I'll make sure to spread the word to all my
friends.