• 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

Hexa and octal values conversion to decimal integers, How?

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Often we find questions where they give octal or hexadecimal values and ask what is the resut of shift operations .
In such cases to evaluate the expression, how do you convert the hexadecimal and octal values to decimal equivalents manually, do the shift operations and get the answer . Could you please give an example.

 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Nikhitha Pai wrote:Hi,
Often we find questions where they give octal or hexadecimal values and ask what is the resut of shift operations .
In such cases to evaluate the expression, how do you convert the hexadecimal and octal values to decimal equivalents manually, do the shift operations and get the answer . Could you please give an example.



Not sure what you are asking here... except, IMO, it is easier to envision the shifting of octal and hexadecimal numbers, as the bit boundaries are easier to see. So, unless the question wants the result in decimal, why would you want to convert the number to decimal first? Also, on how to convert octal and hexadecimal numbers to decimal, that is standard base arithmetic that is taught in the eight grade (well, at least in the US, it is taught in the eight grade).

Henry

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic