Section 10.1 Binary Numbers
Subsection 10.1.1 Binary
Binary is a base-2 number system, in that each digit represents a power of 2. Then, each digit is a bit, being either 0 or 1.
Subsection 10.1.2 Converting from Decimal to Binary
For a number \(n\) is decimal, determine the highest power of 2 which is less than or equal to \(n\text{.}\)
Subsection 10.1.3 Operations in Binary
Addition in binary can be done just as elementary school addition with decimal numbers, with carries for digit sums which are 2 or greater.
Similarly, subtraction, with borrowing if necessary.
Subsection 10.1.4 Hexadecimal
Hexadecimal is base-16. It is more compact. The digits 10-15 are represented by A-F.
To convert binary to hexadecimal, separate the number into 4-digit blocks, adding leading 0's as necessary. Consider each block as a number from 0-15, and convert it into the hexadecimal equivalent. Then, append the hexadecimal digits to form the hexadecimal number.
To convert from hexadecimal to binary, convert each hexadecimal digit to a string of 4 binary digits, and append these 4-digit blocks to form the binary number.