I am trying trying to convert a from octal to hex and hex to octal without using binary/dec transform using repeated divison... Logically I thought I could use the hex base in octal for repeat division which is 20 oct(adsbygoogle = window.adsbygoogle || []).push({});

Example of problem I am trying to solve,

Convert 326 octal to hex (ans 0xD6)

326 oct / 20 oct = 16 oct remainder 6 oct = 0x6

16 oct / 20 oct = 0 oct remainder 16 oct = 14 dec = 0xE!!??

Reading UP^ most sig to least gives me 0xE6 not D6 i.e. im off by 1 hex char..?

Another example 372 oct

372oct /20 oct = 18 r 12

18/20 = invalid octal number lol!

Also how would I do hex straight to octal I.e. E7C -> oct?

Please help...

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Convert octal to hex, w/out converting to Binary

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**