Computers use binary (base 2). Octal (base 8) and hexadecimal (base 16) are compact ways to write binary.
1Conversions
Decimal → base b: divide repeatedly by b and read remainders upwards
Base b → decimal: sum of digit × b^position
Binary ↔ octal: groups of 3 bits; binary ↔ hex: groups of 4 bits
Two's complement of a negative number: invert the bits of its magnitude and add 1