Hi, The Decimal number system that we commonly use is based on 10 symbols(0,1,2,3,4,5,6,7,8,9) while computer uses Binary number System based on two symbols (0,1). So, "3" in decimal is represented as "11" in binary and "23" in decimal is "10111" in binary. So how to convert "10111" to the equivalent 23? Start from the right of "10111" 1) Take the rightmost 1 and multiply with 2^0(2 raised to the power 0) i.e. 1 x 2^0 = 1x1 = 1 2) Now we are left with "1011" and 1 3) Take the rightmost 1 and multiply with 2^1 i.e. 1x2^1 = 1x2 = 2 4) Now we have "101" and 1,2 5) Take the next rightmost 1 and apply 1x2^2 i.e. 1x4 = 4 6) Now we have "10" and 1,2,4 7) Take the rightmost 0. 0x2^3 = 0x8 = 0 8) Now we have "1" and 1,2,4,0 9) Take the last remaining 1. 1x2^4 = 1x16 = 16 10) At last the whole binary number is processed and we are left with 1,2,4,0,16. Add all these numbers i.e. 1+2+4+0+16 = 23. That's the answer. Summary: 1) Start processing the binary number from the left. 2) Multiply each number with 2^n, where n=0 in the start and keeps increasing in value by 1 with each turn. I.e. 0,1,2,3..... 3) Add all the results from each step to get the Decimal equivalent.
Convert the following binary and decimal number into their respective number system.
I) 396 = ( ? )2
ii) 101011 = ( ? )10
I) 396 = ( ? )2
ii) 101011 = ( ? )10
Each digit of binary number is multiplied by the power from right to left then all numbers are added have the decimal form for e.g
if the decimal form of 10011 is required then
=1*2^0=1*1=1
=1*2^1=1*2=2
=0*2^2=0*4=0
=0*2^3=0*8=0
=1*2^4=1*16=16
now adding 1+2+0+0+16 we get 19 which is the decimal form of 10011
if the decimal form of 10011 is required then
=1*2^0=1*1=1
=1*2^1=1*2=2
=0*2^2=0*4=0
=0*2^3=0*8=0
=1*2^4=1*16=16
now adding 1+2+0+0+16 we get 19 which is the decimal form of 10011
(402)10 into binary
Add 1001+1111 in binary
From right ( memory number + bit_N_on_number1 + bit_N_on_number2)
0 + 1 + 1 = 0 ( 1 to memory)
1 + 0 + 1 = 0 ( 1 to memory)
1 + 0 + 1 = 0 ( 1 to memory )
1 + 1 + 1 = 1 ( 1 to memory )
1 + 0 + 0 = 1 ( 0 to memory)
=> Result 11000
0 + 1 + 1 = 0 ( 1 to memory)
1 + 0 + 1 = 0 ( 1 to memory)
1 + 0 + 1 = 0 ( 1 to memory )
1 + 1 + 1 = 1 ( 1 to memory )
1 + 0 + 0 = 1 ( 0 to memory)
=> Result 11000