HOME

TheInfoList



OR:

Quaternary is a
numeral system A numeral system is a writing system for expressing numbers; that is, a mathematical notation for representing numbers of a given set, using digits or other symbols in a consistent manner. The same sequence of symbols may represent differe ...
with four as its base. It uses the digits 0, 1, 2, and 3 to represent any
real number In mathematics, a real number is a number that can be used to measure a continuous one- dimensional quantity such as a duration or temperature. Here, ''continuous'' means that pairs of values can have arbitrarily small differences. Every re ...
. Conversion from binary is straightforward. Four is the largest number within the subitizing range and one of two numbers that is both a square and a highly composite number (the other being thirty-six), 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. However, it fares no better in the localization of prime numbers (the smallest better base being the
primorial In mathematics, and more particularly in number theory, primorial, denoted by "", is a function from natural numbers to natural numbers similar to the factorial function, but rather than successively multiplying positive integers, the function ...
base six,
senary A senary () numeral system (also known as base-6, heximal, or seximal) has 6, six as its radix, base. It has been adopted independently by a small number of cultures. Like the decimal base 10, the base is a semiprime, though it is unique as the p ...
). Quaternary shares with all fixed-
radix In a positional numeral system, the radix (radices) or base is the number of unique digits, including the digit zero, used to represent numbers. For example, for the decimal system (the most common system in use today) the radix is ten, becaus ...
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 number In mathematics, a rational number is a number that can be expressed as the quotient or fraction of two integers, a numerator and a non-zero denominator . For example, is a rational number, as is every integer (for example, The set of all ...
s and
irrational number In mathematics, the irrational numbers are all the real numbers that are not rational numbers. That is, irrational numbers cannot be expressed as the ratio of two integers. When the ratio of lengths of two line segments is an irrational number, ...
s. See
decimal The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers (''decimal fractions'') of th ...
and binary for a discussion of these properties.


Relation to other positional number systems


Relation to binary and hexadecimal

As with the
octal Octal (base 8) is a numeral system with eight as the base. In the decimal system, each place is a power of ten. For example: : \mathbf_ = \mathbf \times 10^1 + \mathbf \times 10^0 In the octal system, each place is a power of eight. For ex ...
and
hexadecimal Hexadecimal (also known as base-16 or simply hex) is a Numeral system#Positional systems in detail, positional numeral system that represents numbers using a radix (base) of sixteen. Unlike the decimal system representing numbers using ten symbo ...
numeral systems, quaternary has a special relation to the
binary numeral system A binary number is a number expressed in the base-2 numeral system or binary numeral system, a method for representing numbers that uses only two symbols for the natural numbers: typically "0" ( zero) and "1" ( one). A ''binary number'' may als ...
. Each
radix In a positional numeral system, the radix (radices) or base is the number of unique digits, including the digit zero, used to represent numbers. For example, for the decimal system (the most common system in use today) the radix is ten, becaus ...
four, eight, and sixteen is a
power of two A power of two is a number of the form where is an integer, that is, the result of exponentiation with number 2, two as the Base (exponentiation), base and integer  as the exponent. In the fast-growing hierarchy, is exactly equal to f_1^ ...
, so the conversion to and from binary is implemented by matching each digit with two, three, or four binary digits, or bits. For example, in quaternary, :2302104 = 10 11 00 10 01 002. 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 104 = B2416 Although octal and hexadecimal are widely used in
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
and
computer programming Computer programming or coding is the composition of sequences of instructions, called computer program, programs, that computers can follow to perform tasks. It involves designing and implementing algorithms, step-by-step specifications of proc ...
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''.


Fractions

Due to having only factors of two, many quaternary fractions have repeating digits, although these tend to be fairly simple:


Occurrence in human languages

Many or all of the
Chumashan languages Chumashan is an extinct and revitalizing family of languages that were spoken on the southern California West Coast of the United States, coast by Native Americans in the United States, Native American Chumash people, from the Coastal plains an ...
(spoken by the Native American Chumash peoples) originally used a quaternary numeral system, in which the names for numbers were structured according to multiples of four and sixteen, instead of ten. There is a surviving list of Ventureño language number words up to thirty-two written down by a Spanish priest ca. 1819. The Kharosthi numerals (from the languages of the tribes of Pakistan and Afghanistan) have a partial quaternary numeral system from one to ten.


Hilbert curves

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 four sub-quadrants the number will be projected.


Genetics

Parallels can be drawn between quaternary numerals and the way
genetic code Genetic code is a set of rules used by living cell (biology), cells to Translation (biology), translate information encoded within genetic material (DNA or RNA sequences of nucleotide triplets or codons) into proteins. Translation is accomplished ...
is represented by
DNA Deoxyribonucleic acid (; DNA) is a polymer composed of two polynucleotide chains that coil around each other to form a double helix. The polymer carries genetic instructions for the development, functioning, growth and reproduction of al ...
. The four DNA
nucleotide Nucleotides are Organic compound, organic molecules composed of a nitrogenous base, a pentose sugar and a phosphate. They serve as monomeric units of the nucleic acid polymers – deoxyribonucleic acid (DNA) and ribonucleic acid (RNA), both o ...
s in
alphabetical order Alphabetical order is a system whereby character strings are placed in order based on the position of the characters in the conventional ordering of an alphabet. It is one of the methods of collation. In mathematics, a lexicographical order is ...
, 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 pair A base pair (bp) is a fundamental unit of double-stranded nucleic acids consisting of two nucleobases bound to each other by hydrogen bonds. They form the building blocks of the DNA double helix and contribute to the folded structure of both DNA ...
s: A↔T and C↔G and can be stored as data in DNA sequence. For example, the nucleotide sequence GATTACA can be represented by the quaternary number 2033010 (=
decimal The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers (''decimal fractions'') of th ...
9156 or binary 10 00 11 11 00 01 00). The
human genome The human genome is a complete set of nucleic acid sequences for humans, encoded as the DNA within each of the 23 distinct chromosomes in the cell nucleus. A small DNA molecule is found within individual Mitochondrial DNA, mitochondria. These ar ...
is 3.2 billion base pairs in length.


Data transmission

Quaternary
line code In telecommunications, a line code is a pattern of voltage, current, or photons used to represent digital data transmission (telecommunications), transmitted down a communication channel or written to a storage medium. This repertoire of signal ...
s have been used for transmission, from the invention of the telegraph to the 2B1Q code used in modern
ISDN Integrated Services Digital Network (ISDN) is a set of communication standards for simultaneous digital transmission of voice, video, data, and other network services over the digitalised circuits of the public switched telephone network. ...
circuits. The GDDR6X standard, developed by
Nvidia Nvidia Corporation ( ) is an American multinational corporation and technology company headquartered in Santa Clara, California, and incorporated in Delaware. Founded in 1993 by Jensen Huang (president and CEO), Chris Malachowsky, and Curti ...
and Micron, uses quaternary bits to transmit data.


Computing

Some computers have used quaternary floating point arithmetic including the Illinois ILLIAC II (1962) and the Digital Field System DFS IV and DFS V high-resolution site survey systems.


See also

* Conversion between bases * Moser–de Bruijn sequence, the numbers that have only 0 or 1 as their base-4 digits


References


External links

{{commons category
Quaternary Base Conversion
includes fractional part, from Math Is Fun
Base42
Proposes unique symbols for Quaternary and Hexadecimal digits Power-of-two numeral systems