Author | Topic: Conversion |
uma unregistered |
posted April 27, 2000 03:58 PM
Hi guys, I have one very basic doubt. Could somebody be kind enough to clear this. I still have problem to convert hexadecimal numbers to binary. ex:How to convert 0xff into binary number. Please teach me the trick. Giving the exam in couple of days. Any help would be highly appreciated. Thanks a bunch.
|
sathish greenhorn |
posted April 27, 2000 04:32 PM
hi uma A short solution. i found this to be quick and hope this is of use to you
|
sathish greenhorn |
posted April 27, 2000 04:41 PM
uma i thought you were asking to convert to decimal, Ok it's again simple Much simple sathish
|
satya5 ranch hand |
posted April 27, 2000 04:44 PM
Sathish: Your method is . Thanks. What abt 0xff which "uma" asked. Could you (or anyone else, I am sooooo generous ) Thanks. - satya
|
uma unregistered |
posted April 27, 2000 04:47 PM
Thanks satish. But one more question are there going to be any questions like what's the result of 0x63^0xbd(i found this in apllied reasoning mock exam). Because it took way too much time for me to figure out answer to this q. First i had to convert those numbers to decimal format and then to binary format and then perform the calculation and then again convert the result into hexadecimal format. Could you please tell me some simple way to find out the answer for these kind of q's. Appoxmately how many q's of this type will be given in the test. Kindly help me with some detailed info. Thanks.
|
sree ranch hand |
posted April 27, 2000 04:53 PM
Satya, f is equal to 15 in hexadeciaml.So, 0xff will be 16^0*15+16^1*15.That would be 255 in decimal format.
|
satya5 ranch hand |
posted April 27, 2000 05:02 PM
Thanks sree..... I shold have known the case insensitivity .... (now I remember 0x?? 0X?? ) phttt...too much caffine in my brain I guess - satya
|
maha anna bartender |
posted April 27, 2000 05:15 PM
Satya, You have to know this by heart if you want to apply the easy method in order to convert a hex literal to an integer value. One technique I use generally is I can write upto 9 easily. After that I just add the extra values. In other words, If i have to write 'D' for example, I know 1001 is for 9, in order to get D I have to add(1+1+1+1) (A..B..C..D) which means I have to add 9+4 = 13 = 1101.
So if you know this chart at your finger tips, then it is very easy to convert a hex to a binary. As Sathish said,
|
Harry Chawla unregistered |
posted April 27, 2000 10:17 PM
Hi Uma Picking up from where Satish and Anna have stopped, it's obvoius that for ur case oxff, conversion from hex to binary will be 1111 1111. I believe u need not mug up the chart, as th binary conversion is pretty straigt forward. One more thing to add out here, if it's a conversion from octal to binary, use a set of three binary digits(2*2*2), instead of four binary digits(2*2*2*2) used for Hex numbers. All the best for your exams. I'll give it a shot in May end.
|
satya5 ranch hand |
posted April 28, 2000 06:56 AM
As always ... Thanks Maha. Infact I was thinking of leaving all this stuff. There was a related discussion on "shifting" by Brian Nice. I wanted to ask abt conversion in that discussion, but took it easy ! I mean, howmuch ?? Now, I understand why some people (I talked to) said "oh, no its too much work for me...". hmmm...the exam is real real work .... Regds. - satya
|
uma unregistered |
posted April 28, 2000 07:22 PM
Thanks a lot guys.
|
| | |