Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere.... and computer science
Computer science
Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems.... , hexadecimal (also base
Base (mathematics)
In arithmetic, the base refers to the number b in an expression of the form bn. The number n is called the exponent and the expression is known formally as exponentiation of b by n or the exponential of n with base b.... -, hexa, or hex) is a numeral system
Numeral system
A numeral system is a writing system for expressing numerals , and a mathematical notation for representing numbers of a given set, using graphemes or symbols in a consistent manner.... with a radix
Radix
In numeral system, the base or radix is usually the number of unique Numerical digit, including zero, that a Positional notation numeral system uses to represent numbers.... , or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or a through f) to represent values ten to fifteen.
Its primary use is as a human friendly representation of binary code
Binary code
Binary code is the system of representing text or Instruction by the use of a two-numerical digit number system. This system is composed of only the number zero, representing the Off state, and the number one, representing on state, combined in groups of 8.... d values, so it is often used in digital electronics and computer engineering.
Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere.... and computer science
Computer science
Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems.... , hexadecimal (also base
Base (mathematics)
In arithmetic, the base refers to the number b in an expression of the form bn. The number n is called the exponent and the expression is known formally as exponentiation of b by n or the exponential of n with base b.... -, hexa, or hex) is a numeral system
Numeral system
A numeral system is a writing system for expressing numerals , and a mathematical notation for representing numbers of a given set, using graphemes or symbols in a consistent manner.... with a radix
Radix
In numeral system, the base or radix is usually the number of unique Numerical digit, including zero, that a Positional notation numeral system uses to represent numbers.... , or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F (or a through f) to represent values ten to fifteen.
Its primary use is as a human friendly representation of binary code
Binary code
Binary code is the system of representing text or Instruction by the use of a two-numerical digit number system. This system is composed of only the number zero, representing the Off state, and the number one, representing on state, combined in groups of 8.... d values, so it is often used in digital electronics and computer engineering. Since each hexadecimal digit represents four binary digits (bit
Bit
A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory.... s)—also called a nibble
Nibble
A nibble is the computing term for a four-bit aggregation, or half an octet . As a nibble contains 4 bits, there are sixteen possible values, so a nibble corresponds to a single hexadecimal digit .... —it is a compact and easily translated shorthand
Shorthand
Shorthand is an abbreviated symbolic writing method that increases speed or brevity of writing as compared to a normal method of writing a language.... to express values in base two.
Uses
In digital computing, hexadecimal is primarily used to represent byte
Byte
A byte is a basic unit of measurement of Computer storage in computer science. In many computer architectures it is a Byte addressing memory address space.... s. Attempts to represent the 256 possible byte values by other means have led to problems. Directly representing each possible byte value with a single character representation runs into unprintablecontrol character
Control character
In computing and telecommunication, a control Grapheme or non-printing character is a code point in a character encoding, that does not in itself represent a written symbol.... s in the ASCII
ASCII
American Standard Code for Information Interchange , is a coding standard that can be used for interchanging information, if the information is expressed mainly by the written form of English words.... character set. Even if a standard set of printable characters were devised for every byte value, neither users nor input hardware are equipped to handle 256 unique characters. Most hex editing
Editing
Editing is the process of preparing language, s, sound, video, or film through correction, condensation, organization, and other modifications in various media.... software displays each byte as a single character, but unprintable characters are usually substituted with period or blank.
In URLs, all characters can be coded using hexadecimal. Each 2-digit (1 byte) hexadecimal sequence is preceded by a percent sign. For example, the URL http://en.wikipedia.org/wiki/Main%20Page substitutes a space (which is not allowed in URLs) with the hex code for a space (%20).
Representing hexadecimal
In situations where there is no context, a hexadecimal number might be ambiguous and confused with numbers expressed in other bases. There are several conventions for unambiguously expressing values. In mathematics, a subscript (itself written in decimal) is often used on each number explicitly giving the base: 15910 is decimal 159; 15916 is hexadecimal 159 which is equal to 34510. Some authors prefer a text subscript, such as 159decimal and 159hex.
In linear text systems, such as those used in most computer programming environments, a variety of methods have arisen:
In URLs, character codes are written as hexadecimal pairs prefixed with %: http://www.example.com/name%20with%20spaces where %20 is the space (blank) character, code 20 hex, or 32 decimal.
The Extensible Hypertext Markup Language, or XHTML, is a markup language that has the same depth of expression as HTML, but also conforms to XML syntax.... , characters can be expressed as hexadecimal using the notation . Color references are expressed in hex prefixed with #: #FFFFFF which gives white.
C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system.... (and its syntactical descendants) use the prefix 0x: 0x5A3. Character and string constants may express character codes in hexadecimal with the prefix \x followed by two hex digits: '\x1B' (specifies the Esc
Escape character
In computing and telecommunication, an escape character is a single character which in a sequence of characters signifies that what is to follow takes an alternative interpretation.... control character), "\x1B[0m\x1B[25;1H" is a string containing 11 characters (not including an implied trailing NUL). To output a value as hexadecimal with the printf
Printf
The class of printf functions is a class of function , typically associated with curly bracket programming languages, that accept a string parameter which specifies a method for rendering a number of other parameters into a string.... function family, the format conversion code %X or %x is used.
Unicode is a computing industry standard allowing computers to consistently represent and manipulate Character expressed in most of the world's writing systems.... standard, a character value is represented with U+ followed by the hex value: U+20AC is the Euro sign
Euro sign
The euro sign is the currency sign used for the euro, the official currency of the European Union . The design was presented to the public by the European Commission on 12 December 1996.... (€).
Multipurpose Internet Mail Extensions is an Internet standard that extends the format of electronic mail to support:* Text in character sets other than ASCII... (e-mail extensions) quoted-printable
Quoted-printable
Quoted-printable, or QP encoding, is an Semantics encoding using printable characters to transmit 8-bit data over a 7-bit data path. It is defined as a MIME MIME#Content-Transfer-Encoding for use in Internet e-mail.... characters by code inside a text/plain MIME-part body prefix non-printable ASCII characters with an equal to sign =, as in Espa=D1a to send "España" (Spain).
An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture.... s, hexadecimal is indicated with a suffixed H or h: FFh or 0A3CH. Some implementations require a leading zero when the first character is not a digit: 0FFh
The MOS Technology 6502 is an 8-bit microprocessor that was designed by Chuck Peddle and Bill Mensch for MOS Technology in 1975. When it was introduced, it was the least expensive full-featured central processing unit on the market by a considerable margin, costing less than one-sixth the price of competing designs from larger companies such... , AT&T
AT&T
AT&T Inc. is the largest US provider of both local and long distance telephone services, and Digital subscriber line Internet access. AT&T is the second largest provider of wireless service in the United States, with over 77 million wireless customers, and more than 150 million total customers.... , Motorola
Motorola
Motorola, Inc. is an United States, multinational, Fortune 100, telecommunications company based in Schaumburg, Illinois. It is a manufacturer of wireless telephone handsets, also designing and selling wireless network infrastructure equipment such as cellular transmission base stations and signal amplifiers.... ), Pascal
Pascal (programming language)
Pascal is an influential imperative programming and Procedural programming programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structure.... , and some versions of BASIC (Commodore
Commodore BASIC
Commodore BASIC, also known as PET BASIC, is the dialect of the BASIC programming language used in Commodore International's 8-bit home computer line, stretching from the Commodore PET of 1977 to the Commodore 128 of 1985.... ) and Forth use $ as a prefix: $5A3.
Some assembly languages (Microchip) use the notation H'ABCD' (for ABCD16).
*nix (UNIX and related) shells use an escape character form \x0FF in expressions and 0xFF for constants.
Ada is a structured programming, statically typed, Imperative programming, and Object-oriented programming high-level language computer programming programming language, extended from Pascal and other languages.... and VHDL enclose hexadecimal numerals in based "numeric quotes": 16#5A3#
In the semiconductor and electronic design industry, Verilog is a hardware description language used to model Electronics#Electronic systems. Verilog HDL, not to be confused with VHDL, is most commonly used in the design, verification, and implementation of Digital circuit logic chips at the Register transfer level level of Abstraction... represents hexadecimal constants in the form 8'hFF, where 8 is the number of bits in the value and FF is the hexadecimal constant.
Modula 2 and some other languages use # as a prefix: #01AF
Smalltalk is an Object-oriented programming, Type system, reflection computer programming programming language. Smalltalk was created as the language to underpin the "new world" of computing exemplified by "human?computer symbiosis." It was designed and created in part for educational use, more so for constructionist learning, at PARC by Al... programming language uses the prefix 16r: 16r6EF7
Postscript indicates hex with prefix 16#: 16#ABCD. Binary data (such as image pixel
Pixel
In digital imaging, a pixel is the smallest item of information in an image. Pixels are normally arranged in a 2-dimensional grid, and are often represented using dots, squares, or rectangles.... s) can be expressed as unprefixed consecutive hexadecimal pairs: AA213FD51B3801043FBC...
Common Lisp, commonly abbreviated CL, is a dialect of the Lisp programming language, published in American National Standards Institute standard document Information Technology - Programming Language - Common Lisp, formerly X3.226-1994 .... use the prefixes #x and #16r.
QBasic is an integrated development environment and Interpreted language for a variant of the BASIC programming language which is based on QuickBasic.... and Visual Basic
Visual Basic
'Visual Basic' is the third-generation programming language event-driven programming and integrated integrated development environment from Microsoft for its Component Object Model programming model.... , prefix hexadecimal numerals with &H: &H5A3
BBC BASIC is a programming language, developed in 1981 as a native programming language for the MOS Technology 6502 based Acorn Computers BBC Micro home/personal computer, mainly by Sophie Wilson.... and Locomotive_BASIC
Locomotive BASIC
Locomotive Basic is a proprietary dialect of the BASIC programming language written by Locomotive Software used only on the Amstrad CPC . It was the main ancestor of Mallard BASIC, the interpreter for CP/M supplied with the Amstrad PCW and later the Amstrad-designed and built ZX Spectrum +3.... use & for hex.
TI-89 and 92 series uses 0h: 0hA3
Notations such as X'5A3' are sometimes seen, such as in PL/I
PL/I
PL/I is an imperative programming computer programming programming language designed for scientific, engineering, and business applications. It is one of the most feature-rich programming languages and one of the very first in the highly-feature-rich category.... . This is the most common format for hexadecimal on IBM mainframes (zSeries
ZSeries
IBM System z, or earlier IBM eServer zSeries, is a brand name designated by IBM to all its mainframe computers.In 2000, IBM rebranded the existing System/390 to IBM eServer zSeries with the e depicted in IBM's red trademarked symbol.... ) and midrange computers (iSeries) running traditional OS's (zOS, zVSE, zVM, TPF, OS/400), and is used in Assembler, PL/1, Cobol, JCL, scripts, commands and other places. This format was common on other (and now obsolete) IBM systems as well.
Donald Ervin Knuth is a renowned computer science and Emeritus of the Art of Computer Programming at Stanford University.Author of the seminal multi-volume work The Art of Computer Programming , Knuth has been called the "father" of the run-time analysis, contributing to the development of, and systematizing formal mathematical techn... introduced the use of particular typeface to represent a particular radix in his book The TeXbook. There, hexadecimal representations are written in a typewriter typeface: 5A3
There is no universal convention to use lowercase or uppercase for the letter digits, and each is prevalent or preferred by particular environments by community standards or convention.
The choice of the letters A through F to represent the digits above nine was not universal in the early history of computers. During the 1950s, some installations favored using the digits 0 through 5 with a macron
Macron
A macron, from Greek language meaning "long", is a diacritic ? placed over or under a vowel which was originally used to mark a Long syllable#Syllable weight in classical poetry in Meter #Greek and Latin, but has now been taken also to indicate that the vowel is long vowel.... character ("¯") to indicate the values 10-15. Users of Bendix G-15
Bendix G-15
The Bendix G-15 computer was introduced in 1956 by the Bendix Corporation, Computer Division, Los Angeles, California. It was about 5 by 3 by 3 ft and weighed about 950 pound .... computers used the letters U through Z. Bruce A. Martin of Brookhaven National Laboratory
Brookhaven National Laboratory
Brookhaven National Laboratory , is a United States United States Department of Energy National Labs located in Upton, New York on Long Island, and was formally established in 1947 at the site of Camp Upton, a former U.S.... considered the choice of A-F "ridiculous" and in 1968 proposed in a letter to the editor of the ACM
Association for Computing Machinery
The Association for Computing Machinery, or ACM, was founded in 1947 as the world's first scientific and educational computing society. Its membership was approximately 83,000 as of 2007.... an entirely new set of symbols based on the bit locations, which did not gain much acceptance.
Verbal and digital representations
Not only are there no digits to represent the quantities from ten to fifteen—so letters are used as a substitute—but most Western European languages also lack a nomenclature to name hexadecimal numbers. "Thirteen" and "fourteen" are decimal
Decimal
The decimal numeral system has 10 as its Base . It is the most widely used numeral system.... -based, and even though English has names for several non-decimal powers: pair
Pair
The word pair, derived via the French words pair/paire from the Latin par 'equal', can refer to:* 2 , two of something* Topological pair, an inclusion of topological spaces.... for the first binary
Binary numeral system
The binary numeral system, or notation with a radix of 2. Owing to its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used internally by all modern computers.... power; score for the first vigesimal
Vigesimal
The vigesimal or Base - numeral system is based on 20 .... power; dozen
Dozen
Dozen is another word for the number 12 . The dozen may be one of the earliest primitive groupings, perhaps because there are approximately a dozen cycles of the moon or months in a cycle of the sun or year.... , gross
Gross (unit)
A gross is equal to a dozen dozen, i.e. 12 × 12 = 144 .It can be used in duodecimal counting. The use a gross likely originated from the fact that 144 can be counted on the fingers using the fingertips and first two joints of each finger when marked by the thumb of one hand.... , and great gross for the first three duodecimal
Duodecimal
The duodecimal system is a numeral system using 12 as its radix. In this system, the number 10 may be written as 'A', and the number 11 as 'B' .... powers. However, no English name describes the hexadecimal powers (corresponding to the decimal values 16, 256, 4096, 65536, ...). Some people read hexadecimal numbers digit by digit like a phone number: 4DA is "four-dee-eh". However, the letter 'A' sounds similar to eight, 'C' sounds similar to three, and 'D' can easily be mistaken for the 'ty' suffix: Is it 4D or forty? Other people avoid confusion by using the NATO phonetic alphabet
NATO phonetic alphabet
The NATO phonetic alphabet, more formally the international radiotelephony spelling alphabet, is the most widely used spelling alphabet. Though often called "phonetic alphabets", spelling alphabets have no connection to phonetic transcription systems like the International Phonetic Alphabet.... : 4DA is "four-delta-alpha". Similarly, some use the Joint Army/Navy Phonetic Alphabet
Joint Army/Navy Phonetic Alphabet
The Joint Army/Navy Phonetic Alphabet was a radio alphabet developed in 1941 and was used by all branches of the military of the United States until the promulgation of the NATO phonetic alphabet in 1956, which replaced it.... ("four-dog-able"), or a similar ad hoc system.
Systems of counting on (digits) have been devised for both binary and hexadecimal.
Arthur C. Clarke
Arthur C. Clarke
Sri Lankabhimanya Sir Arthur Charles Clarke, Order of the British Empire was a British people science fiction author, inventor, and Futurology, most famous for the novel 2001: A Space Odyssey , written in collaboration with director Stanley Kubrick, a collaboration which also produced the 2001: A Space Odyssey ; and as a host and comment... suggested using each finger as an on/off bit, allowing finger counting from zero to 1023 on ten fingers. Another system for counting up to FF (256) is illustrated on the right; it seems to be an extension of an existing system for counting in twelves (dozens and grosses), that is common in South Asia and elsewhere.
Signs
The hexadecimal system can express negative numbers the same way as in decimal: –2A to represent –42 and so on.
However, some prefer instead to express the exact bit patterns used in the processor and consider hexadecimal values best handled as unsigned
Signed number representations
In mathematics, negative numbers in any base are represented in the usual way, by prefixing them with a "−" sign. However, on a computer, there are various ways of representing a number's sign.... values. This way, the negative number –42 can be written as FFFF FFD6 in a 32-bit CPU register
Processor register
In computer architecture, a processor register is a small amount of Computer storage available on the CPU whose contents can be accessed more quickly than storage available elsewhere.... , as C228 0000 in a 32-bit FPU
Floating point unit
A floating-point unit is a part of a computer system specially designed to carry out operations on floating point numbers. Typical operations are addition, subtraction, multiplication, division , and square root.... register or C045 0000 0000 0000 in a 64-bit FPU register.
Fractions
As with other numeral systems, the hexadecimal system can be used to represent rational number
Rational number
In mathematics, a rational number is a number which can be expressed as a quotient of two integers. Non-integer rational numbers are usually written as the vulgar fraction , where b is not 0 .... s, although recurring digits are common since sixteen (10h) has only a single prime factor (two):
For any base, 0.1 (or "1/10") is always equivalent to one divided by the representation of that base value in its own number system: Counting in base 3 is 0, 1, 2, 10 (three). Thus, whether dividing one by two for binary
Binary
Binary means composed of two parts or two pieces. It contrasts with Unary, Ternary, Quaternary , and so on.Binary may also refer to:* Binary option, also known as digital option OR all-or-nothing option... or dividing one by sixteen for hexadecimal, both of these fractions are written as 0.1. Because the radix 16 is a perfect square
Perfect square
Perfect square may refer to:... (4²), fractions expressed in hexadecimal have an odd period much more often than decimal ones, and there are no cyclic number
Cyclic number
A cyclic number is an integer in which cyclic permutations of the digits are successive multiples of the number. The most widely known is 142857 :... s (other than trivial single digits). Recurring digits are exhibited when the denominator in lowest terms has a prime factor
Prime factor
In number theory, the prime factors of a positive integer are the prime numbers that divide into that integer exactly, without leaving a remainder.... not found in the radix; thus, when using hexadecimal notation, all fractions with denominators that are not a power of two
Power of two
In mathematics, a power of two is any of the integer exponentiation of the number 2 ; in other words, two multiplication by itself a certain number of times.... result in an infinite string of recurring digits (such as thirds and fifths). This makes hexadecimal (and binary) less convenient than decimal
Decimal
The decimal numeral system has 10 as its Base . It is the most widely used numeral system.... for representing rational numbers since a larger proportion lie outside its range of finite representation.
All rational numbers finitely representable in hexadecimal are also finitely representable in decimal, duodecimal
Duodecimal
The duodecimal system is a numeral system using 12 as its radix. In this system, the number 10 may be written as 'A', and the number 11 as 'B' .... and sexagesimal
Sexagesimal
Sexagesimal is a numeral system with 60 as the radix. It originated with the ancient Sumerians in the 3rd millennium BC, was transmitted to the Babylonia, and is still used?in modified form?for measuring time, angles, and geographic coordinates.... : that is, any hexadecimal number with a finite number of digits has a finite number of digits when expressed in those other bases. Conversely, only a fraction of those finitely representable in the latter bases are finitely representable in hexadecimal: That is, decimal 0.1 corresponds to the infinite recurring representation 0.199999999999... in hexadecimal. However, hexadecimal is more efficient than bases 12 and 60 for representing fractions with powers of two in the denominator (e.g., decimal one sixteenth is 0.1 in hexadecimal, 0.09 in duodecimal, 0;3,45 in sexagesimal and 0.0625 in decimal).
The square root of 2, also known as Pythagoras' constant,is the positive real number that, when multiplied by itself, gives the number 2 .... (the length of the diagonal
Diagonal
A diagonal can refer to a line joining two nonconsecutive vertices of a polygon or polyhedron, or in informal contexts any upward or downward sloping line.... of a unit square
Square (geometry)
In Euclidean geometry, a square is a regular polygon with four equal sides and four equal angles . A square with vertices ABCD would be denoted .... )
The square root of 3 is the positive real number that, when multiplied by itself, gives the number 3 . It is denoted byThe first sixty significant digits of its decimal expansion are:... (the length of the diagonal of a unit cube
Cube
A cube is a three-dimensional space solid object bounded by six square faces, facets or sides, with three meeting at each wikt:vertex. The cube can also be called a Regular polyhedron hexahedron and is one of the five Platonic solids.... , or twice the height
Height
Height is the measurement of vertical distance, but has two meanings in common use. It can either indicate how "tall" something is, or how "high up" it is.... of an equilateral triangle
Equilateral triangle
In geometry, an equilateral triangle is a triangle in which all three sides are equal. In traditional or Euclidean geometry, equilateral triangles are also Equiangular polygon; that is, all three internal angles are also congruent to each other and are each 60?.... of unit side)
The square root of 5 is the positive real number that, when multiplied by itself, gives the prime number 5 . This number appears in the formula for the golden ratio.... (the length of the diagonal
Diagonal
A diagonal can refer to a line joining two nonconsecutive vertices of a polygon or polyhedron, or in informal contexts any upward or downward sloping line.... of a 1×2 rectangle
Rectangle
In geometry, a rectangle is a Closed set planar quadrilateral with four right angles. A rectangle with vertices ABCD would be denoted as .A rectangle with adjacent sides of lengths a and b has area ab and diagonals of equal length .... )
In mathematics and the arts, two quantities are in the golden ratio if the ratio between the sum of those quantities and the larger one is the same as the ratio between the larger one and the smaller.... (phi, the golden ratio = )
Pi or p is a mathematical constant whose value is the ratio of any circle's circumference to its diameter in Euclidean geometry; this is the same value as the ratio of a circle's area to the square of its radius.... (pi, the ratio of circumference
Circumference
The circumference is the distance around a closed curve. Circumference is a kind of perimeter.... to diameter
Diameter
In geometry, a diameter of a circle is any straight line segment that passes through the center of the circle and whose endpoints are on the circle.... )
The mathematical constant e is the unique real number such that the function ex has the same value as the derivative, for all values of x.... (the base of the natural logarithm
Natural logarithm
The natural logarithm, formerly known as the hyperbolic logarithm, is the logarithm to the base e , where e is an irrational number constant approximately equal to 2.718281828.... )
The Euler?Mascheroni constant is a mathematical constant recurring in mathematical analysis and number theory, usually denoted by the lowercase Greek letter .... (the limiting difference between the harmonic series
Harmonic series (mathematics)
In mathematics, the harmonic series is the Divergent series infinite series:Its name derives from the concept of overtones, or harmonics, in music: the wavelengths of the overtones of a vibrating string are 1/2, 1/3, 1/4, etc., of the string's fundamental wavelength.... and the natural logarithm)
0.5772156649015328606... (˜ 0.577)
0.93C467E37DB0C7A4D1B... (˜ 0.93C)
Binary translation
Most computers manipulate binary data, but it is difficult for humans to work with the large number of digits for even a relatively small binary number. Although most humans are familiar with the base 10 system, it is much easier to map binary to hexadecimal than to decimal because each hexadecimal digit maps to a whole number of bits (410).
This example converts 11112 to base ten. Since each position
Positional notation
A positional notation or place-value notation system is a numeral system in which each position is related to the next by a constant multiplier, Geometric progression, called the radix or radix of that numeral system.... in a binary numeral can contain either a 1 or 0, its value may be easily determined by its position from the right:
00012 = 110
00102 = 210
01002 = 410
10002 = 810
Therefore:
11112
= 810 + 410 + 210 + 110
= 1510
With surprisingly little practice, mapping 11112 to F16 in one step becomes easy: see table in Uses
Hexadecimal
In mathematics and computer science, hexadecimal is a numeral system with a radix, or base, of 16. It uses sixteen distinct symbols, most often the symbols 0–9 to represent values zero to nine, and A, B, C, D, E, F to represent values ten to fifteen.... . The advantage of using hexadecimal rather than decimal increases rapidly with the size of the number. When the number becomes large, conversion to decimal is very tedious. However, when mapping to hexadecimal, it is trivial to regard the binary string as 4 digit groups and map each to a single hexadecimal digit.
This example shows the conversion of a binary number to decimal, mapping each digit to the decimal value, and adding the results.
The octal numeral system, or oct for short, is the radix-8 number system, and uses the digits 0 to 7. Numerals can be made from Binary numeral system numerals by grouping consecutive digits into groups of three .... system can also be useful as a tool for people who need to deal directly with binary computer data. Octal represents data as three bits per character, rather than four.
In mathematics, computing, linguistics and related subjects, an algorithm is a sequence of finite instructions, often used for calculation and data processing.... for converting a representation of a number to hexadecimal by doing integer division and remainder operations in the source base. Theoretically this is possible from any base but for most humans only decimal and for most computers only binary (which can be converted by far more efficient methods) can be easily handled with this method.
Let d be the number to represent in hexadecimal, and the series hihi-1...h2h1 be the hexadecimal digits representing the number.
i := 1
hi := d mod 16
d := (d-hi) / 16
If d = 0 (return series hi) else increment i and go to step 2
"16" may be replaced with any other base that may be desired.
JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard.... implementation of the above algorithm for converting any number to a hexadecimal in String representation. Its purpose is to illustrate the above algorithm. To work with data seriously however, it is much more advisable to work with bitwise operators.
function toHex(d)
function toChar(n)
Addition and multiplication
It is also possible to make the conversion by assigning each place in the source base the hexadecimal representation of its place value and then performing multiplication and addition to get the final representation.
I.e. to convert the number B3AD to decimal one can split the conversion into D (1310), A (1010), 3 (310) and B (1110) then get the final result by
multiplying each decimal representation by 16p, where 'p' is the corresponding position from right to left, beginning with 0. In this case we have 13*(160) + 10*(161) + 3*(162) + 11*(163), which is equal 45997 in the decimal system.
A graphical user interface is a type of user interface which allows people to human-computer interaction such as computers; hand-held devices such as MP3 Players, Portable Media Players or Gaming devices; household appliances and office equipment.... s provide a built-in calculator utility, capable of performing conversions between various radixes, generally including hexadecimal.
Microsoft Corporation is a multinational corporation computer technology corporation that develops, manufactures, licenses, and supports a wide range of computer software products for computing devices.... Windows
Microsoft Windows
Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces .... , the Calculator utility can be set to scientific calculator
Scientific calculator
A scientific calculator is a type of Electronics calculator, usually but not always handheld, designed to calculate problems in science , engineering, and mathematics.... mode, which allows conversions between radix 16 (hexadecimal), 10 (decimal), 8 (octal
Octal
The octal numeral system, or oct for short, is the radix-8 number system, and uses the digits 0 to 7. Numerals can be made from Binary numeral system numerals by grouping consecutive digits into groups of three .... ) and 2 (binary
Binary numeral system
The binary numeral system, or notation with a radix of 2. Owing to its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used internally by all modern computers.... ); the bases most commonly used by programmers. In Scientific Mode, the on screen numeric keypad
Numeric keypad
A numeric keypad, or numpad for short, is the small, palm-sized, seventeen key section of a computer keyboard, usually on the very far right.... includes the hexadecimal digits A through F which are active when "Hex" is selected. The Windows Calculator however only supports integers.
Cultural
Etymology
The word "hexadecimal" is strange in that hexa is derived from the Greek
Greek language
Greek is an Indo-European languages native to the southern Balkan peninsula, the language of the Greek people. It forms an independent branch within Indo-European.... ?? (hex) for "six" and decimal is derived from the Latin
Latin
Latin is an Italic language, historically spoken in Latium and Ancient Rome. Through the Military history of the Roman Empire, Latin spread throughout the Mediterranean and a large part of Europe.... for "tenth". It may have been derived from the Latin root, but Greek deka is so similar to the Latin decem that some would not consider this nomenclature inconsistent. However, the word "sexagesimal
Sexagesimal
Sexagesimal is a numeral system with 60 as the radix. It originated with the ancient Sumerians in the 3rd millennium BC, was transmitted to the Babylonia, and is still used?in modified form?for measuring time, angles, and geographic coordinates.... " (base 60) retains the Latin prefix. The earlier Bendix documentation used the term "sexadecimal". Donald Knuth
Donald Knuth
Donald Ervin Knuth is a renowned computer science and Emeritus of the Art of Computer Programming at Stanford University.Author of the seminal multi-volume work The Art of Computer Programming , Knuth has been called the "father" of the run-time analysis, contributing to the development of, and systematizing formal mathematical techn... has pointed out that the etymologically correct term is "senidenary", from the Latin term for "grouped by 16". (The terms "binary", "ternary" and "quaternary" are from the same Latin construction, and the etymologically correct term for "decimal" arithmetic is "denary".) Schwartzman notes that the pure expectation from the form of usual Latin-type phrasing would be "sexadecimal", but then computer hackers would be tempted to shorten the word to "sex". Incidentally, the etymologically
Etymology
Etymology is the study of the roots and history of words; and how their form and meaning have changed over time.In languages with a long detailed history, etymology makes use of philology, the study of how words change from culture to culture over time.... proper Greek
Greek language
Greek is an Indo-European languages native to the southern Balkan peninsula, the language of the Greek people. It forms an independent branch within Indo-European.... term would be hexadecadic (although in Modern Greek
Modern Greek
Modern Greek refers the varieties of Greek spoken in the modern era. The beginning of the "modern" period of the language is often symbolically assigned to the fall of the Byzantine Empire in 1453, even though that date marks no clear linguistic boundary and many characteristic modern features of the language had been present centuries earli... deca-hexadic (de?ae?ad????) is more commonly used).
Common patterns and humor
Hexadecimal is sometimes used in programmer jokes because certain words can be formed using only hexadecimal digits. Some of these words are "dead", "beef", "babe", and with appropriate substitutions "c0ffee". Since these are quickly recognizable by programmers, debugging setups sometimes initialize memory to them to help programmers see when something has not been initialized.
Some people add an H after a number if they want to show that it is written in hexadecimal. In older Intel assembly
Assembly language
An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture.... syntax, this is sometimes the case.
"Hexspeak
Hexspeak
Hexspeak, like leetspeak, is a novelty form of variant English language spelling.Hexspeak was created by programmers who wanted a magic number , a clear and unique identifier with which to mark memory or data.... " may be the forerunner of the modern web parlance of "1337speak
Leet
l33t or Eleet , also known as Leetspeak, is an alphabet used primarily on the Internet, which uses various combinations of ASCII characters to replace Latin alphabet letters.... "
In computer programming, the term magic number has multiple meanings. It could refer to one or more of the following:* a constant used to identify a file format or protocol;... in FAT Mach-O
Mach-O
Mach-O, short for Mach kernel object code file format, is a file format for executables, object code, shared libraries, dynamically-loaded code, and core dumps.... files and java class file structure, which is "CAFEBABE". Single-architecture Mach-O files have the magic number "FEEDFACE" at their beginning. "DEADBEEF" is sometimes put into uninitialized memory. Microsoft Windows XP clears its locked index.dat files with the hex codes: "0BADF00D". The Visual C++ remote debugger uses "BADCAB1E" to denote a broken link to the target system.
Two common bit patterns often employed to test hardware are 01010101 and 10101010 (their corresponding hex values are 55h and AAh, respectively). The reason for their use is to alternate between off ('0') to on ('1') or vice versa when switching between these two patterns. These two values are often used together as signatures in critical PC system sectors (e.g., the hex word, 0xAA55 which on little-endian
Endianness
In computing, endianness is the byte ordering used to represent some kind of data. Typical cases are the order in which integer values are stored as bytes in computer memory and the transmission order over a network or other medium.... systems is 55h followed by AAh, must be at the end of a valid Master Boot Record
Master boot record
A master boot record , or partition sector, is the 512-byte boot sector that is the first disk sector of a Disk partitioning data storage device such as a hard disk.... ).
The following table shows a joke in hexadecimal:
3x12=36
2x12=24
1x12=12
0x12=18
The first three are interpreted as multiplication, but in the last, "0x" signals Hexadecimal interpretation of 12, which is 18.
Another joke based on the use of a word containing only letters from the first six in the alphabet (and thus those used in hexadecimal) is...
If only DEAD people understand hexadecimal, how many people understand hexadecimal?
In this case, DEAD refers to a hexadecimal number (57005 base 10), not the state of being no longer alive. Obviously, DEAD normally should not be written in all-caps (as in the preceding) as it makes it stand out, thus ruining the riddle.
In the preface of each of his books and on his website, computer scientist Donald Knuth offers to cheerfully pay a reward of $2.56 to the first finder of each error in one of his published books , whether it be technical, typographical, or historical.... is one hexadecimal dollar, or $2.56.
Primary numeral system
Similar to dozenal advocacy,
There have been occasional attempts to promote hexadecimal as the preferred numeral system. These attempts usually
propose pronunciation and/or symbology. Sometimes the proposal unifies standard
measures so that they are multiples of 16.
Hexadecimal time is the representation of the time of day as a hexadecimal Real number in the Interval [0,1). The day is divided in 1016 hexadecimal hours, each hour in 10016 hexadecimal minutes and each minute in 1016 hexadecimal seconds.... which subdivides a day by 16 so that there are 16 "hexhours" in a day.
See also
External links
If you're here, you're probably thinking about adding an external link to an online calculator or some such. Some points to keep in mind (from the policy at WP:EL, http://en.wikipedia.org/w/index.php?title=Wikipedia:External_links):
The "External links" section should be kept to a minimum. A lack of external links ... is not a reason to add them.
Links to be avoided:
Any site that does not provide a unique resource beyond what the article might contain...
Links mainly intended to promote a website
Sites that are only indirectly related to the article's subject
Since the article is about hexadecimal representation and mentions standard tools for conversion only as a minor example, there is little any external link to an online calculator or converter could possibly add to the reader's knowledge.
-->