Binary, Decimal, e Hexadecimal

Comprendere Number Bases

Compare Number Systems

Computers speak binary, humans think in decimal, e programmers often usare hexadecimal as un convenient middle ground. Comprendere these three number systems e fundamental un computing, programming, e digital literacy.

Decimal (Base-10)

Il system humans usare every giorno.

Come Funziona

  • 10 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • Each position e un power di 10
  • Position values: ...1000, 100, 10, 1

Esempio: 3,452

  • 3 × 1000 = 3000
  • 4 × 100 = 400
  • 5 × 10 = 50
  • 2 × 1 = 2
  • Total = 3452

Perche Base-10?

Likely da counting on 10 fingers. Deeply ingrained in human culture e language.

Binary (Base-2)

Il language di computers.

Come Funziona

  • 2 symbols: 0 e 1
  • Each position e un power di 2
  • Position values: ...128, 64, 32, 16, 8, 4, 2, 1

Esempio: 10110101 (binary)

Position1286432168421
Digit10110101
Valore128032160401

Total = 128 + 32 + 16 + 4 + 1 = 181 (decimal)

Perche Computers Usa Binary

  • Electronic switches hanno two states: on/off
  • Voltage levels: high/low
  • Simple logic circuits
  • Error-resistant (clear distinction tra states)

Hexadecimal (Base-16)

A human-friendly way un represent binary data.

Come Funziona

  • 16 symbols: 0-9 e A-F
  • A=10, B=11, C=12, D=13, E=14, F=15
  • Each position e un power di 16
  • Position values: ...4096, 256, 16, 1

Esempio: 2A9F (hexadecimal)

  • 2 × 4096 = 8192
  • A (10) × 256 = 2560
  • 9 × 16 = 144
  • F (15) × 1 = 15
  • Total = 10,911 (decimal)

Perche Hexadecimal?

  • Each hex digit = esattamente 4 binary digits
  • Much shorter than binary (FF vs 11111111)
  • Easy un convertire un/da binary
  • Comuni in programming, colors, memory addresses

Comparison Table

DecimalBinaryHexadecimal
000000
100011
501015
101010A
151111F
161000010
100110010064
25511111111FF
256100000000100
100011111010003E8

Quando Each System Is Used

Decimal

  • Everyday counting e arithmetic
  • Financial calculations
  • User interfaces (what humans see)

Binary

  • Computer hardware operations
  • Network addresses (IPv4, subnet masks)
  • Bitwise operations in programming
  • Comprendere computer fundamentals

Hexadecimal

  • Color codes (web design): #FF5733
  • Memory addresses in debugging
  • MAC addresses: 00:1A:2B:3C:4D:5E
  • Character encodings (Unicode)
  • Cryptography e hashes

Notation Conventions

Come identify which base un number e in:

Prefixes

  • 0b o 0B: Binary (0b1010)
  • 0x o 0X: Hexadecimal (0xFF)
  • 0o o 0: Octal (0o17 o 017)
  • No prefix: Usually decimal

Suffixes

  • : Binary (1010₂)
  • ₁₀: Decimal (10₁₀)
  • ₁₆ o h: Hexadecimal (FFh o FF₁₆)

Comuni Values un Memorize

ConceptDecimalBinaryHex
One byte (max)25511111111FF
One byte + 1256100000000100
Two byte (max)65,53516 onesFFFF
Powers di 21,2,4,8,16,32,64,128,256,512,10241,10,100...1,2,4,8,10,20,40,80,100...

Conclusione

Comprendere binary, decimal, e hexadecimal e essential per anyone working con computers. Decimal e natural per humans, binary e natural per computers, e hexadecimal bridges il two—making binary data readable while remaining compact. Il key insight e that these sono just different ways di representing il same values, each con their own advantages: decimal per human calculation, binary per hardware efficiency, e hexadecimal per programmer convenience.

Articoli Correlati

Binary, Decimal, Hexadecimal: Comprendere Number Bases | YounitConverter