Data Representation Fundamentals and Numeral Systems
Introduction to Digital Data Representation
Background of Digital Techniques: Digital methods have permeated numerous technological sectors, with automatic digital computers representing the most extensive application.
Definition of a Computer: A computer is defined as a hardware system designed to perform arithmetic operations, manipulate data, and make logical decisions.
Nature of Quantities: In science, business, and technology, physical quantities are constantly measured, recorded, and utilized. In digital systems, these quantities are represented using symbols known as digits.
Common Number Systems: Digital technology utilizes various number systems to represent digits, specifically:
Decimal system.
Binary system.
Octal system.
Hexadecimal system.
Numeral Systems Architecture
Definition: Numeral or numbering systems provide a mechanism for representing numbers through a finite set of distinct graphic symbols or signs.
Interchangeability: The same numerical value can be represented differently across various systems. For example, the decimal value is equivalent to in the octal system and in the hexadecimal system.
Major Categories of Number Systems:
Non-positional Number Systems: Historically based on additive approaches using fingers, stones, or sticks. A symbol carries a constant value regardless of its position within a sequence.
Positional Number Systems: Also known as place-value systems, where the placement of a digit relative to other symbols determines its actual weight or weight-value.
Non-Positional Numeral Systems
Roman Numeral System
Symbols and Decimal Values:
=
=
=
=
=
=
=
Operational Rules:
Additive Rule: If two consecutive digits are ordered such that the first is greater than or equal to the second, their values are added (e.g., ; ; note: transcript says as typo for ).
Subtractive Rule: If digits are in increasing order of value, the smaller value is subtracted from the larger (e.g., ; ; ).
Greek Numeral System
Symbols and Decimal Values:
=
=
=
=
=
=
Methodology: Grouping is often centered around fives. Powers of 10 are represented by the first letter of the corresponding Greek word.
Examples:
Positional Numeral Systems and Base (Radix)
Nature of Weighted Values: The value of a digit is its intrinsic value multiplied by a weight determined by its position.
Example using digit '5': In 135, it represents . In 153, it represents . In 531, it represents .
Definition of Base or Radix: The base (or radix) indicates the total number of distinct symbols used in that system.
Decimal: Base 10 (Symbols: ).
Binary: Base 2 (Symbols: ).
Octal: Base 8 (Symbols: ).
Hexadecimal: Base 16 (Symbols: ).
Mathematical Representation of Positional Values:
For a number like :
.
Fixed-Radix vs. Mixed-Radix: Digital systems typically stick to fixed-radix systems where the base is constant for all positions.
Digital Number Systems Characteristics
Decimal Number System (Base-10)
Evolution: Likely derived from humans having 10 fingers.
Nomenclature:
Most Significant Digit (MSD): The leftmost digit carrying the most weight.
Least Significant Digit (LSD): The rightmost digit carrying the least weight.
Example: is decomposed as .
Binary Number System (Base-2)
Implementation: Hard to design circuits with 10 voltage levels; very easy to design circuits with two (ON/OFF, high/low voltage).
Terms:
Bit: Abbreviation for Binary Digit.
Most Significant Bit (MSB): Leftmost bit.
Least Significant Bit (LSB): Rightmost bit.
Positional Weights: Powers of 2 (e.g., for integers; etc. for fractions).
Counting Pattern:
Units bit (LSB) alternates every count ().
Second bit () alternates every 2 counts ().
Third bit () alternates every 4 counts.
General rule: Alternates in groups of .
Octal Number System (Base-8)
Weights: Based on powers of 8.
Example: converted to decimal is .
Hexadecimal Number System (Base-16)
Symbols: and letters .
, , , , , .
Utility: Serves as a shorthand for representing large binary strings; every hex digit represents exactly 4 binary bits.
Number System Conversions
Decimal-to-Binary
Method 1: Powers of 2 Table: Subtract the largest possible power of 2 from the decimal number, record the bit, and repeat with the remainder.
Example: , remainder , remainder , remainder . Result: .
Method 2: Repeated Division: Successively divide the integer by 2; remainders recorded from bottom to top form the binary string.
Decimal Fractions to Binary: Successively multiply the fractional part by 2. Collect integers to the left of the decimal point from top to bottom.
Example: , , . Result: .
Binary-to-Decimal
Method 1: Positional Weights: Sum the values of for every bit position containing a 1.
Method 2: Dibble-Dobble Method: Start with the leftmost bit, multiply by 2, add the next bit, and repeat until the binary point is reached.
Decimal-to-Octal / Hex
Integer: Use repeated division by the target radix (8 or 16).
Fractions: Use repeated multiplication by the target radix (8 or 16).
Octal/Hex Conversions
Octal to Binary: Replace each octal digit with its 3-bit binary equivalent ().
Binary to Octal: Group binary bits in threes starting from the binary point. Add leading or trailing zeros to complete groups.
Hex to Binary: Replace each hex digit with its 4-bit binary equivalent ().
Binary to Hex: Group binary bits in fours starting from the binary point.
Binary Representation of Integers
Storage standard: Integers are stored using a fixed number of bits (8, 16, 32, or 64).
Unsigned Integers: Represent 0 and positive values. Range for bits is to .
8-bit range: to .
16-bit range: to .
Signed Integers: Represent negative, zero, and positive values. Three main schemes:
Sign-Magnitude Representation
MSB: Used as sign bit ( for positive, for negative).
Magnitude: The remaining bits represent the absolute value.
Drawbacks:
Two representations of zero ( as and as ).
Difficulty in processing arithmetic; positive and negative logic must be handled separately.
One's Complement Representation
Method: Positive numbers are standard binary. Negative numbers are found by inverting all bits of the positive equivalent ().
Drawbacks: Still contains two versions of zero ( and ).
Two's Complement Representation
Method: Add 1 to the 1's complement of the number.
Alternative Method: Copy bits from right to left up to and including the first 1; then invert all remaining bits.
Advantages:
Only one unique representation for zero (\dots).
Addition and subtraction use the same unified logic circuitry.
Storage: Modern computers use 2's complement for signed integers.
Floating-Point Representation (Real Numbers)
Fixed-Point Representation
Real numbers are split by a fixed number of bits for the integer part and the fractional part.
Example: A 32-bit system might use 24 bits for the integer and 8 for the fraction.
Limitation: Cannot represent very large or very small numbers efficiently.
Scientific (Exponential) Notation
Form: ( = Mantissa/Fraction, = Radix, = Exponent).
Normalization: A number is normalized when there is exactly one non-zero digit before the radix point. In binary, this digit is always 1.
IEEE 754 Standard
Single Precision (32-bit):
1 sign bit.
8 exponent bits.
23 mantissa bits.
Double Precision (64-bit):
1 sign bit.
11 exponent bits.
52 mantissa bits.
Implicit Leading Bit: In the normalized mantissa, the leading '1' before the binary point is not stored to save space.
Excess/Biased Notation: Computers store exponents in biased form (e.g., Excess-127 for single precision) to allow easy sorting of floating-point numbers.
Trade-off: Increasing bits for the mantissa improves precision (accuracy), while increasing bits for the exponent increases the range of numbers.
Binary Arithmetic Operations
Binary Addition Rules
( with carry )
( with carry )
Binary Subtraction Rules
( with a borrow of )
Multiplication and Division
Multiplication: Rules follow standard logic: , , . Partial products are shifted and added.
Division: Follows same long-division format as decimal: , .
Complement Arithmetic
1's Complement Addition: If a carry is generated out of the sign bit, it must be added to the LSB (End-Around Carry).
2's Complement Addition: Standard addition including the sign bit. Any final carry generated out of the sign bit position is ignored.
Overflow Detection: In 2's complement, an overflow occurs if adding two numbers of the same sign produces a result with the opposite sign.
Alphanumeric Codes and Character Representation
ASCII
Full Name: American Standard Code for Information Interchange.
Detail: 7-bit code providing code groups. Used for standard keyboard characters and control functions like and .
EBCDIC
Full Name: Extended Binary Coded Decimal Interchange Code.
Detail: 8-bit code (256 symbols). Primarily used in IBM mainframe systems.
ISCII
Full Name: Indian Standard Code for Information Interchange.
Detail: Adopted in 1991 by the Bureau of Indian Standards. 8-bit code ( characters) that retains ASCII and adds support for Devanagari, Bengali, Gujarati, Gurmukhi, Oriya, Telugu, Kannada, Malayalam, and Tamil.
Similar script structure allows for easy transliteration between Indian languages.
Unicode
Purpose: A universal standard providing a unique number for every character regardless of platform, program, or language.
Capacity:
Version 3.0: Represented characters.
Version 3.1: Represented characters.
Architecture: Usually 16-bit, representing up to characters in its basic plane. Based on ISCII-1988 for the Indian language block.
Questions & Discussion
Q: Convert to binary using repeated division.
A: R (LSB); R ; R ; R ; R ; R (MSB). Result: .
Q: Decode ASCII hex values 48, 45, 4C, 50.
A: Using Table 1.10: , , , . The word is "HELP".
Q: What is the benefit of Excess-notation?
A: It maintains the sorted order of bit patterns for both positive and negative numbers, which assists in computational sorting processes.
Q: Determine the 8-bit sign-magnitude for .
A: Binary is . For an 8-bit sign-magnitude, MSB is (for negative) followed by zeros for padding and the magnitude: .