• 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

Binary, Octal, and Hex

 
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was wondering if there is a easy way to go between all the different bases. From Hex to Octal and binary? This is where I can get confused. Any Quick tricks? Binary to Decimal is easy and vice-versa. Just the others seems confusing.
Thanks
Faisal
------------------
Faisal Dosani
B.Sc, AIT
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Faisal,
1) Hex to Binary
Convert every digit into 4 bit Binary.
e.g) A6 = 1010 0110
2) Binary to Hex
Group by 4 bits from right to left, then convert each group to Hex equivalent.
e.g) 101011 = 0010 1011 = 2B
3) Oct to Bin and Bin to Oct would have the procedure as above, but with group of 3 bits instead of 4 bits.
4) For Oct to Hex and Hex to Oct, there need to be an intermediate binary conversion. i.e, Oct to Bin to Hex and Hex to Bin to Oct.
Hope that helps.
B Arul.

[This message has been edited by Bala Arul (edited May 08, 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 Faisal,
I've got some notes posted on Binary/Octal/Decimal/Hex conversions at http://www.janeg.ca/scjp/oper/binhex.html
Hope they help.
------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
Bartholemu Smith
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jane, that really helps.
This place is way to friendly
Thanks again
Faisal
 
Jane Griscti
Ranch Hand
Posts: 3141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your welcome Faisal.


This place is way to friendly


Well ... that is our slogan

------------------
Jane Griscti
Sun Certified Programmer for the Java� 2 Platform
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic