Chapter 2 csc429 actual [Compatibility Mode] (1) (1)
CSC429: Computer Organization & Architecture
Chapter 2: Number System
Prepared by: Assoc. Prof. Ts. Dr. Norhaslinda Kamaruddin, UiTM Shah Alam
Overview
Introduction to number systems.
Key topics:
Numeric conversion between number bases
Performing arithmetic operations in different number bases
Alphanumeric representation
Binary Coded Decimal representation
Unsigned numbers
Representation for signed numbers
IEEE floating point representation
Why Not Base 10?
Base 10 Number Representation
Base 10 is cumbersome for electronic implementation:
Hard to store and transmit.
ENIAC (the first electronic computer) needed 10 vacuum tubes per digit.
Difficult to implement logical functions due to the complexity of carries.
Significant issues with floating point representation:
Cannot precisely represent values like $1.20 due to precision limits.
Example in scientific notation: 1.5213 X 10^4.
Binary Representation
Base 2 Number Representation
Converting numbers to binary:
15213 in decimal to binary: 111011011011012.
1.20 in decimal to binary: 1.0011001100110011...2.
Scientific notation: 1.5213 x 10^4 to binary: 1.11011011011012 x 213.
Advantages of binary representation:
Easy storage with bi-stable elements.
Reliable transmission over noisy wires.
Bit, Byte, and Word
Definitions
Bit: Smallest data unit, can be 0 or 1.
Byte: Group of 8 bits, can store values 0-255 (256 combinations).
Word: Size of data processor can handle at a time (common sizes: 8, 16, 32, 64 bits).
Illustrated representations of bit, byte, and word.
Number Bases Overview
Place Value | Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|---|
100 | 10,000 | 0 | 00 | 0 |
10 | 1,000 | 1 | 1 | 1 |
1 | 100 | 10 | 2 | 2 |
- | ... | ... | ... | ... |
Conversion Examples
Conversion charts and examples for different bases with emphasis on single and multi-digit conversions.
Numeric Conversion
Base 10 to Base 2
Methods for converting decimal to binary, including table and division methods. Examples:
10510 to binary: 1101001.
8710 to binary: 1010111.
Checking Conversions
Established rules to verify conversions based on digit patterns and counts.
Signed and Unsigned Numbers
Representation
Unsigned Numbers: Only positive values.
Examples:
0 to 255 for 8-bit, 0 to 65535 for 16-bit.
Signed Numbers: Represent both positive and negative values.
Methods:
Sign-and-magnitude
1's complement
2's complement
Examples
Converted examples and their binary representations of signed and unsigned integers.
1's Complement
Inversion technique for negative binary representation but has practical issues.
2's Complement
Conversion Technique
Binary representation of the absolute value.
Invert the bits (1's complement).
Add 1 to the inverted binary number.
Common practical methods include arithmetic operations, especially for binary subtraction.
IEEE Floating Point Representation
Overview
Issues with integer representation lead to the floating point solution for fractions.
Adheres to the IEEE 754 standard:
IEEE short real: 32 bits (single precision)
64 bits (double precision)
Conversion Steps
Conversion of decimal to IEEE format explained step-wise, including:
Binary conversion
Format conversion into mantissa and exponent with bias.
Examples provided for conversions to proper IEEE format.
Summary
Comprehensive coverage of number systems relevant to computer organization and architecture with specific focus on binary representation, numeric conversions, and the techniques employed for signed and unsigned numbers.