Octal versus hexadecimal

General discussions related to the Altair 8800 Clone

Octal versus hexadecimal

Postby mail@gabrielegan.com » April 29th, 2018, 1:04 pm

I wonder if anyone has a view on the pros and cons of expressing numbers (especially machine code) in octal rather than hexadecimal? If I've understanding the history right, the Altair appeared when octal was commonly favoured, not least because it makes toggling in binary numbers quite easy: only the binary patterns for 0-7 have to be memorized. In hex, on the other hand, one has to memorize twice as many bit patterns to cover 0-thru-F. But on the downside, the PRN listing output of the CP/M Assember are in hex not octal. (Or am I missing something, is there a way to get the assembler to produce octal listings for easy toggling?)

I'm asking because I'm debating with myself whether my students (non-technical, Humanities undergraduates) should learn octal and hex or just hex? One big problem I have with the octal used with the Altair is that we can't think about the two bytes of a 16-bit number independently in the way we can with hex. In hex, the address 01FFh (=0000000111111111b) breaks neatly into two bytes of 01h (00000001b) and FFh (11111111b). By contrast, you can't easily break the octal equivalent 777Q into two bytes, since thinking byte-wise the address's high byte 00000001b would be 001Q and its low byte 11111111b would be 377Q. In hex, you can stick the 01h before the FFh to get back your 01FFh (=0000000111111111b) but you can't stick 001Q before 377Q to get back 777Q: instead you get 1377Q (=1011111111b), a different number.

What do others think: has working in octal thrown up problems like this? Can the mind easily memorize the 16 bit patterns for hex's 0-thru-F digits?

Regards

Gabriel Egan
mail@gabrielegan.com
 
Posts: 104
Joined: October 11th, 2014, 8:12 am

Re: Octal versus hexadecimal

Postby toml_12953 » April 29th, 2018, 5:24 pm

mail@gabrielegan.com wrote:What do others think: has working in octal thrown up problems like this? Can the mind easily memorize the 16 bit patterns for hex's 0-thru-F digits?
Gabriel Egan


Most of the listings from back then were in hex. I usually work in hex for the reasons you mentioned. With a little practice, hex is as easy to remember as octal. I put colored vinyl sleeves on my switches to visually separate them into groups of four rather than the physical grouping of three. This makes entering hex listings much easier. I put a chart of the hex numbers from 0 to F right on top of the computer but don't refer to it anymore.I'd say go with hex.
toml_12953
 
Posts: 297
Joined: June 7th, 2013, 12:54 pm

Re: Octal versus hexadecimal

Postby AltairClone » April 30th, 2018, 6:34 pm

I can only “think” in hex. Any octal work I do seems to need a hex translation step in my brain :)

Mike
AltairClone
Site Admin
 
Posts: 632
Joined: April 5th, 2013, 10:55 am

Re: Octal versus hexadecimal

Postby TomXP411 » May 7th, 2018, 5:02 pm

The real problem with octal is that the digits don't fall on byte boundaries. So, like decimal, when you stack additional bytes onto a word, the least significant digits of an octal number change. That makes it hard to stack additional bytes to the left, since that changes the Octal expression of 16-bit and larger numbers.

In other words: the bytes 12h and 2Fh have the same printed expression when you put them together into a 16-bit number: 122Fh. The same bytes in Octal are 22o and 57o, but when combined into a word end up as 11057.
TomXP411
 
Posts: 42
Joined: March 8th, 2018, 4:13 pm

Re: Octal versus hexadecimal

Postby mail@gabrielegan.com » May 17th, 2018, 2:28 am

Thanks, toml_12953: I like the idea of coloured plastic sleeves on the switches to identify them in groups of 4-4 instead of 2-3-3. Do you happen to have a specification for what size (eg what guage of wire I might strip the sleeves from) fits best, just to save me experimenting? I've already printed cheat-sheet labels for the fronts of the Altairs: one label uses 0000-1111 to show each nybble and the other does the same but with down-arrows for 0s and up-arrows for 1s -- let's see which the students find more helpful.

Regards

Gabriel
mail@gabrielegan.com
 
Posts: 104
Joined: October 11th, 2014, 8:12 am

Re: Octal versus hexadecimal

Postby toml_12953 » May 17th, 2018, 5:21 am

mail@gabrielegan.com wrote:Thanks, toml_12953: I like the idea of coloured plastic sleeves on the switches to identify them in groups of 4-4 instead of 2-3-3. Do you happen to have a specification for what size (eg what guage of wire I might strip the sleeves from) fits best, just to save me experimenting? I've already printed cheat-sheet labels for the fronts of the Altairs: one label uses 0000-1111 to show each nybble and the other does the same but with down-arrows for 0s and up-arrows for 1s -- let's see which the students find more helpful.

Regards

Gabriel


Sorry, no. I bought mine ready to install.

https://www.jpmsupply.com/Toggle-Handle-Cover-for-Miniature-Toggle-Switch-p/7052x.htm
toml_12953
 
Posts: 297
Joined: June 7th, 2013, 12:54 pm

Re: Octal versus hexadecimal

Postby Wayne Parham » March 28th, 2022, 9:44 am

Resurrecting an old thread.

The reason octal was used in the 1960s and 1970s was minicomputers of that era used six-bit character sets. They predated the widespread embrace of the ASCII standard. Word size was often a multiple of three, like 12-bits. So octal was convenient for a system like that.

Then - even after the ASCII standard was adopted - some minicomputer manufacturers still retained the octal nomenclature, mostly because it was familiar. Lots of 1970s minicomputers were 16-bit machines and by the early 1980s, you saw 32-bit machines, but the minicomputer manufacturers still talked octal.

That's the environment that the Altair was born into. Programming eight-bit processors is more naturally described in hex, but Ed Roberts used octal alignments for the front-panel and users guides and programming documentation. Super weird-funny, and cool. Like the fins on cars from the 1950s.

I've written a little more about that on my Altair 8800 page below:

Wayne Parham
 
Posts: 240
Joined: March 18th, 2022, 3:01 pm


Return to General Discussions

Who is online

Users browsing this forum: Google [Bot] and 13 guests

cron