Hexadecimal Number System

Hexadecimal Number System

Overview

Hexadecimal (base-16) uses sixteen digits (0-9 and A-F) to represent numbers. It’s widely used in computer systems as a more concise way to represent binary data, where each hex digit represents exactly four binary digits. This makes it particularly useful for representing memory addresses, color codes, and machine code.

Detailed Explanation

Hex to Binary Conversion

Binary: 0011 1010 1111 1100
Hex:      3    A    F    C
         (3AFC hex)

Conversion Table:
0 = 0000   8 = 1000
1 = 0001   9 = 1001
2 = 0010   A = 1010
3 = 0011   B = 1011
4 = 0100   C = 1100
5 = 0101   D = 1101
6 = 0110   E = 1110
7 = 0111   F = 1111

Common Applications

1. Memory Addresses
   0x1000 - Start of program
   0xFFFF - End of segment

2. Color Codes (RGB)
   #FF0000 - Red
   #00FF00 - Green
   #0000FF - Blue

3. Machine Code
   0x90 - NOP instruction
   0xFF - Often used as padding

Practice Problems

  1. Convert to decimal:
    • 0xFF
    • 0x1A5
    • 0xBEEF

← Back to Minor - Digital Electronics