Lesson
05 of 26
Translate

Number Systems & Data Representation

Binary, Octal, Decimal, Hexadecimal number systems, conversions, ASCII, Unicode, and how computers represent data internally for UPSSSC AGTA.

Why Number Systems Matter

Humans think in decimal (base-10, using digits 0-9) because we have 10 fingers. But computers think in binary (base-2, using only 0 and 1) because electronic circuits have only two states — ON (1) and OFF (0).

Understanding number systems helps you grasp how computers store and process all data — from a simple number to a high-definition video.


The Four Number Systems

SystemBaseDigits UsedUsed By
Binary20, 1Computers internally
Octal80, 1, 2, 3, 4, 5, 6, 7Older computer systems
Decimal100, 1, 2, 3, 4, 5, 6, 7, 8, 9Humans (everyday use)
Hexadecimal160-9, A(10), B(11), C(12), D(13), E(14), F(15)Memory addresses, colors, programming

Binary Number System (Base-2)

The binary system is the language of computers. Every piece of data — text, images, audio, video — is ultimately stored as sequences of 0s and 1s.

Each binary digit is called a bit. Eight bits make one byte.

Place Values in Binary

Each position represents a power of 2 (from right to left):

Position76543210
Power of 21286432168421

Example: Binary 1101 = 1×8 + 1×4 + 0×2 + 1×1 = 13 in decimal.

Binary 1101 → Decimal Conversion
1×8
1×4
0×2
1×1
8 + 4 + 0 + 1 = 13

Decimal to Binary Conversion

Method: Divide by 2 repeatedly, note the remainders from bottom to top.

Example: Convert 25 to binary

DivisionQuotientRemainder
25 ÷ 2121
12 ÷ 260
6 ÷ 230
3 ÷ 211
1 ÷ 201

Read remainders bottom to top: 25 = 11001 in binary

Binary to Decimal Conversion

Method: Multiply each bit by its place value and add.

Example: Convert 11010 to decimal = 1×16 + 1×8 + 0×4 + 1×2 + 0×1 = 16 + 8 + 0 + 2 + 0 = 26


Octal Number System (Base-8)

Uses digits 0-7. Each octal digit represents exactly 3 binary bits.

OctalBinary
0000
1001
3011
5101
7111

Hexadecimal Number System (Base-16)

Uses 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15). Each hex digit represents exactly 4 binary bits (1 nibble).

HexDecimalBinary
000000
550101
991001
A101010
F151111

Common use: Memory addresses, HTML colors (#FF5733 = Red:FF, Green:57, Blue:33), MAC addresses.


Data Representation — How Computers Store Text

Since computers only understand 0s and 1s, every character (letter, digit, symbol) must be assigned a unique binary number. This is done using coding systems:

ASCII (American Standard Code for Information Interchange)

ASCII uses 7 bits to represent characters, giving 128 possible characters (0-127).

CharacterASCII CodeBinary
A651000001
B661000010
Z901011010
a971100001
0480110000
Space320100000

Extended ASCII uses 8 bits = 256 characters (includes accented letters, symbols).

Unicode

Unicode is a modern standard that supports over 1,00,000 characters from virtually every language in the world — including Hindi (Devanagari), Arabic, Chinese, Japanese, emojis, and mathematical symbols.

  • UTF-8 — Most common encoding on the internet (uses 1-4 bytes per character)
  • UTF-16 — Used by Windows and Java

ASCII can represent only English; Unicode can represent ALL languages including Hindi (हिंदी).


Types of Data in Computers

Data TypeWhat it RepresentsHow it’s Stored
TextLetters, numbers, symbolsASCII or Unicode codes
NumbersIntegers, decimalsBinary (integer) or Floating point
ImagesPhotos, graphicsPixels with color values (BMP, JPEG, PNG)
AudioMusic, voiceSampled waveforms (MP3, WAV)
VideoMoving images + audioFrames + audio track (MP4, AVI)

Key Takeaways

  • Computers use binary (base-2: only 0 and 1) because circuits have two states (ON/OFF)
  • Four number systems: Binary (2), Octal (8), Decimal (10), Hexadecimal (16)
  • Decimal to binary: divide by 2, read remainders bottom-up
  • Binary to decimal: multiply each bit by its power of 2 and add
  • ASCII uses 7 bits (128 characters, English only); Unicode supports all languages (100,000+ characters)
  • 1 hex digit = 4 bits (1 nibble); 1 octal digit = 3 bits
  • All computer data (text, images, audio, video) is ultimately stored as binary

Summary Cheat Sheet

ConceptKey Details
BinaryBase-2 (0,1) — computer’s native language
DecimalBase-10 (0-9) — human system
OctalBase-8 (0-7) — 1 octal digit = 3 bits
HexadecimalBase-16 (0-F) — 1 hex digit = 4 bits (1 nibble)
Decimal→BinaryDivide by 2, remainders bottom to top
Binary→DecimalMultiply bits by powers of 2, add up
BitSmallest unit — 0 or 1
Byte8 bits
Nibble4 bits = 1 hex digit
ASCII7-bit, 128 characters, English only
Extended ASCII8-bit, 256 characters
Unicode1,00,000+ characters, all languages including Hindi
UTF-8Most common Unicode encoding on internet
A in ASCII65
a in ASCII97
0 in ASCII48

Knowledge Check

Take a dynamically generated quiz based on the material you just read to test your understanding and get personalized feedback.

Lesson Doubts

Ask questions, get expert answers

Lesson Doubts is a Pro feature.Upgrade