 Hello friends. I am Sanjay Gupta. I welcome you on my YouTube channel. My channel contains various programming related videos. It contains approximate 800 plus videos. You can search those videos through the keyword programming by Sanjay Gupta. So please follow my YouTube video if you want to learn programming languages. If you have any queries, you can connect with me by following this email ID or WhatsApp number. In this video, I am going to discuss how you can convert decimal number system to octal binary and hexadecimal number systems. So first, we are going to convert integer numbers. So these are some steps that we have to follow if we want to convert decimal number into binary, octal or hexadecimal number. So first step says divide the decimal number by the new base. Second point says record the remainder as the least significant digit of the new base number. Third point says continue to divide the obtained quotient till the quotient becomes zero. And last point says the last remainder obtained will be the most significant digit of the new number. So let's apply these steps with an example so that you can understand all the steps well. So first example will be converting decimal number system into binary number system. So here you can see the question. We have to convert 55 into decimal. So decimal number is 55 that we have to convert into binary. So we have to divide 55 by 2 because we are going to convert it into binary. So if we divide 55 by 2, it will be divisible 27 times. So result will be 54 and remainder will be 1. So here you can see I have recorded the remainder here, which will be the least significant digit. So moving to the steps, divide the decimal number by the new base. So we have divided the number with the new base that is 2. Record the remainder as the least significant digit of the new base number. So here you can see this will become the least significant digit because we will be writing the answer from bottom to up, right? Next step says continue to divide the obtained quotient till the quotient becomes zero. And the last remainder obtained will be the most significant digit. So here you can see further 27 is divided by 2. 13 times again remainder will be 1. Then 13 will be divided 6 times. So 6 into 2 is 12. Again, remainder will be 1. Then 6 is divided by 2. 3 times this time remainder will be 0. Then 3 is divided by 2. One time. So remainder will be 1. Then we can't divide 1 by 2. So remainder will be 1. So now we have to pick all these digits from bottom to up. So you can see the result 1, 1, 0, triple 1 is written here. So this 1 is available here and this topmost 1 is available here. So remember whenever you want to convert decimal into binary, then you have to divide the number by 2. You have to record all the remainder values and you have to put all the remainder values from bottom to up. And that will be the equivalent binary number. So this way I have converted decimal number into binary. So I hope you have understood all the steps, all these steps that I discussed earlier. Now I'm going to discuss conversion of decimal number system to octal number system. So here the number is 952 and we have to convert it into octal. So 952 will be divided by 8. So first time it will divide 119 times and it will be completely divisible and remainder will be 0. Then 119 will be divided by 8. So 14 into 8. This time remainder will be 7. Then 14 will be divided by 8 one time. So remainder will be 6. Then we can't divide 1 by 8. So remainder will be 1. So if we write these digits from bottom to up, so the result will be 1670. So 952 is the decimal number and its equivalent octal number is 1670. So this way I converted decimal number value into octal number value. Next example is converting decimal number system value into hexadecimal number system. So value is 428 that we need to convert into hexadecimal number. So 428 is divided by 16. So it is divided 26 times. So remainder will be 12 and in case of hexadecimal 12 is equivalent to C. Then 26 will be divided by 16 again. It will be divided by divided one time. Reminder will be 10. 10 is equivalent to A. Then 1 cannot be divisible by 16. So remainder will be 1. Now we have to write these values from bottom to up. So result will be 1ac. So this way I converted decimal number into hexadecimal number. So with the help of this division method we can convert decimal number into binary, octal and hexadecimal numbers. So this was all about integer numbers conversion. Now I am going to discuss how we can convert fractional numbers from decimal to binary, from decimal to octal and from decimal to hexadecimal. So here we have to apply two steps. So first we have to convert this 21 which is available at left-hand side of decimal point and then we have to convert 6875 which is available at right-hand side of decimal point. So this whole number we have to convert into binary. So in solution you can see first we convert the integer part by division remainder method. So this is the integer part that is 21. So I have divided 21 as I discussed in previous slides. So 21 is divisible by 2. 10 times remainder is 1 and so on. The resultant values are available which are capped bottom to up. So conversion of 21 is 10101. So this is half conversion. Now fractional part will be converted with the help of this table. So first column is value of fractional part. So value of fractional part is 0.6875. So this is 0.6875. This is the fractional value. Then second column is base. So base in which we have to convert this fractional number that is 2. Third column says we have to multiply value of fractional part with base. So it means we have to multiply 0.6875 with 2. So here in this case result will be 1.375. And fourth column says we have to keep integer value of this multiplication. That is one in this case here and the remaining fractional value will be available here. So this multiplication is 1.375. So one will be capped here and remaining 0.375 will be available here for further multiplications. So again it will be multiplied by 2. Result will be 0.75. So here in this case integer value is 0 and 0.75 will be available here. It will be multiplied by 2. This time result is 1.50. One will remain here and 0.50 will be capped here which is again multiplied by 2. This time result is 1.0. So 1 we are using as integer value and 0.0 will be written here. So now we can't multiply this 0.0 further with base. So these result resultant values we have to write from top to down. So the fractional value conversion is 1011. So now we have two different results. First is conversion of 21 as 10101 and conversion of 0.6875 as 1011. So I have combined both the results. So 10101 is the value which is available at left-hand side of decimal point and 1011 is available at right-hand side of decimal point which are conversion of 21 and 0.6875 respectively. So together 21.6875 is converted into 10101.1011 which is binary equivalent value for this decimal number. So I hope you have understood how we can convert these fractional numbers from decimal to binary by applying these two different methods. Now we have to convert decimal number system into octal number system. So here the number is 29.625 that we have to convert into octal. So again we have to apply two different methods. First I am going to convert this 2929 into octal. So it is divided by 8. Three times remainder is 5. 3 will not be divisible by 8. So remainder will be 3. So 29 is converted into 35 as octal. Now we have to convert this fractional value 0.625. So it is multiplied with base in which we have to convert it. That is 8. Result is 5.000. So integer part is written here 0.0 I am keeping here which can't be multiplied further. So the result of 0.26 sorry 0.625 is 0.5 in octal form. So I am combining both the results. So first result is 35 and another one is 0.5. So final outcome is 35.5. So we can say 29.625 which is the decimal number. Its equivalent octal value is 3.5. So this way I have converted this decimal number into octal number. Now lastly I am going to convert decimal number into hexadecimal number. So decimal number is 175.53125 which I have to convert into hexadecimal value. So first I am going to convert 175 which is the integer part. It is divisible by 16. 10 times remainder will be 15 which is equivalent to F. 10 can't be divisible by 16. So remainder will be 10 and its equivalent is A. So combinedly it will become AF. So 175 is converted into AF as hexadecimal number. Now we have to convert this fractional part that is 5.3125 using this multiplication method. So it is multiplied with 16 that is the base in which we have to convert it. Result is 8.500. So integer part 8 is written here. 0.500 is here which is again multiplied by 16. Now result will be 8.0. So integer part 8 is written here and we can't multiply 0.0 further. So the result of 0.53125 which is in decimal form. Its equivalent hexadecimal value is 0.88. Now we can combine this AF and 0.88 together. So the result is AF.88. So finally we can say 175.53125 which is a decimal number. Its equivalent hexadecimal number is AF.88. So this way I explained how you can convert decimal number into binary, octal and hexadecimal number systems both for integer and fractional numbers. I hope you have understood whatever I have demonstrated in this video. If you have any queries you can connect with me by following these details. Keep following my YouTube channel. Thank you for watching this video.