In what situations is octal base used?

后端 未结 9 1034
情话喂你
情话喂你 2020-12-01 17:35

I\'ve seen binary and hex used quite often but never octal. Yet octal has it\'s own convention for being used in some languages (ie, a leading 0 indicating octal base). When

9条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 18:32

    One of the main reasons octal used to be more frequently used was that it is easier to convert between octal and binary in your head than hex to binary: you only have to remember the binary representation of the 8 octal digits (0-7).

    Back in the days when debugging meant reading register contents from a row of LEDs, or entering data with an array of toggle switches, this was a big concern. The panels on many of these early computers grouped the LEDs and switches in groups of threes to facilitate this.

    However, hex began to win out as word sizes that are multiples of 8-bit bytes began to win out, and the need to read and enter data in binary became unecessary (with console text UI and later GUI debuggers).

提交回复
热议问题