MCS-012 Computer Organisation and Assembly Language Programming

First year, Semester 1

Data Representation for Computation

Data representation is crucial in computing as it determines how information is stored, processed, and interpreted by computer systems. For effective computation, data must be represented in a format that the computer can handle efficiently. This involves various types of data formats and encoding schemes. Here’s an overview of the key aspects of data representation for computation:


1. Binary Representation

At the core of data representation is the binary system, which uses two digits: 0 and 1. All data in computers, from numbers to text, is ultimately represented in binary form. This binary data can be grouped and processed in various ways:

  • Bits and Bytes: The smallest unit of data is a bit (binary digit), and eight bits make up a byte. Bytes are used to represent larger quantities of data, such as characters or small numbers.


2. Integer Representation

Integers are whole numbers and are represented in binary form. There are different methods for representing integers:

  • Unsigned Integers: Represent only non-negative numbers. For example, an 8-bit unsigned integer can represent values from 0 to 255.
  • Signed Integers: Represent both positive and negative numbers. Common methods include:
    • Sign-Magnitude Representation: The first bit indicates the sign (0 for positive, 1 for negative), and the remaining bits represent the magnitude.
    • One's Complement: Negative numbers are represented by inverting all bits of the positive number.
    • Two's Complement: A more common method where negative numbers are represented by inverting all bits and adding 1 to the result. This method simplifies arithmetic operations.


3. Floating-Point Representation

Floating-point representation is used for real numbers (numbers with fractional parts) and allows for a wide range of values by representing numbers in scientific notation:

  • IEEE 754 Standard: The most widely used standard for floating-point representation, which divides a number into three parts:
    • Sign Bit: Indicates whether the number is positive or negative.
    • Exponent: Scales the significand by a power of two.
    • Significand (Mantissa): Represents the precision bits of the number.

For example, the number 6.25 can be represented in IEEE 754 single precision as:

  • Sign Bit: 0 (positive)
  • Exponent: 10000001 (which is 129 in decimal, representing an exponent of 2^1)
  • Significand: 1001 (the fractional part)


4. Character Representation

Characters, including letters, digits, and symbols, are represented using encoding schemes:

  • ASCII: Uses 7 bits to represent 128 characters, including standard letters, digits, and punctuation.
  • Unicode: A more comprehensive standard that uses variable-length encoding (UTF-8, UTF-16) to represent characters from all writing systems and symbols worldwide.


5. Data Structures

Data structures are used to organize and manage data efficiently:

  • Arrays: Contiguous memory locations that hold elements of the same type.
  • Linked Lists: A collection of nodes, each containing data and a reference (or pointer) to the next node.
  • Trees: Hierarchical structures where each node has zero or more children, used for organizing data in a way that allows efficient searching and sorting.


6. Compression

Data compression reduces the size of data for efficient storage and transmission. Compression methods include:

  • Lossless Compression: Ensures that original data can be perfectly reconstructed, such as ZIP files and PNG images.
  • Lossy Compression: Reduces file size by removing some data, which is acceptable for certain applications like JPEG images and MP3 audio.


Report an issue

Reporting: Data Representation for Computation (topic)

Related Posts