TaleemBay
Study
UniversitiesScholarshipsFeesDates
TaleemBay

Empowering students with Next-Gen tools for a brighter future. Your one-stop destination for education in Pakistan.

Quick Links

  • Universities
  • Study Center
  • Past Papers
  • Date Sheets
  • Results

Support

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service
  • Advertise

Contact Us

  • Arfa Software Technology Park,
    Ferozepur Road, Lahore
  • +92 300 1234567
  • hello@taleembay.com

© 2026 TaleemBay. All rights reserved.

Designed with ❤️ for Pakistan

Home
Unis
Study

Study Center

Overview
9th Class
10th Class11th Class12th Class

Resources

Past PapersDate Sheets

Need Notes?

AI-powered search for instant answers.

Chapter 0
computer-science • matric 9th

Number Systems

Comprehensive study notes for Number Systems (Chapter ) Computer Science Matric 9th. Read detailed explanations, solve MCQs, practice questions with answers. Free online education Pakistan.

Data Representation in Computers

Computers process and store data using electrical signals. To represent information, computers use a binary system that consists of only two digits: 0 and 1. These are called bits (binary digits).

Electronic components like transistors can exist in two states:

  • ON state (1): Represents high voltage
  • OFF state (0): Represents low voltage

All data in computers—numbers, text, images, audio, video—is ultimately represented as a series of 0s and 1s. A group of 8 bits is called a byte, which is the basic unit of storage in computers.

Types of Number Systems

A number system is a mathematical notation for representing numbers using digits or symbols in a consistent manner. In computer science, four number systems are commonly used:

  1. Decimal System (Base-10)
  2. Binary System (Base-2)
  3. Octal System (Base-8)
  4. Hexadecimal System (Base-16)

Each system has a specific base (or radix), which determines how many unique digits are available.

Decimal Number System (Base-10)

The decimal system is the number system we use in everyday life. It has a base of 10, meaning it uses 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.

Positional Value: Each digit's position represents a power of 10:

  • Units place: $10^0 = 1$
  • Tens place: $10^1 = 10$
  • Hundreds place: $10^2 = 100$
  • Thousands place: $10^3 = 1000$

Example: The decimal number 2547 can be expressed as:

$2547 = (2 × 10^3) + (5 × 10^2) + (4 × 10^1) + (7 × 10^0)$

$= 2000 + 500 + 40 + 7 = 2547$

Binary Number System (Base-2)

The binary system is the fundamental number system used in computers. It has a base of 2, using only two digits: 0 and 1.

Positional Value: Each digit position represents a power of 2:

  • $2^0 = 1$
  • $2^1 = 2$
  • $2^2 = 4$
  • $2^3 = 8$
  • $2^4 = 16$
  • $2^5 = 32$

Example: The binary number $1011_2$ converted to decimal:

$1011_2 = (1 × 2^3) + (0 × 2^2) + (1 × 2^1) + (1 × 2^0)$

$= 8 + 0 + 2 + 1 = 11_{10}$

Binary is essential because digital circuits can easily represent two states (ON/OFF), making it ideal for computer hardware.

Octal Number System (Base-8)

The octal system uses base 8, with eight digits: 0, 1, 2, 3, 4, 5, 6, 7. It was commonly used in early computing systems as a shorthand for binary.

Positional Value: Each position represents a power of 8:

  • $8^0 = 1$
  • $8^1 = 8$
  • $8^2 = 64$
  • $8^3 = 512$

Example: The octal number $157_8$ converted to decimal:

$157_8 = (1 × 8^2) + (5 × 8^1) + (7 × 8^0)$

$= 64 + 40 + 7 = 111_{10}$

Octal is useful because three binary digits can be represented by one octal digit, making binary numbers easier to read.

Hexadecimal Number System (Base-16)

The hexadecimal system uses base 16, with sixteen symbols: 0-9 and A-F. The letters represent:

  • A = 10
  • B = 11
  • C = 12
  • D = 13
  • E = 14
  • F = 15

Positional Value: Each position represents a power of 16:

  • $16^0 = 1$
  • $16^1 = 16$
  • $16^2 = 256$
  • $16^3 = 4096$

Example: The hexadecimal number $2A3F_{16}$ converted to decimal:

$2A3F_{16} = (2 × 16^3) + (10 × 16^2) + (3 × 16^1) + (15 × 16^0)$

$= 8192 + 2560 + 48 + 15 = 10815_{10}$

Hexadecimal is widely used in computing for representing memory addresses, color codes, and machine code because four binary digits equal one hexadecimal digit.

Number System Conversions

Converting between number systems is an essential skill in computer science. The most common conversions are:

  • Decimal to Binary: Divide by 2 repeatedly, recording remainders
  • Binary to Decimal: Multiply each bit by its positional value (power of 2) and sum
  • Binary to Octal: Group binary digits in sets of 3 from right to left
  • Binary to Hexadecimal: Group binary digits in sets of 4 from right to left
  • Octal/Hex to Decimal: Multiply each digit by its positional value and sum

Example - Decimal 25 to Binary:

25 ÷ 2 = 12 remainder 1
12 ÷ 2 = 6 remainder 0
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1

Reading remainders from bottom to top: $25_{10} = 11001_2$

Binary Arithmetic - Addition

Binary addition follows four basic rules:

  • $0 + 0 = 0$
  • $0 + 1 = 1$
  • $1 + 0 = 1$
  • $1 + 1 = 10$ (write 0, carry 1)
  • $1 + 1 + 1 = 11$ (write 1, carry 1)

Example: Add $1011_2 + 1101_2$

  1 1 (carries)
  1011
+ 1101
------
 11000

Result: $11000_2$ (which equals $24_{10}$)

Binary Arithmetic - Subtraction

Binary subtraction follows these rules:

  • $0 - 0 = 0$
  • $1 - 0 = 1$
  • $1 - 1 = 0$
  • $0 - 1 = 1$ (borrow 1 from the next higher bit)

Example: Subtract $1101_2 - 1010_2$

  1101
- 1010
------
  0011

Result: $0011_2 = 3_{10}$

When borrowing is needed, take 1 from the next position (which represents 2 in binary), similar to borrowing 10 in decimal subtraction.

Text Encoding - ASCII and Unicode

Computers need to represent text characters as numbers. Two major encoding systems are:

ASCII (American Standard Code for Information Interchange):

  • Uses 7 or 8 bits per character
  • Can represent 128 or 256 characters
  • Includes uppercase letters (A-Z), lowercase letters (a-z), digits (0-9), punctuation, and control characters
  • Example: 'A' = 65, 'a' = 97, '0' = 48

Unicode:

  • Uses 16 bits or more per character
  • Can represent over 1 million characters
  • Supports characters from all languages including Urdu, Arabic, Chinese, emoji, and mathematical symbols
  • UTF-8, UTF-16, and UTF-32 are common Unicode encodings
  • Backward compatible with ASCII

Unicode has become the global standard for text representation in modern computing systems.

Download PDFPDF