777₈ → decimal — number base conversion

exam standardbase 8 positional expansion

Answer

511

Why this example is worth doing

The largest three-digit octal number, which is 511 in decimal and 1 1111 1111 in binary — nine bits, all ones. Octal survives mainly in Unix file permissions, where those three digits map to read, write and execute for owner, group and other, and the page makes that connection because it is the only place most students will ever meet base eight in practice.

Try your own input in the Binary ⇄ decimal ⇄ hex ⇄ octal. Convert between any two bases, integers and fractions, with the positional working.

How the answer is reached

Base 8 to base 10

Convert 777 from base 8 to base 10. The sign is carried across unchanged; only the magnitude is converted.

Positional expansion of the input — Base 8 to base 10
digitvalueweightweight (base 10)digit x weight
778^264448
778^1856
778^017
total511

Integer part: divide by 10 and read the remainders bottom to top.

Read the last column bottom to top. ↑ — Base 8 to base 10
ndivide byquotientremainder
511511 ÷ 10511
5151 ÷ 1051
55 ÷ 1005

777 (base 8)511 (base 10)

Compare with

Open this example in the Binary ⇄ decimal ⇄ hex ⇄ octal

The field arrives filled in with this example’s input.

Note:

Notation this page assumes

  • Bit strings are written most significant bit first, and bit 0 is the least significant bit.
  • A width is stated explicitly wherever it changes the answer; nothing is silently sign-extended or truncated.
  • Fractions are converted digit by digit and shown to a stated number of places rather than rounded silently.

Sources

  • Knuth, The Art of Computer Programming, Vol. 2, §4.1 “Positional Number Systems” (1997)
  • IEEE 754-2019, Standard for Floating-Point Arithmetic