Hexadecimal Number System Conversion

 

Hexadecimal Number System Conversion – Complete Guide

Introduction to the Hexadecimal Number System

The hexadecimal number system is a base-16 system that uses 16 symbols:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Here,
A = 10, B = 11, C = 12, D = 13, E = 14, F = 15 (in decimal).

It is widely used in digital electronics, computer programming, memory addressing, and color codes in web design because it provides a compact way to represent binary numbers.


Types of Hexadecimal Number Conversions

Hexadecimal numbers are often converted to and from other number systems:

  1. Hexadecimal to Decimal

  2. Decimal to Hexadecimal

  3. Hexadecimal to Binary

  4. Binary to Hexadecimal

  5. Hexadecimal to Octal (via binary as an intermediate step)


1. Hexadecimal to Decimal Conversion

To convert from hexadecimal to decimal:

  • Multiply each digit by 16 raised to the power of its position (starting from 0 at the rightmost digit).

  • Add the results.

Example: Convert 2F to decimal
= (2 × 16¹) + (F × 16⁰)
= (2 × 16) + (15 × 1)
= 32 + 15
= 47


2. Decimal to Hexadecimal Conversion

To convert from decimal to hexadecimal:

For Integer Part:

  • Divide the decimal number by 16.

  • Write the remainder (convert 10–15 into A–F).

  • Repeat until quotient is 0.

  • Read remainders from bottom to top.

For Fractional Part:

  • Multiply the fraction by 16.

  • Take the integer part as the hexadecimal digit.

  • Repeat until fraction becomes 0 or desired precision is reached.

Example: Convert 255 to hexadecimal
255 ÷ 16 = 15 R15 (F)
15 ÷ 16 = 0 R15 (F)
Result: FF


3. Hexadecimal to Binary Conversion

Each hexadecimal digit can be replaced by its 4-bit binary equivalent:

HexBinary
00000
10001
20010
30011
40100
50101
60110
70111
81000
91001
A1010
B1011
C1100
D1101
E1110
F1111

Example: Convert 3A to binary
3 → 0011, A → 1010 → 00111010


4. Binary to Hexadecimal Conversion

Group the binary number into 4-bit groups starting from the right and replace each group with its hexadecimal equivalent.

Example: Convert 11010110 to hexadecimal
Group: 1101 0110
1101 → D, 0110 → 6
Result: D6


5. Hexadecimal to Octal Conversion

  • Convert hexadecimal to binary (each digit → 4 bits).

  • Group binary into 3 bits from right to left.

  • Convert each group to octal.

Example: Convert 2F to octal
Hex 2 → 0010, F → 1111 → Binary: 00101111
Group in 3 bits: 00 101 111 → Octal: 57


Quick Conversion Table

DecimalHexBinaryOctal
0000000
1100011
10A101012
15F111117
16101000020
311F1111137
472F10111157
255FF11111111377

Applications of Hexadecimal Conversion

  • Computer Memory Addressing – Compact representation of large binary addresses.

  • Programming – Often used in assembly language, debugging, and machine code.

  • Web Design – Color codes (e.g., #FF5733 in HTML/CSS).

  • Networking – MAC addresses and IPv6 addresses are written in hexadecimal.


click below to download pdf:



Comments

Popular posts from this blog

Decimal to BCD Conversion (8421, 5421, 2421 Codes) – Digital Electronics

Decimal Number Conversion

Octal conversion