See also: Integer Representation
Use the following algorithm to construct base b expansions of an integer n.
- First divide n by b to get a quotient and remainder
The remainder is the first digit in the base b expansion of n - Next divide
by b to obtains The remainder is the 2nd digit in the base b expansion of n - Repeat the steps above until you get 0 as a quotient.
Example
Find the find binary expansion of
Conversion between binary, octal, hexadecimal
Example
Find the octal and hex expansions of
0011|1110|1011|1100
3 | 14 | 11 | 12
Example
Find the binary expansions of
(A 8 D