Computer Science, asked by drishtigola2505, 1 year ago

Convert binary to octal then to decimal examples

Answers

Answered by AJay12mahich
0
******convert Binary to decimal



(10001)2 = (17)10


Step 1: Write down the binary number:

10001

Step 2: Multiply each digit of the binary number by the corresponding power of two:

1x24 + 0x23 + 0x22 + 0x21 + 1x20

Step 3: Solve the powers:

1x16 + 0x8 + 0x4 + 0x2 + 1x1 = 16 + 0 + 0 + 0 + 1

Step 4: Add up the numbers written above:

16 + 0 + 0 + 0 + 1 = 17. This is the decimal equivalent of the binary number 10001.


******convert Binary to Octal



10001)2 = (21)8



Step 1: Write down the binary number

(010001)2

Group all the digits in sets of three starting from the LSB (far right). Add zeros to the left of the last digit if there aren't enough digits to make a set of three.

010 001

Step 2: Use the table below to convert each set of three into an octal digit. In this case,

010=2, 001=1.

So, the number 10001 in binary is equivalent to 21 in octal.





Similar questions