Quaternary numeral system

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Quaternary is the base-4 numeral system. It uses the digits 0, 1, 2 and 3 to represent any real number.

It shares with all fixed-radix numeral systems many properties, such as the ability to represent any real number with a canonical representation (almost unique) and the characteristics of the representations of rational numbers and irrational numbers. See decimal and binary for a discussion of these properties.

Relation to other positional number systems[edit]

A quaternary multiplication table
* 1 2 3 10 11 12 13 20
1 1 2 3 10 11 12 13 20
2 2 10 12 20 22 30 32 100
3 3 12 21 30 33 102 111 120
10 10 20 30 100 110 120 130 200
11 11 22 33 110 121 132 203 220
12 12 30 102 120 132 210 222 300
13 13 32 111 130 203 222 301 320
20 20 100 120 200 220 300 320 1000
Numbers zero to sixty-four in standard quaternary
Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Quaternary 0 1 2 3 10 11 12 13 20 21 22 23 30 31 32 33
Octal 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17
Binary 0 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111
Decimal 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Quaternary 100 101 102 103 110 111 112 113 120 121 122 123 130 131 132 133
Octal 20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37
Binary 10000 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111
Decimal 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
Quaternary 200 201 202 203 210 211 212 213 220 221 222 223 230 231 232 233
Octal 40 41 42 43 44 45 46 47 50 51 52 53 54 55 56 57
Binary 100000 100001 100010 100011 100100 100101 100110 100111 101000 101001 101010 101011 101100 101101 101110 101111
Decimal 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
Quaternary 300 301 302 303 310 311 312 313 320 321 322 323 330 331 332 333 1000
Octal 60 61 62 63 64 65 66 67 70 71 72 73 74 75 76 77 100
Binary 110000 110001 110010 110011 110100 110101 110110 110111 111000 111001 111010 111011 111100 111101 111110 111111 1000000

Relation to binary[edit]

As with the octal and hexadecimal numeral systems, quaternary has a special relation to the binary numeral system. Each radix 4, 8 and 16 is a power of 2, so the conversion to and from binary is implemented by matching each digit with 2, 3 or 4 binary digits, or bits. For example, in base 4,

302104 = 11 00 10 01 002.

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.

By analogy with byte and nybble, a quaternary digit is sometimes called a crumb.

Occurrence in human languages[edit]

Many or all of the Chumashan languages originally used a base 4 counting system, in which the names for numbers were structured according to multiples of 4 and 16 (not 10). There is a surviving list of Ventureño language number words up to 32 written down by a Spanish priest ca. 1819.[1]

The Kharosthi numerals has a partial base 4 counting system from 1 to decimal 10.

Hilbert curves[edit]

Quaternary numbers are used in the representation of 2D Hilbert curves. Here a real number between 0 and 1 is converted into the quaternary system. Every single digit now indicates in which of the respective 4 sub-quadrants the number will be projected.

Genetics[edit]

Parallels can be drawn between quaternary numerals and the way genetic code is represented by DNA. The four DNA nucleotides in alphabetical order, abbreviated A, C, G and T, can be taken to represent the quaternary digits in numerical order 0, 1, 2, and 3. With this encoding, the complementary digit pairs 0↔3, and 1↔2 (binary 00↔11 and 01↔10) match the complementation of the base pairs: A↔T and C↔G and can be stored as data in DNA sequence.[2]

For example, the nucleotide sequence GATTACA can be represented by the quaternary number 2033010 (= decimal 9156 or binary 10 00 11 11 00 01 00).

Data transmission[edit]

Quaternary line codes have been used for transmission, from the invention of the telegraph to the 2B1Q code used in modern ISDN circuits.

See also[edit]

References[edit]

  1. ^ "Chumashan Numerals" by Madison S. Beeler, in Native American Mathematics, edited by Michael P. Closs (1986), ISBN 0-292-75531-7.
  2. ^ http://2010.igem.org/files/presentation/Hong_Kong-CUHK.pdf

External links[edit]