#1,080 – Binary Numerals Written as Hexadecimal

Binary data, for example data stored in in some location in memory, is typically written as a hexadecimal number.  This can be done by grouping the binary digits into groups of four.  Each group of four digits can then be represented by a single hexadecimal character.

Four binary digits can range from 0000 to 1111, representing values from 0 to 15, corresponding to the 16 available characters in the hexadecimal number system.


The example below shows how we can represent a long binary number (16 bits in this case) as a series of hex characters.


The practice of grouping binary data into groups of four digits maps well to data stored in digital computers, since the typical size of a data word in a binary computer is some factor of four–e.g. 16 bits, 32 bits, or 64 bits.  These groups of bits can then be represented by 4, 8, or 16 hexadecimal characters, respectively.