Computer_Architecture_Fully_Explained_Answers
Computer_Architecture_Fully_Explained_Answers
1. Binary (Base-2): Uses only two digits: 0 and 1. This system is used internally by
computers because all digital logic is based on binary signals. Each binary digit (bit)
represents a power of 2. For example, the binary number 1011 means (1×2³ + 0×2² + 1×2¹
+ 1×2⁰) = 11 in decimal.
2. Octal (Base-8): Uses digits from 0 to 7. It's used as a shorthand for binary, where each
octal digit corresponds to a group of 3 binary digits. Example: Binary 101101 = Octal 55
(Group: 101 101).
3. Decimal (Base-10): This is the standard system humans use, consisting of digits from 0 to
9. Each digit represents a power of 10.
4. Hexadecimal (Base-16): Uses 0–9 and A–F (A=10 to F=15). It is compact and useful for
representing large binary values. Example: Binary 11001101 = Hex CD (Group: 1100 = C,
1101 = D).
These systems allow us to easily convert and interpret data between machine and human-
readable forms.
2’s Complement:
This is the most common method for representing negative numbers in computers. It is
obtained by adding 1 to the 1’s complement of a binary number.
Example: 5 in binary = 0101 → 1’s complement = 1010 → add 1 = 1011. So –5 in 4-bit 2’s
complement = 1011.
10’s Complement:
Equal to the 9’s complement + 1. Used for subtraction like 2’s comp in binary.
Example: 123 → 9’s comp = 876 → +1 = 877 → 10’s complement = 877.
These are used in decimal subtraction, especially in digital calculators and old computing
systems.
5. What are r’s and (r–1)’s complements? Demonstrate with a base-8 example.
In any base-r number system:
(r–1)’s complement is obtained by subtracting each digit from r–1.
r’s complement = (r–1)’s complement + 1
These complements are useful in performing arithmetic without using subtraction circuits.
Addition:
1. If the signs are the same, add the magnitudes and keep the sign.
2. If signs are different, subtract the smaller magnitude from the larger and use the sign of
the larger number.
Subtraction:
1. Change the sign of the subtrahend.
2. Follow the rules of addition above.
Example: 5 + (–3)
5 = 0101, –3 = 2’s comp of 0011 = 1101 → 0101 + 1101 = 10010 → result = 0010 (discard
carry) = 2.
2. How does subtraction work using 2’s complement representation? Give an
example.
In 2’s complement, subtraction is simplified by adding the negative value of the subtrahend.
Steps:
1. Take 2’s complement of subtrahend.
2. Add it to the minuend.
3. If carry occurs, discard it.
Each instruction typically includes an operation code and operand(s), allowing the control
unit to decode and execute it.
1. SISD (Single Instruction, Single Data): Traditional single-core processors that execute one
instruction on one data item at a time.
2. SIMD (Single Instruction, Multiple Data): Applies one instruction to many data points
simultaneously (e.g., GPUs).
3. MISD (Multiple Instruction, Single Data): Rare architecture where multiple instructions
operate on the same data.
4. MIMD (Multiple Instruction, Multiple Data): Used in multicore and multiprocessor
systems where different processors execute different instructions on different data.
Types:
1. Input Devices – send data to the system. Examples: Keyboard, Mouse
2. Output Devices – receive data from the system. Examples: Monitor, Printer
3. Input/Output Devices – do both. Example: Touchscreen