944,198 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 5153
  • C RSS
Apr 12th, 2006
0

Number System:Conversion from binary to decimal

Expand Post »
Ok,

For the conversion of binary to decimal, check it out:
Let’s say we have to convert –
1010.1010
We solve this kind of problems into two parts as follows:
(<LHS> . <RHS>)

1. First take the left hand side no. of the radix point( . ) which is 1010
to convert it into its equivalent decimal the method is as follows:
1 0 1 0

1*(2^3)+0*(2^2)+1*(2^1)+0*(2^0)=10

i.e. >start from the right-most digit (0 here);
>move from right to left;
>multiply each digit with (2^(position of digit from right-1));
>The sum of all these(10 here) as shown above will give u the decimal equivalent of the
LHS part of radix.

2. Now the important & difficult one;
The Right hand part of radix of the given binary no.
This is 1010 again.Since right-most 0 is of no significance, this can be ommitted
out.
1 0 1

1*(2^-1)+0*(2^-2)+1*(2^-3)=.625 or

[1/(2^1)]+[0/(2^2)]+[1/(2^3)]=.625

i.e.
>we have to move from left to right now.
>multiply each digit with (2^-(position of the digit form radix on left))
or
Divide each digit with (2^position of the digit from radix on left)
>Sum up all these, as above(.625 here) to get the decimal equivalent RHS part of no.

The last step is simple:
Just put the two results obtained in step1. & step2. together with the radix ( . )
to get the required result
Here, it would be=10.625
Thus,
Binary equivalent of 1010.1010 is =10.625

Enjoy,
Similar Threads
Reputation Points: 15
Solved Threads: 4
Posting Pro
anupam_smart is offline Offline
598 posts
since Feb 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: CSV file
Next Thread in C Forum Timeline: Binary Fraction conversion question





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC