Header Ads Widget

Number System and its Binary Arithmetic


Number System


1. Definition of Number System

A number system is a systematic way of representing numbers using a set of symbols (digits) and rules. It provides a way to express quantity, magnitude, and information in both human and machine-understandable formats.

Each number system is identified by its base (radix):

  • Base (or Radix): Total number of unique digits available in the system.
  • Digits: The symbols used in that system.
  • Positional value: Each digit’s value depends on its position from the radix point.

For example, in the decimal number 527.4₁₀:
= (5 × 10²) + (2 × 10¹) + (7 × 10⁰) + (4 × 10⁻¹)

Here, base = 10.


2. Types of Number System

Number systems are broadly classified into two categories:

(i) Positional Number System

  • In this system, the value of a digit depends on its position (place value) in the number.
  • The digit’s value = (digit × baseᵖ), where p = position from radix point.
  • Examples: Decimal, Binary, Octal, Hexadecimal.
Example:

In decimal 452₁₀,
= (4 × 10²) + (5 × 10¹) + (2 × 10⁰) = 400 + 50 + 2 = 452

(ii) Non-Positional Number System

  • In this system, each symbol has a fixed value independent of position.
  • Common in ancient civilizations.
  • Example: Roman Number System (I = 1, V = 5, X = 10, L = 50, etc.)
  • In Roman numerals: XII = 10 + 1 + 1 = 12.


3. Types of Digital Number System

Digital systems mainly use positional number systems. The four important types are:

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


3.1 Decimal Number System (Base 10)

  • Uses 10 digits: 0–9.
  • Base = 10.
  • Each digit has a positional value based on powers of 10.
  • General Representation:

N = (dₙ₋₁ dₙ₋₂ … d₁ d₀ . d₋₁ d₋₂ …)₁₀
= Σ dᵢ × 10ⁱ, where i ∈ Z

Example with Radix Point:
327.5₁₀ = (3 × 10²) + (2 × 10¹) + (7 × 10⁰) + (5 × 10⁻¹)
= 300 + 20 + 7 + 0.5 = 327.5


3.2 Binary Number System (Base 2)

  • Uses 2 digits: 0 and 1.
  • Base = 2.
  • Each digit (bit) represents a power of 2.
  • General Representation:

N = (bₙ₋₁ bₙ₋₂ … b₁ b₀ . b₋₁ b₋₂ …)₂
= Σ bᵢ × 2ⁱ, where bᵢ ∈ {0,1}
  • Example with Radix Point:
1011.01₂ = (1 × 2³) + (0 × 2²) + (1 × 2¹) + (1 × 2⁰) + (0 × 2⁻¹) + (1 × 2⁻²)
= 8 + 0 + 2 + 1 + 0 + 0.25 = 11.25₁₀

3.3 Octal Number System (Base 8)

  • Uses 8 digits: 0–7.
  • Base = 8.
  • Each digit has weight as powers of 8.
  • General Representation:

N = (oₙ₋₁ oₙ₋₂ … o₁ o₀ . o₋₁ o₋₂ …)₈
= Σ oᵢ × 8ⁱ
  • Example with Radix Point:
145.3₈ = (1 × 8²) + (4 × 8¹) + (5 × 8⁰) + (3 × 8⁻¹)
= 64 + 32 + 5 + 0.375 = 101.375₁₀

3.4 Hexadecimal Number System (Base 16)

  • Uses 16 digits: 0–9 and A–F (A=10, …, F=15).
  • Base = 16.
  • General Representation:
N = (hₙ₋₁ hₙ₋₂ … h₁ h₀ . h₋₁ h₋₂ …)₁₆
= Σ hᵢ × 16ⁱ

  • Example with Radix Point:

2A.F₁₆ = (2 × 16¹) + (10 × 16⁰) + (15 × 16⁻¹)

= 32 + 10 + 0.9375 = 42.9375₁₀




Binary Arithmetic and Complements


1. Binary Arithmetic

Digital systems operate in binary (base 2), where only 0 and 1 exist. Arithmetic in binary follows rules similar to decimal but restricted to two digits.

(i) Binary Addition

Rules:

  • 0 + 0 = 0
  • 0 + 1 = 1
  • 1 + 0 = 1
  • 1 + 1 = 10 (i.e., 0 with carry 1)

Example:

   1011₂   (11₁₀)
+  1101₂   (13₁₀)
---------
  11000₂   (24₁₀)

(ii) Binary Subtraction

Rules:

  • 0 – 0 = 0
  • 1 – 0 = 1
  • 1 – 1 = 0
  • 0 – 1 = 1 (borrow 1 from next higher bit → 10₂ – 1 = 1)

Example:

   1011₂   (11₁₀)
–  1001₂   (9₁₀)
---------
    0010₂   (2₁₀)

(iii) Binary Multiplication

Rules:

  • 0 × 0 = 0
  • 0 × 1 = 0
  • 1 × 0 = 0
  • 1 × 1 = 1

Example:

     101₂   (5₁₀)
×     11₂   (3₁₀)
------------
     101
+   1010
------------
   1111₂   (15₁₀)

(iv) Binary Division

Binary division is similar to decimal but uses base 2.

Example:

Dividend = 10110₂ (22₁₀)
Divisor  =   10₂  (2₁₀)

Steps:
10 goes in 101 → quotient bit = 1, remainder 01
Bring down next → 011
10 goes in 11 → quotient bit = 1, remainder 01
Bring down next → 010
10 goes in 10 → quotient bit = 1, remainder 0

Quotient = 1011₂ (11₁₀)
Remainder = 0

So, 10110₂ ÷ 10₂ = 1011₂


2. Complements in Number Systems

Complements are methods to simplify subtraction and represent negative numbers in digital systems. Two types exist:

  1. (r–1)’s Complement

  2. r’s Complement

Where r = base (radix) of the number system.


2.1 Binary Complements

(i) 1’s Complement (Binary)

  • Obtained by flipping each bit (0 → 1, 1 → 0).
  • Useful in subtraction.

Example:
Number = 10101₂
1’s Complement = 01010₂

Subtraction using 1’s Complement:
7 – 5 in 4-bit binary:
7 = 0111₂, 5 = 0101₂
Take 1’s comp of 5 → 1010₂
Now add → 0111 + 1010 = (10001₂)
Ignore carry, add back to LSB → 0001₂ = 2


(ii) 2’s Complement (Binary)

  • Obtained by adding 1 to 1’s complement.
  • Widely used in computers for signed numbers.

Example:
Number = 10101₂
1’s Complement = 01010₂
2’s Complement = 01010 + 1 = 01011₂

Subtraction using 2’s Complement:
7 – 5 in 4-bit binary:
7 = 0111₂, 5 = 0101₂
Find 2’s comp of 5 → 1011₂
Now add → 0111 + 1011 = 10010₂
Ignore overflow → 0010₂ = 2


2.2 Decimal Complements

(i) 9’s Complement

  • Subtract each digit from 9.

Example:
Number = 5274
9’s Complement = 9999 – 5274 = 4725


(ii) 10’s Complement

  • 10’s Complement = (9’s Complement) + 1.

Example:
Number = 5274
9’s Complement = 4725
10’s Complement = 4725 + 1 = 4726


2.3 Octal Complements

(i) 7’s Complement

  • For octal numbers (base 8).
  • Subtract each digit from 7.

Example:
Number = 645₈
7’s Complement = (777 – 645)₈ = 132₈


(ii) 8’s Complement

  • 8’s Complement = (7’s Complement) + 1.

Example:
Number = 645₈
7’s Complement = 132₈
8’s Complement = 132 + 1 = 133₈


2.4 Hexadecimal Complements

(i) 15’s Complement

  • For hexadecimal (base 16).
  • Subtract each digit from F (15).

Example:
Number = 2A₁₆
15’s Complement = (FF – 2A)₁₆ = D5₁₆


(ii) 16’s Complement

  • 16’s Complement = (15’s Complement) + 1.

Example:
Number = 2A₁₆
15’s Complement = D5₁₆
16’s Complement = D6₁₆


2.5 General Form

  1. (r–1)’s Complement:
    Subtract each digit of the number from (r–1).

  2. r’s Complement:
    (r’s Complement) = (r–1)’s Complement + 1


3. Summary Table

Base (r) (r–1)’s Complement r’s Complement
Binary (2) 1’s Complement 2’s Complement
Octal (8) 7’s Complement 8’s Complement
Decimal (10) 9’s Complement 10’s Complement
Hex (16) 15’s Complement 16’s Complement

Post a Comment

0 Comments