Binary System

A binary number is a number expressed in the base-2 numeral system, which uses only two symbols: 0 and 1. Each digit in a binary number is called a bit. bits can represent exactly numbers. Binary numbers are often prefixed with 0b to distinguish them from numbers in other bases.

To convert a number to base-:

  1. Group the bits into clusters of bits.
  2. Convert each bit to base-10, and then to base .

To reverse the conversion:

  1. Convert each digit of the base- number to decimal.
  2. Convert to binary and cluster each digit into bit clusters of size .

To convert a number from and to base-:

  1. Convert the number to base-10 and follow the steps for conversion.

Intuition

The following is an easy table that shows you how to convert from hexadecimal to binary: