• 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

Octal and Hex

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am a bit confused on how to calculate these Octal and Hex numbers for the exam. Do we even need to be able to calculate these? Thanks!
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure if there are problems that explicitly ask you to compute the decimal value of a given hex value, but the understanding how to do so may help you out.
To find the decimal value of some hex or octal, just multiple each digit by the base and placement:
FA1 = 15 * (16 ^ 2) + 10 * (16 ^ 1) + 1 * (16 ^ 0)
Octals would be the same way except the base would be 8 instead of 16. Binary likewise except the base is 2. And so on.
The exam objectives include the use of Integer.toHexString(int), so I would say this is definitely a good thing that you're asking this.
[ March 23, 2004: Message edited by: Nathaniel Stoddard ]
 
L Sol
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I apologize, I think I am still missing something. What you said makes sense to me... but when I calculate FA1 out I get that it is equivalent to 641. When I use my scientific calculator and type in FA1 and convert it to Decimal. It tells me 4001. What am I missing?
Thanks in advance!
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I completely screwed up giving you that formula You need to raise the base value by its placement. You can work this one out and it will actually give you the correct value of 4001.
reply
    Bookmark Topic Watch Topic
  • New Topic