Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

Computer Architecture

The document provides an in-depth explanation of various number systems including decimal, binary, octal, and hexadecimal, along with their applications in computing. It also covers complements such as 1's, 2's, 9's, and 10's complements, as well as fixed and floating-point representations, particularly focusing on the IEEE 754 standard for floating-point representation. This comprehensive overview aims to enhance understanding of numerical representations in digital systems.

Uploaded by

adityaspal2004
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Computer Architecture

The document provides an in-depth explanation of various number systems including decimal, binary, octal, and hexadecimal, along with their applications in computing. It also covers complements such as 1's, 2's, 9's, and 10's complements, as well as fixed and floating-point representations, particularly focusing on the IEEE 754 standard for floating-point representation. This comprehensive overview aims to enhance understanding of numerical representations in digital systems.

Uploaded by

adityaspal2004
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Sure! Let's dive into more detailed explanations for each concept.

1. Number Systems

a) Decimal (Base 10)

The decimal system is the most commonly used number system and is based on ten digits
(0-9). In this system, each position represents a power of 10, which is why we refer to it as
"base 10." For example:

●​ 354=3×102+5×101+4×100354 = 3 \times 10^2 + 5 \times 10^1 + 4 \times 10^0

In computing, decimal is usually converted to binary (base 2) for processing by machines.

b) Binary (Base 2)

The binary system uses only two digits: 0 and 1. It is the foundation of all computing systems
because digital circuits are designed to interpret two states (on or off, true or false).

For example:

●​ 11012=1×23+1×22+0×21+1×20=13101101_2 = 1 \times 2^3 + 1 \times 2^2 + 0 \times


2^1 + 1 \times 2^0 = 13_{10}

Binary Fractions: In binary, fractional values are represented as negative powers of 2:

●​ 0.1012=1×2−1+0×2−2+1×2−3=0.625100.101_2 = 1 \times 2^{-1} + 0 \times 2^{-2} + 1


\times 2^{-3} = 0.625_{10}

c) Octal (Base 8)

The octal system is often used in computing because it is a shorthand for binary. Every three
binary digits (bits) correspond to one octal digit. This makes octal easier to work with than long
strings of binary.

For example:

●​ 3458=3×82+4×81+5×80=3×64+4×8+5=22910345_8 = 3 \times 8^2 + 4 \times 8^1 + 5


\times 8^0 = 3 \times 64 + 4 \times 8 + 5 = 229_{10}

d) Hexadecimal (Base 16)


The hexadecimal system is widely used in programming and digital electronics because it
compactly represents binary numbers. Every four binary digits correspond to one hexadecimal
digit.

●​ Hexadecimal digits range from 0 to 9 and A to F (where A=10, B=11, C=12, D=13, E=14,
F=15).

For example:

●​ 3F716=3×162+15×161+7×160=1023103F7_{16} = 3 \times 16^2 + 15 \times 16^1 + 7


\times 16^0 = 1023_{10}

e) Alphanumeric Representation

Alphanumeric representation involves the encoding of both letters and numbers. A standard
system is ASCII (American Standard Code for Information Interchange), which represents
characters as numeric codes. For example:

●​ A = 65 (decimal) = 01000001 (binary)


●​ a = 97 (decimal) = 01100001 (binary)

Unicode extends ASCII to include a much wider range of characters, including symbols and
characters from different languages.

2. Complements

a) 1’s Complement

To find the 1’s complement of a binary number, you invert each bit. The 1's complement
method was historically used for signed number representation.

For example:

●​ The 1's complement of 0100 (binary for 4) is 1011.

For negative numbers, if a number is positive, its 1’s complement will have all bits inverted.

b) 2’s Complement

The 2’s complement of a number is found by inverting all the bits and then adding 1 to the least
significant bit (LSB). This method is more efficient than 1's complement and is commonly used
in digital computers.

●​ To find the 2's complement of 4 (binary 0100):


1.​ Invert the bits: 1011
2.​ Add 1: 1100 (-4 in 2's complement).

2's complement is particularly useful because it simplifies arithmetic operations like addition and
subtraction.

c) 9’s Complement

The 9’s complement in decimal is created by subtracting each digit from 9.

For example:

●​ The 9's complement of 345 is 654.

d) 10’s Complement

The 10's complement is found by taking the 9's complement and then adding 1.

For example:

●​ The 10's complement of 345 is 655.

e) [r-1]’s Complement (where r is the base)

For a general base rr, the [r-1]’s complement of a number is calculated by subtracting each digit
from r−1r-1.

For example, in base 10 (decimal), the [r-1]’s complement is the 9's complement. In base 8, the
[r-1]’s complement is the 7’s complement.

f) r’s Complement

The r's complement is a generalization of the 2's complement method in base rr. To find the
rr’s complement of a number, subtract it from rnr^n, where nn is the number of digits in the
number.

3. Fixed Point Representation

In fixed-point representation, the position of the decimal point is fixed, and the number of
digits after the decimal point is predetermined.

a) Integer Representation
An integer in fixed-point representation is simply a whole number represented using a fixed
number of bits. In computing, integers can be signed or unsigned. For signed integers, methods
like 2's complement are used to represent negative values.

b) Arithmetic Addition & Subtraction

When adding or subtracting fixed-point numbers, the decimal point must align. If the decimal
points aren't aligned, it can result in incorrect values. Fixed-point arithmetic may lead to overflow
or underflow if the number exceeds the representable range.

c) Overflow

Overflow occurs when a number is too large to fit into the available number of bits. For example,
in an 8-bit signed system, if the result of an addition exceeds 127 (the maximum positive value),
overflow will occur.

d) Decimal Fixed-Point Representation

In decimal fixed-point, the number of decimal places is fixed. For example, in a system where
two decimal places are used, 12.34 is represented as 1234 in fixed-point.

4. Floating Point Representation

Floating-point representation is used to represent very large or very small numbers, or numbers
with fractional components. The representation is similar to scientific notation.

The general form of a floating-point number is:

sign×mantissa×baseexponent\text{sign} \times \text{mantissa} \times


\text{base}^{\text{exponent}}

For example, 123.45123.45 can be written as:

1.2345×1021.2345 \times 10^2

In binary, floating-point numbers are represented as:

(−1)sign bit×1.fraction×2exponent−bias(-1)^{\text{sign bit}} \times 1.\text{fraction} \times


2^{\text{exponent} - \text{bias}}

5. IEEE 754 Floating Point Representation


The IEEE 754 standard specifies how floating-point numbers should be represented in binary. It
defines two main formats: single precision (32 bits) and double precision (64 bits).

a) Single Precision (32 bits)

●​ 1 bit for sign (S)


●​ 8 bits for exponent (E), with a bias of 127
●​ 23 bits for mantissa (M), representing the significant digits

The value is calculated as:

(−1)S×(1+Mantissa)×2(E−127)(-1)^S \times (1 + \text{Mantissa}) \times 2^{(E - 127)}

b) Double Precision (64 bits)

●​ 1 bit for sign (S)


●​ 11 bits for exponent (E), with a bias of 1023
●​ 52 bits for mantissa (M)

The formula for double precision is:

(−1)S×(1+Mantissa)×2(E−1023)(-1)^S \times (1 + \text{Mantissa}) \times 2^{(E - 1023)}

The IEEE 754 standard also defines special values for:

●​ Zero: Represented by all bits set to 0 for both the exponent and mantissa.
●​ Infinity: Represented by an exponent of all 1's and a mantissa of 0.
●​ NaN (Not a Number): Represented by an exponent of all 1's and a non-zero mantissa.

The IEEE 754 format allows for the efficient representation of very large and very small
numbers, and it ensures consistency across different computing platforms.

This detailed explanation should give you a comprehensive understanding of number systems,
complements, fixed and floating-point representations, and IEEE 754. If you need further
clarification on any of these topics, feel free to ask!

You might also like