• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Basic Conversion help

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not understand the following concept:
Khalid Mughal, pg 67
~41
Step 1: ~ 0....0010 1001 ( I understand, 41 in binary)
Step 2: 1....1101 0110 ( I understand, inverse of Step 1)
Step 3: 0xffffffd6
All I know is it is in hexa and f stands for 1111,
1101 represents d and 0110 represents 6 in hexa)
** If anyone could kindly explain how 0110 is d in hexa and
0110 is 6 in hexa, it would be awesome
Step 4: -42
** How to convert hexa to decimal
I know this is trivial but if anyone could explain or point me
to resources where I could learn this conversion process,
that would be great.
In a similar mode if anyone could explain octal table or point
me to the resources where I could learn this table, that would
be very helpful.
Thank you.
-Jay
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"** If anyone could kindly explain how 0110 is d in hexa and
0110 is 6 in hexa, it would be awesome"
It is just counting in different bases
binary decimal hex
0000 - 0 - 0
0001 - 1 - 1
0010 - 2 - 2
etc.
0100 - 4 - 4
0110 - 6 - 6
1000 - 8 - 8
..
1010 -10 - A
..
1101 -13 - D
1110 -14 - E
1111 -15 - F
Bill
 
Jay Kay
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks William, I understood Step 3.
Now, how to convert hexa
0xffffffd6 to -42
Any help is greatly appreciated.
-Jeelani
[This message has been edited by Jay Kay (edited July 28, 2001).]
[This message has been edited by Jay Kay (edited July 28, 2001).]
 
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jay,
I have some notes on bin/oct/dec/hex conversions at http://www.janeg.ca/scjp/oper/binhex.html that may help.
Also see Cat and Mouse Games with Bits.
Hope that helps.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
Jay Kay
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the pointers. I am progressing.
If it was 0xd6 then,
13* (16^1)+6* (16^0)
= 13 * 16 + 6 * 1
= 208 + 6 = 214
i.e, 0xd6 = 214
what to do since it is 0xffffffd6?
Thanks.
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic