Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Quaternary numeral system
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Relation to other positional number systems== {| class="wikitable" |+ '''Numbers zero to sixty-four in standard quaternary (0 to 1000)''' |- align="center" ![[Decimal]] ! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! 10 !! 11 !! 12 !! 13 !! 14 !! 15 |- align="center" ![[Binary number|Binary]] | 0 || 1 || 10 || 11 || 100 || 101 || 110 || 111 || 1,000 || 1,001 || 1,010 || 1,011 || 1,100 || 1,101 || 1,110 || 1,111 |- align="center" style="background: SpringGreen;" | style="background: black; color: SpringGreen;" | Quaternary | 0 || 1 || 2 || 3 || 10 || 11 || 12 || 13 || 20 || 21 || 22 || 23 || 30 || 31 || 32 || 33 |- align="center" ![[Octal]] | 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 10 || 11 || 12 || 13 || 14 || 15 || 16 || 17 |- align="center" ![[Hexadecimal]] ! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! A !! B !! C !! D !! E !! F |- align="center" ! Decimal ! 16 !! 17 !! 18 !! 19 !! 20 !! 21 !! 22 !! 23 !! 24 !! 25 !! 26 !! 27 !! 28 !! 29 !! 30 !! 31 |- align="center" ! Binary | 10,000 || 10,001 || 10,010 || 10,011 || 10,100 || 10,101 || 10,110 || 10,111 || 11,000 || 11,001 || 11,010 || 11,011 || 11,100 || 11,101 || 11,110 || 11,111 |- align="center" style="background: SpringGreen;" | style="background: black; color: SpringGreen;" | Quaternary | 100 || 101 || 102 || 103 || 110 || 111 || 112 || 113 || 120 || 121 || 122 || 123 || 130 || 131 || 132 || 133 |- align="center" ! Octal | 20 || 21 || 22 || 23 || 24 || 25 || 26 || 27 || 30 || 31 || 32 || 33 || 34 || 35 || 36 || 37 |- align="center" ! Hexadecimal ! 10 !! 11 !! 12 !! 13 !! 14 !! 15 !! 16 !! 17 !! 18 !! 19 !! 1A !! 1B !! 1C !! 1D !! 1E !! 1F |- align="center" ! Decimal ! 32 !! 33 !! 34 !! 35 !! 36 !! 37 !! 38 !! 39 !! 40 !! 41 !! 42 !! 43 !! 44 !! 45 !! 46 !! 47 |- align="center" ! Binary | 100,000 || 100,001 || 100,010 || 100,011 || 100,100 || 100,101 || 100,110 || 100,111 || 101,000 || 101,001 || 101,010 || 101,011 || 101,100 || 101,101 || 101,110 || 101,111 |- align="center" style="background: SpringGreen;" | style="background: black; color: SpringGreen;" | Quaternary | 200 || 201 || 202 || 203 || 210 || 211 || 212 || 213 || 220 || 221 || 222 || 223 || 230 || 231 || 232 || 233 |- align="center" ! Octal | 40 || 41 || 42 || 43 || 44 || 45 || 46 || 47 || 50 || 51 || 52 || 53 || 54 || 55 || 56 || 57 |- align="center" ! Hexadecimal ! 20 !! 21 !! 22 !! 23 !! 24 !! 25 !! 26 !! 27 !! 28 !! 29 !! 2A !! 2B !! 2C !! 2D !! 2E !! 2F |- align="center" ! Decimal ! 48 !! 49 !! 50 !! 51 !! 52 !! 53 !! 54 !! 55 !! 56 !! 57 !! 58 !! 59 !! 60 !! 61 !! 62 !! 63 |- align="center" ! Binary | 110,000 || 110,001 || 110,010 || 110,011 || 110,100 || 110,101 || 110,110 || 110,111 || 111,000 || 111,001 || 111,010 || 111,011 || 111,100 || 111,101 || 111,110 || 111,111 |- align="center" style="background: SpringGreen;" | style="background: black; color: SpringGreen;" | Quaternary | 300 || 301 || 302 || 303 || 310 || 311 || 312 || 313 || 320 || 321 || 322 || 323 || 330 || 331 || 332 || 333 |- align="center" ! Octal | 60 || 61 || 62 || 63 || 64 || 65 || 66 || 67 || 70 || 71 || 72 || 73 || 74 || 75 || 76 || 77 |- align="center" ! Hexadecimal ! 30 !! 31 !! 32 !! 33 !! 34 !! 35 !! 36 !! 37 !! 38 !! 39 !! 3A !! 3B !! 3C !! 3D !! 3E !! 3F |- align="center" !Decimal ! colspan="16" | 64 |- align="center" !Binary | colspan="16" | 1,000,000 |- align="center" style="background: SpringGreen;" | style="background: black; color: SpringGreen;" | Quaternary | colspan="16" | 1,000 |- align="center" !Octal | colspan="16" | 100 |- align="center" !Hexadecimal ! colspan="16" | 40 |- |} ===Relation to binary and hexadecimal=== {| class="wikitable" style="float:right; text-align:right" |+ [[addition table]] |- | + || '''1''' || '''2''' || '''3''' |- | '''1''' || 2 || 3 || 10 |- | '''2''' || 3 || 10 || 11 |- | '''3''' || 10 || 11 || 12 |} As with the [[octal]] and [[hexadecimal]] numeral systems, quaternary has a special relation to the [[binary numeral system]]. Each [[radix]] four, eight, and sixteen is a [[power of two]], so the conversion to and from binary is implemented by matching each digit with two, three, or four binary digits, or [[bit]]s. For example, in quaternary, :230210<sub>4</sub> = 10 11 00 10 01 00<sub>2</sub>. Since sixteen is a power of four, conversion between these bases can be implemented by matching each hexadecimal digit with two quaternary digits. In the above example, :23 02 10<sub>4</sub> = B24<sub>16</sub> {| class="wikitable" style="float:right; text-align:right" |+ [[multiplication table]] |- | Γ || '''1''' || '''2''' || '''3''' |- | '''1''' || {{figure space}}1 || 2 || 3 |- | '''2''' || {{figure space}}2 || 10 || 12 |- | '''3''' || {{figure space}}3 || 12 || 21 |} Although octal and hexadecimal are widely used in [[computing]] and [[computer programming]] in the discussion and analysis of binary arithmetic and logic, quaternary does not enjoy the same status. Although quaternary has limited practical use, it can be helpful if it is ever necessary to perform hexadecimal arithmetic without a calculator. Each hexadecimal digit can be turned into a pair of quaternary digits. Then, arithmetic can be performed relatively easily before converting the end result back to hexadecimal. Quaternary is convenient for this purpose, since numbers have only half the digit length compared to binary, while still having very simple multiplication and addition tables with only three unique non-trivial elements. By analogy with ''byte'' and ''nybble'', a quaternary digit is sometimes called a ''crumb''.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)