In what situations is octal base used?

后端 未结 9 950
情话喂你
情话喂你 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).

    0 讨论(0)
  • 2020-12-01 18:38

    Octal is used when the syntax is a relic from the ages when it perhaps made sense on some platform (system words haven't always been a multiple of 8 bits). Nowadays hex is the thing to use.

    0 讨论(0)
  • 2020-12-01 18:38

    Music, as long as you stay away from (most) sharps and flats.

    0 讨论(0)
提交回复
热议问题