Contents

Digital Electronics
Number Systems
Logic Gates
Boolean Algebra
Combinational Circuits
Sequential Circuits
Memory & PLDs
Digital System Design
Other Topics
Other Subjects
Section Progress20%

3 of 15 articles

Hexadecimal Number System

Base-16, hex to binary and decimal conversion.

Darshan N
Updated: 7 April 2026
9 min read

Every microcontroller datasheet, memory map, and hardware register uses hexadecimal notation. Understanding hex is non-negotiable for reading CPU instruction encodings, peripheral base addresses, and embedded firmware.

Hexadecimal Number SystemHex Digits and Decimal EquivalentsHex Dec Binary0 0 00001 1 00012 2 00103 3 00114 4 01005 5 01016 6 01107 7 01118 8 10009 9 1001A 10 1010B 11 1011C 12 1100Positional Weight ExampleHex: 2AF3Position: 3 2 1 0Digit: 2 A F 3= 2x16³ + Ax16² + Fx16¹ + 3x16⁰= 2x4096 + 10x256 + 15x16 + 3x1= 8192 + 2560 + 240 + 3= 10995 (decimal)Base: 16 Digits: 0-9, A-FEach hex digit = 4 binary bitsUsed in: memory addresses, register maps
Figure 1: Hex digit mapping and positional value expansion

Core Concept

The hexadecimal system uses base 16. It has sixteen symbols: 0 through 9, then A through F representing decimal 10 through 15. Each single hex digit maps exactly to a 4-bit nibble.

This 1:4 mapping is the key advantage. A 32-bit processor address like 0xBFFF0000 is far more readable than its 32-bit binary equivalent. CPU datasheets, UART baud-rate registers, and I2C device addresses all use hex notation for this reason.

In embedded C and assembly, hex constants are written with the prefix 0x (e.g., 0x1A3C). In GATE problems hex values may also appear as (2AF3)₁₆. The radix subscript confirms the base.

Boolean Expression

The positional value formula is: N = dₙ × 16ⁿ + ... + d₁ × 16¹ + d₀ × 16⁰. Each digit dᵢ is in the range 0–15. For letter digits, substitute A=10, B=11, C=12, D=13, E=14, F=15 before multiplying.

Example
Given:
  Convert (3B7)₁₆ to decimal

Formula / Rule:
  N = d₂×16² + d₁×16¹ + d₀×16⁰

Step by step:
  d₂ = 3, d₁ = B = 11, d₀ = 7
  3 × 256 = 768
  11 × 16  = 176
  7 × 1    = 7
  768 + 176 + 7 = 951

Final Answer:
  (3B7)₁₆ = (951)₁₀
Exam Tip: The most common GATE trap is forgetting that A=10 not 1 and 0. Students also confuse (1A)₁₆ = 26₁₀ with 1A meaning 1 and A separately. Another trap: when converting decimal to hex, divide repeatedly by 16 and read remainders bottom-up. Reading remainders top-down is the classic error.

Key Properties

  • Base 16 system; 16 unique symbols per digit position
  • One hex digit represents exactly 4 binary bits (one nibble)
  • Two hex digits represent one byte (8 bits), range 00 to FF
  • Widely used in memory addressing: x86 segment:offset and ARM Cortex-M peripheral base addresses
  • Hex to binary conversion: replace each hex digit with its 4-bit group, no calculation needed
  • Binary to hex: group binary digits in sets of 4 from LSB side, convert each group
  • Hex arithmetic follows standard carry rules but carry occurs at 16, not 10

Quick Revision

  • Base 16; digits 0–9 and A–F
  • A=10, B=11, C=12, D=13, E=14, F=15
  • 1 hex digit = 4 bits; 2 hex digits = 1 byte
  • Hex to decimal: multiply each digit by 16 raised to its position
  • Decimal to hex: divide by 16, collect remainders from bottom to top
  • Hex to binary: each digit directly expands to a 4-bit group
  • Used in UART, SPI, I2C register maps and CPU memory-mapped I/O
  • Exam trap: reading the repeated-division remainders in the wrong order gives the reversed hex digit sequence

Hexadecimal Number System

Test your ability to convert between hexadecimal, binary, and decimal representations.

Question 1 of 3

Q1.The hexadecimal number 2AF converted to decimal is: