Computer Architecture
Computer Architecture
1. Number Systems
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:
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:
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:
● 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:
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:
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:
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.
2's complement is particularly useful because it simplifies arithmetic operations like addition and
subtraction.
c) 9’s Complement
For example:
d) 10’s Complement
The 10's complement is found by taking the 9's complement and then adding 1.
For example:
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.
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.
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.
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.
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.
● 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!