Number Systems in Computer Organization

Number Systems in Computer Organisation | Academic Series

Understanding Number Systems in Computer Organisation

In the realm of Computer Organisation and Architecture (COA), the number system serves as the foundational language for data representation and processing. While humans primarily use the decimal system, digital computers operate using binary signals. Understanding how these systems interact, convert, and represent complex data is essential for mastering hardware logic and assembly programming.

1. The Concept of Radix (Base)

The Radix or Base ($r$) of a number system defines the total number of unique digits (including zero) used to represent values.

  • A number $N$ in base $r$ is represented as $(d_n d_{n-1} ... d_0 . d_{-1} d_{-2} ...)_r$.
  • The value of each digit depends on its position, calculated as $d_i \times r^i$.
  • The maximum value of a single digit in any system is always $r-1$.

2. Types of Number Systems

Decimal System (Base 10)

The standard human system using digits 0–9.

Binary System (Base 2)

The fundamental language of computers using 0 and 1 (bits), aligning with "ON/OFF" electronic states.

Octal System (Base 8)

Uses digits 0–7. Often shorthand for binary (1 octal digit = 3 bits).

Hexadecimal (Base 16)

Uses 0–9 and A–F. Widely used in memory addressing and color codes (1 hex digit = 4 bits).

Number System Conversion Map showing Decimal, Binary, Octal, and Hexadecimal relationships
Figure 1: Comprehensive map of conversion methodologies between primary number systems.

3. Conversion Techniques

A. Any Base to Decimal

To convert a number from base $r$ to decimal, use the weighted sum method: Multiply each digit by $r$ raised to the power of its position and sum the results.

Example: (1101)₂ = (1 × 2³) + (1 × 2²) + (0 × 2¹) + (1 × 2⁰)
= 8 + 4 + 0 + 1 = (13)₁₀

B. Decimal to Any Base

Integer Part:

Use Successive Division. Divide the decimal number by $r$ and record remainders. (LSB to MSB).

Fractional Part:

Use Successive Multiplication. Multiply the fraction by $r$ and record the integer part generated.

C. Shortcut: Binary ↔ Octal/Hex

Since $8 = 2^3$ and $16 = 2^4$, conversions are simplified through bit grouping:

Conversion Method
Binary to Octal Group bits into sets of 3.
Binary to Hex Group bits into sets of 4.
Reverse Replace digit with its 3/4-bit binary equivalent.

4. Representation of Signed Numbers

In digital systems, "signed" numbers represent both positive and negative values. Since computers cannot use symbols, the Most Significant Bit (MSB) is designated as the sign bit (0 for positive, 1 for negative).

Anatomy of a Signed Binary Number illustrating MSB as sign bit
Figure 2: Structure of an 8-bit register showing the Sign Bit and Magnitude components.

I. Sign-Magnitude Representation

The MSB is the sign, and remaining bits represent absolute magnitude. Drawback: Two representations for zero (+0 and -0).

II. 1’s Complement

Invert all bits of the positive equivalent. Drawback: Still suffers from the "double zero" problem.

III. 2’s Complement (Standard)

Calculation: 1’s Complement + 1.

  • Unique representation for zero.
  • Simplifies subtraction to addition logic.
  • More efficient hardware implementation.
2s Complement Transformation Process Flowchart
Figure 3: Algorithmic steps to convert a positive binary number to its negative 2's complement form.

5. Why This Matters in Computer Organisation

1

Memory Addressing

Hexadecimal is used to represent complex memory locations concisely.

2

Instruction Sets

Opcodes and operands are ultimately processed as binary bitstrings.

3

Efficiency

Optimize storage and minimize overflow errors during ALU operations.

4

Hardware Logic

Logic gates (AND, OR, NOT) operate directly on binary inputs.

"Digital computation is not just about math; it's about the elegant translation between human ideas and electrical states."

End of Session Notes