Learning Hexadecimals and Binary

All processors work like a on and off switch in theory, the reality is much more complex. Processors only work by using 0s and 1s to process information in the form of binary code. A bit is a single digit (1 or 0), a byte is a 8-digit binary which could be 8 digits of 0s, 8 digits of 1s, or just all kinds of 0s and 1s that make up a single byte. However there is also something called a nibble which is made up of 4 bits. So in summary, you first have a bit, 4 bits make up a nibble, and 2 nibbles make up a byte which is also 8 bits. That might be phrased in a bad way because of how truly complicated it is to explain sometimes to some people who are not aware of these concepts.

Hexadecimals

Hexadecimals or Base 16 are like replacements for binary numbers to make them more readable, just like how the C programming language is a replacement for Assembly so humans can actually make instructions or programs that computers can understand. Hexadecimals start from 0 to 9 and also have letters: A, B, C, D, E, F. Lately I was learning more about them because it seemed like a very useful concept to known in both mathematics and computers in general.

Examples

To represent a binary sequence organised by 4 digits by 1 spacing of numbers like:

0001 1011 0100 1000 1010 0010 1101 1111

In hexadecimals it would be:

0x1B48A2DF

The nibble part of the binary sequence becomes more important because in order to convert to a hexadecimal it has to be 4 bits from the binary sequence. The addition of the '0x' in the beginning is to indicate that this is hexadecimal code, which is usually added if working with multiple decimal systems, the actual hexadecimal code converted from binary is after the '0x' that was added at the start.

Below is a table that was used to convert the binary sequence to hexadecimals.

| Binary | Hexadecimal |
| ------ | ----------- |
| 0000   | 0           |
| 0001   | 1           |
| 0010   | 2           |
| 0011   | 3           |
| 0100   | 4           |
| 0101   | 5           |
| 0110   | 6           |
| 0111   | 7           |
| 1000   | 8           |
| 1001   | 9           |
| 1010   | A           |
| 1011   | B           |
| 1100   | C           |
| 1101   | D           |
| 1110   | E           |
| 1111   | F           |
    

Sources

Hexadecimal to Binary

Hexadecimals