# Number System

Introduction to Number Systems:

• Number systems are formal methods of expressing and representing numerical values.
• In computer arithmetic, understanding different number systems is essential for data representation and manipulation.

Common Number Systems:

1. Binary Number System (Base-2):

• Comprised of two digits, 0 and 1.
• Widely used in computers due to the use of electronic on/off states.
• Each digit represents a power of 2 (e.g., 2^0, 2^1, 2^2, ...).
2. Decimal Number System (Base-10):

• The system used in everyday life.
• Consists of ten digits, 0 to 9, where each digit represents a power of 10 (e.g., 10^0, 10^1, 10^2, ...).

• Utilizes sixteen digits, 0-9 and A-F.
• Convenient for representing binary data in a more compact and readable form.
• Each digit represents a power of 16 (e.g., 16^0, 16^1, 16^2, ...).

Binary to Decimal Conversion:

• To convert a binary number to decimal, multiply each digit by the corresponding power of 2 and sum the results.

Decimal to Binary Conversion:

• To convert a decimal number to binary, repeatedly divide the number by 2, keeping track of the remainders.

• Convert each hexadecimal digit into its corresponding 4-bit binary representation.

Binary Coded Decimal (BCD):

• A way to represent decimal numbers in binary form.
• Each decimal digit is represented by a 4-bit binary code.

Octal Number System (Base-8):

• Uses eight digits, 0-7.
• Rarely used in modern computing but was more common in the past.

Positional Notation:

• In any number system, the value of a digit depends on its position in the number.

• In non-integer numbers, a radix point separates the whole part from the fractional part.

Sign and Magnitude:

• A method of representing signed numbers in which the leftmost bit represents the sign (0 for positive, 1 for negative).

Two's Complement:

• A common method for representing signed numbers in binary.
• Negative numbers are obtained by taking the two's complement of the absolute value of the number.

IEEE 754 Floating-Point Standard:

• A widely used standard for representing real numbers in binary.
• Consists of three parts: sign bit, exponent, and mantissa (fraction).

Conclusion: Understanding different number systems is crucial for computer arithmetic and data representation. Binary, decimal, and hexadecimal systems are commonly used in computing, and conversions between them are essential. Knowledge of signed number representations and the IEEE 754 standard for floating-point numbers is important for accurate numerical computations in computer science and engineering.