hexadecimal(abbreviated ashexOr subscript 16) is a counting system with a radix of 16Carry system。It is usually represented by the numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and the letters A, B, C, D, E, F (a, b, c, d, e, f), where A~F represents 10~15, which are calledHexadecimal digit。
The abovehexadecimalA brief overview is given. Here is an example:
for exampledecimal systemNumber 57, atBinaryWrite 111001, and write 39 in hexadecimal system.Nowadays, hexadecimal is widely used incomputerThis is because it is not too difficult to convert 4 bits into separate hexadecimal digits.One byte can be represented as two consecutive hexadecimal digits.However, this mixed representation is easy to confuse, so it needs some prefixes, suffixes or subscripts to display.[1]
AdaAndVHDLWrap the hexadecimal number with the "number citation" based on, such as "16 # 5A3 #".(Note: Ada can use either integer or real number from 1 to 16 as its radix.) For byte vectors,VHDLUse the prefix x, for example, x "10", and the corresponding binary code is "00010000".
C language、C++、Shell、Python、JavaLanguage and other similar languages use the prefix "0x", such as "0x5A3"."0" order at the beginningParserMore recognizable number, while "x" stands for hexadecimal (just as "O" stands foroctal number system)。The "x" in "0x" canUppercaseora lowercase letter。The character quantity in C language is represented by x+two hexadecimal digits, such as xFF.
Hexadecimal escape sequence: for example, x1abf4, you can use any number of hexadecimal digits until they are not hexadecimal digits;
16 bit universal character name: u must be followed by four hexadecimal digits (less than four digits must be supplemented with zeros), representing code points in Unicode within the range of 0 to 0xFFFF (but not code points within the range of 0xD800 to 0xDFFF. Unicode standards stipulate that code points within this range are reserved and do not represent characters);
32-bit universal character name: U must be followed by 8 hexadecimal digits (less than eight digits must be preceded by zeros), representing all possible code points in Unicode (except 0xD800 to 0xDFFF).
C++11 introduces hexadecimalfloat Literal constant。For example, 0x1.2p10 means (1+2/16) × 2=1152ten。In fact, the C/C++language standard library function printf,% a used by Visual C++as a type specifier to format the output floating point value is the above format.For example: printf ("% a", 1152.0);
stayHTML, hexadecimal characters can use "x", for example&# x5a3;The effect should be the same as that of Guangzhou.
Intel'sassembly languageThe suffix "h" is used to identify 16 carry numbers (if the number starts with a letter, a "0" will be added in front), such as "0A3Ch", "5A3h"
It can also be used in the form of X '5A3', such asPL/I,COBOLandJCLMedium.This is alsoIBMMounting of earlier operating systemsmainframeAndMinicomputerThe most commonly used data format on.
Since there is no single, agreed standard for representation, all of the above representations have been used, and sometimes even several different representations appear in the same paper.However, because there is not much difference between the various methods, even mixed use does not pose a problem.
The most common (or common) way to represent hexadecimal values is to add '0x' before the number, or add 16 small words after the number.For example 0x2BAD and 2BADsixteenIt meansdecimal system11181 (or 11181ten)。
stayWeb Design Upper hexadecimal is very common.HTMLandCSSUse hexadecimal notation to represent specific colors on a Web page.Use the symbol of # to represent hexadecimal instead of individual symbols.The 24 bit color can be expressed in the format of # RRGGBB. RR is the value of the red component in the color, GG is the value of the green component in the color, and BB is the value of the blue component in the color.For example, the red shadow is decimal 238,9,63, which can be coded as # EE093F.[1]
Representation method table
Here hex is carried into the specific hexadecimal number
Environmental Science
format
remarks
URL
%hex
XML,XHTML
&#xhex
HTML,CSS
#hex
6 bits for color
Unicode
U+hex
6 bits, representing character code
MIME
=hex
Modula-2
#hex
Smalltalk,ALGOL 68
16rhex
Common Lisp
#Xhex or # 16rhex
IPv6
8 hexes are separated by:
Hexadecimal conversion
Announce
edit
computing method
Main entry: decimal conversion
Decimal to hexadecimal
MiningRemainder theoremDisassemble, such as 4877tenConvert to hexadecimal: