Computer Number Systems and Codes

Introduction

At their core, computers are electronic machines that can only understand two states: ON and OFF, represented as 1 and 0. This fundamental limitation gives rise to the binary number system, which is the foundation of all digital computing. However, humans are more comfortable working with the decimal system (base-10) that we use in everyday life.

For business students, understanding number systems is not about performing complex conversions manually—calculators and software handle that. Instead, it’s about understanding why computers work the way they do, which helps in appreciating data storage capacities, understanding network addressing (like IP addresses), and making informed decisions about IT infrastructure. This section introduces the key number systems used in computing and the character encoding standards that allow computers to represent text.


Why Different Number Systems Matter in Computing

Before diving into the systems themselves, let’s understand why this matters:

Business Context Number System Used Why It Matters
Data Storage Binary (bits, bytes) Understanding file sizes, storage capacity, bandwidth
Network Addressing Binary, Decimal, Hexadecimal IP addresses, MAC addresses, network configuration
Programming & Debugging Hexadecimal Color codes in web design, memory addresses, error codes
Character Encoding Binary (ASCII, Unicode) Multilingual support, data interchange, Nepali language support

The Four Key Number Systems

1. Decimal System (Base-10)

The decimal system is the number system we use daily. It uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

Each position in a decimal number represents a power of 10:

  • 523 = (5 × 10²) + (2 × 10¹) + (3 × 10⁰) = 500 + 20 + 3

This is our natural way of counting, but computers cannot directly work with it.

2. Binary System (Base-2)

The binary system is the language of computers. It uses only two digits: 0 and 1. Each digit is called a bit (binary digit).

Each position represents a power of 2:

  • Binary 1011 = (1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰) = 8 + 0 + 2 + 1 = 11 in decimal

Why Binary? Computers use electronic circuits that have two states:

  • ON (electrical current flowing) = 1
  • OFF (no current) = 0

This makes binary the most reliable and efficient way for electronic systems to store and process data.

Key Terms:

  • Bit: A single binary digit (0 or 1) — the smallest unit of data
  • Byte: 8 bits grouped together — can represent 256 different values (2⁸)
  • Kilobyte (KB): 1,024 bytes
  • Megabyte (MB): 1,024 KB (approximately 1 million bytes)
  • Gigabyte (GB): 1,024 MB (approximately 1 billion bytes)
  • Terabyte (TB): 1,024 GB (approximately 1 trillion bytes)

3. Octal System (Base-8)

The octal system uses eight digits: 0, 1, 2, 3, 4, 5, 6, 7.

Each position represents a power of 8:

  • Octal 17 = (1 × 8¹) + (7 × 8⁰) = 8 + 7 = 15 in decimal

Business Relevance: Octal was historically used in early computing systems. Today, it’s less common but still appears in Unix/Linux file permissions (e.g., chmod 755).

4. Hexadecimal System (Base-16)

The hexadecimal system uses sixteen symbols: 0-9 and A-F (where A=10, B=11, C=12, D=13, E=14, F=15).

Each position represents a power of 16:

  • Hex 2F = (2 × 16¹) + (15 × 16⁰) = 32 + 15 = 47 in decimal

Why Hexadecimal is Important:

  • Compact representation: One hex digit represents exactly 4 binary bits
  • Memory addresses: Computer memory locations are shown in hex
  • Color codes: Web colors use hex (e.g., #FF5733 for orange)
  • MAC addresses: Network device identifiers (e.g., 00:1A:2B:3C:4D:5E)
  • IPv6 addresses: Next-generation internet addresses use hex

Number System Conversion Summary

From To Method
Decimal → Binary Divide by 2 repeatedly, read remainders bottom-up  
Binary → Decimal Multiply each bit by its power of 2, sum the results  
Decimal → Hexadecimal Divide by 16 repeatedly, read remainders bottom-up  
Hexadecimal → Decimal Multiply each digit by its power of 16, sum the results  
Binary → Hexadecimal Group bits in sets of 4 (from right), convert each group  
Hexadecimal → Binary Convert each hex digit to 4 binary bits  

Quick Conversion Example

Convert Decimal 156 to Binary:

  • 156 ÷ 2 = 78 remainder 0
  • 78 ÷ 2 = 39 remainder 0
  • 39 ÷ 2 = 19 remainder 1
  • 19 ÷ 2 = 9 remainder 1
  • 9 ÷ 2 = 4 remainder 1
  • 4 ÷ 2 = 2 remainder 0
  • 2 ÷ 2 = 1 remainder 0
  • 1 ÷ 2 = 0 remainder 1

Reading bottom-up: 10011100

Convert Binary 10011100 to Hexadecimal:

  • Group: 1001 1100
  • Convert: 9 C (12)
  • Result: 9C

Computer Codes: Representing Text

Computers store everything as numbers. To represent text characters (letters, numbers, symbols), we need a standardized coding system that assigns a unique number to each character.

ASCII (American Standard Code for Information Interchange)

ASCII is one of the oldest and most fundamental character encoding standards, developed in the 1960s.

Key Characteristics:

  • Uses 7 bits to represent each character
  • Can represent 128 different characters (2⁷ = 128)
  • Includes: uppercase letters (A-Z), lowercase letters (a-z), digits (0-9), punctuation, and control characters

Common ASCII Values:

Character Decimal Binary
A 65 01000001
Z 90 01011010
a 97 01100001
z 122 01111010
0 48 00110000
9 57 00111001
Space 32 00100000

Limitation: ASCII was designed for English and cannot represent characters from other languages like Nepali (नेपाली), Chinese, or Arabic.

Unicode: The Universal Standard

Unicode was developed to solve ASCII’s limitation by creating a universal character encoding standard that can represent text from virtually every writing system in the world.

Key Characteristics:

  • Can represent over 143,000 characters from 154 scripts
  • Includes ancient scripts, emojis, mathematical symbols, and more
  • UTF-8 is the most common encoding format (variable-length: 1-4 bytes per character)
  • UTF-16 uses 2-4 bytes per character

Why Unicode Matters for Nepal:

  • Enables computers to properly display Devanagari script (नेपाली)
  • Essential for Nepali websites, applications, and databases
  • Allows businesses to communicate in Nepali digitally
  • Required for government e-services and banking systems serving Nepali users

Unicode Examples:

Character Unicode Code Point Description
A U+0041 Latin Capital Letter A
U+0905 Devanagari Letter A
U+0915 Devanagari Letter KA
U+20B9 Indian Rupee Sign
😀 U+1F600 Grinning Face Emoji

Business Applications

Finance and Accounting

  • Data Storage: Understanding that a 1 GB file can store approximately 1 billion characters helps in planning database sizes for financial records
  • Bank Account Numbers: Often stored and transmitted using specific encoding to prevent errors
  • Currency Symbols: Unicode enables proper display of रु (Nepali Rupee), ₹ (Indian Rupee), $ (Dollar)

Marketing

  • Web Design: Hexadecimal color codes (e.g., #E74C3C for red) are essential for branding
  • Multilingual Content: Unicode enables marketing campaigns in multiple languages, including Nepali
  • Character Limits: Understanding bytes helps in planning SMS campaigns (160 ASCII characters vs. 70 Unicode characters per SMS)

Operations

  • Barcode Systems: Barcodes encode product information in binary patterns
  • Network Configuration: IT teams work with IP addresses in decimal, binary, and hexadecimal
  • Data Transmission: Understanding bits and bytes helps in calculating bandwidth requirements

Human Resources

  • Employee Records: Unicode support ensures correct storage of Nepali names
  • International Systems: HR systems must handle names from various languages
  • Data Import/Export: Character encoding issues can corrupt employee data if not handled properly

Real-World Examples from Nepal

1. eSewa and Digital Wallets

When you see your balance as “रु 5,000” on the eSewa app:

  • The रु symbol is stored using Unicode (U+0930 + U+0941)
  • The numbers are processed in binary by the server
  • The app uses UTF-8 encoding to display Nepali text correctly

2. Nepal Rastra Bank Systems

Banking systems in Nepal must:

  • Store customer names in Devanagari script (Unicode)
  • Process transaction amounts in binary at the hardware level
  • Use hexadecimal for security encryption keys
  • Display currency in the correct format with proper character encoding

3. Nepali E-Government Services

Websites like the Department of Passport or Nagarik App:

  • Must support Nepali language input and display (Unicode)
  • Store citizen data with proper encoding
  • Issue documents with Nepali text (requires Unicode fonts)

4. Web Development in Nepal

A web developer in Kathmandu creating a website:

  • Uses hex color codes (#FF5733) for design
  • Ensures UTF-8 encoding for Nepali content
  • Calculates image sizes in bytes/KB/MB for optimization
  • Works with binary data when handling file uploads

Key Takeaways

  • Computers fundamentally work in binary (0s and 1s) because electronic circuits have two states
  • The decimal system is for humans; binary is for computers; hexadecimal is a convenient shorthand for programmers
  • A bit is the smallest unit of data; 8 bits make a byte
  • ASCII can represent 128 characters (mainly English); Unicode can represent 143,000+ characters from all languages
  • Unicode (UTF-8) is essential for Nepali language support in digital systems
  • Understanding these concepts helps business professionals make informed decisions about IT systems, storage, and internationalization

Review Questions

  1. Why do computers use the binary number system instead of the decimal system that humans use?

  2. A marketing team wants to send an SMS campaign in Nepali. Why might the message length be limited to 70 characters instead of 160 characters?

  3. Explain why Unicode is important for a Nepali e-commerce website like Daraz or SastoDeal.

  4. Convert the decimal number 200 to binary. Show your working.

  5. A web designer specifies a color as #3498DB. What number system is being used, and why is it preferred over binary for this purpose?

  6. What is the difference between ASCII and Unicode? Why was Unicode developed?