Computer_Architecture_Detailed_Answers
Computer_Architecture_Detailed_Answers
Binary uses digits 0 and 1, ideal for digital logic. Example: 1010 (binary) = 10 (decimal).
Octal uses digits 0 to 7, groups 3 binary digits. Example: 101010 (binary) = 52 (octal).
Decimal is the human standard system using 0–9. Hexadecimal uses 0–9 and A–F to
represent 16 values, grouping 4 binary digits. Example: 101010 = 2A (hex).
2. 2. How do you convert a decimal number to its binary and hexadecimal equivalents?
To convert to binary, repeatedly divide by 2 and collect remainders. For hex, divide by 16.
Example: 25 → binary: 11001, hex: 19.
3. 3. Define 1’s complement and 2’s complement with appropriate binary examples.
1’s complement: flip all bits. Example: 0101 → 1010. 2’s complement: 1’s complement + 1.
So 1010 + 1 = 1011. Used for negative binary numbers.
9’s complement: subtract each digit from 9. Ex: 123 → 876. 10’s complement: 9’s
complement + 1. Ex: 876 + 1 = 877. Used for subtraction in decimal systems.
5. 5. What are r’s and (r–1)’s complements? Demonstrate with a base-8 example.
In base r: (r–1)’s complement is subtracting digits from r–1. r’s complement = (r–1)’s + 1.
Base-8: number = 453, (r–1)’s complement = 324, r’s = 325.
Unsigned uses plain binary. Signed uses 2’s complement. The binary point is fixed. Ex: 6 =
00000110, –6 in 8-bit = 11111010.
7. 7. What are the common causes and implications of arithmetic overflow in fixed-point
operations?
Overflow happens when result exceeds available bits. E.g., 127 + 1 in 8-bit = –128 (wraps
around), causing incorrect results.
8. 8. Differentiate between fixed-point and floating-point representation with examples.
Fixed-point has limited range and precision, used in embedded systems. Floating-point uses
exponent/mantissa, suitable for very large or small values. Ex: 1.5 = 1.1 x 2^0 in binary.
Uses 32 bits: 1-bit sign, 8-bit exponent (bias 127), 23-bit mantissa. Supports ±0,
denormalized values, infinities, and NaNs.
10. 10. Convert a binary number to its octal and hexadecimal forms with step-by-step
explanation.
Binary: 11010110. Octal: group by 3 → 001 101 011 0 → 1 5 3 0 → 1530. Hex: group by 4 →
1101 0110 = D6.