Back to course

Conversion Techniques (Decimal to Binary/Hex)

Digital Logic Systems: From Zero to Hero

3. Conversion Techniques (Decimal to Binary/Hex)

Mastering conversion is crucial for working with digital logic.

Decimal to Binary (The Division Method)

To convert an integer decimal number to binary, repeatedly divide the decimal number by 2 and record the remainders. The binary result is the sequence of remainders, read from bottom to top.

Example: Convert $13_{10}$ to Binary

  1. $13 \div 2 = 6$ remainder 1 (LSB)
  2. $6 \div 2 = 3$ remainder 0
  3. $3 \div 2 = 1$ remainder 1
  4. $1 \div 2 = 0$ remainder 1 (MSB)

Result: $1101_2$

Binary to Hexadecimal

Group binary digits into sets of four, starting from the right. If the last group has less than four digits, pad with leading zeros.

Example: Convert $110110101_2$ to Hex

  1. Group: 0001 (1) 1011 (B) 0101 (5)
  2. Result: $1B5_{16}$

Hexadecimal to Binary

Convert each Hex digit individually into its 4-bit binary equivalent.

Example: Convert $3F2_{16}$ to Binary

  1. 3 = 0011
  2. F = 1111
  3. 2 = 0010

Result: $001111110010_2$