How to convert Decimal to Quaternary
The decimal numeral system is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers of the Hindu-Arabic numeral system. For writing numbers, the decimal system uses ten decimal digits, a decimal mark, and, for negative numbers, a minus sign "-". The decimal digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9; the decimal separator is the dot "." in many countries.Quaternary is the base-4 numeral system. It uses the digits 0, 1, 2 and 3 to represent any real number. Four is the largest number within the subitizing range and one of two numbers that is both a square and a highly composite number, making quaternary a convenient choice for a base at this scale. Despite being twice as large, its radix economy is equal to that of binary.
Formula
Follow these steps to convert a decimal number into quaternary form:
- Divide the decimal number by 4.
- Get the integer quotient for the next iteration (if the number will not divide equally by 4, then round down the result to the nearest whole number).
- Keep a note of the remainder, it should be between 0 and 3.
- Repeat the steps until the quotient is equal to 0.
- Write out all the remainders, from bottom to top. This is the solution.
Division | Quotient | Remainder |
---|---|---|
395 / 4 | 98 | 3 |
98 / 4 | 24 | 2 |
24 / 4 | 6 | 0 |
6 / 4 | 1 | 2 |
1 / 4 | 0 | 1 |