Number systems and binary codes

The binary system is a number system where numbers are represented using the digits 0 and 1. It is used in the computers, since they work with two voltage levels, and thus their natural number system is the binary system (1 - ON, 0 - OFF).

The hexadecimal number system or hexadecimal system (sometimes shortened as Hex) is a number system that uses 16 symbols: from 0 to 9 and A, B, C, D, E and F. Its current use is highly linked to Computer Science, since the computers use the byte or octet as a basic memory unit. Since a byte has 8 bits, they can be represented with two hexadecimal digits.

The base-8 number system is named octal and makes use of digits 0 to 7. In computing, sometimes the octal number system is used instead of hexadecimal. Its main advantage is that it does not require using symbols different to the numbers 0 to 7. However, to work with bytes of sets of bytes, assuming that a byte is an 8-bit word, the hexadecimal system is more comfortable, every byte thus defined is completely represented by two hexadecimal digits.

To convert a decimal base number into an octal one, divide repeatedly by 8 until a 0 quotient is reached. The division reminders in reverse order indicate the octal number. To pass from base-8 to base-10, you only have to multiply each figure by 8 powered to the figure position, and add up the result.

It is very easy to pass from binary to octal, since you only have to group in groups of 3 the binary digits. Thus, the decimal number 74 is represented in binary as 1001010, giving place to the following groups 1 / 001 / 010, obtaining then the decimal number associated to those groups, i.e. 1=1, 001=1 y 010=2. Thus, the decimal number 74 is represented in octal as 112.