COA Unit-2 Notes (P2)
COA Unit-2 Notes (P2)
ASANSOL
Pre Test:
UNIT-2 (Part-2)
Computer Arithmetic:
Computer arithmetic focuses on the operations of addition, subtraction, multiplication, division, and floating-point
arithmetic, performed by computers using binary numbers.
1. 0+0=0
2. 0+1=1
3. 1+0=1
4. 1 + 1 = 10 (which means 0 with a carry of 1)
Binary Subtraction
Subtraction in binary works using similar rules, but borrowing is required when subtracting a larger bit from a smaller one.
Rules for Binary Subtraction:
1. 0-0=0
2. 1-0=1
3. 1-1=0
4. 0 - 1 = 1 (with a borrow of 1 from the next higher bit)
1. Find the two’s complement of the number to be subtracted (invert all bits and add 1).
2. Add the two’s complement to the first number.
Example:
Since the most significant bit is 1, it indicates a negative result. Therefore, the result in two's complement is -2.
These errors arise because floating-point numbers have limited precision due to the fixed number of bits used to represent
them.
IMPORTANT QUESTIONS
Answer: a) 11000
Answer: d) 0111
3. Which of the following methods is used for binary subtraction of signed numbers?
a) One’s complement
b) Two’s complement
c) Half-adder
d) Full-adder
6. In binary multiplication, if you multiply 1010 (10 in decimal) by 0110 (6 in decimal), what is the result?
a) 00111100
b) 00111000
c) 01101000
d) 01110000
Answer: b) 00111000
10) In binary division, if you divide 1110 (14 in decimal) by 0011 (3 in decimal), what is the quotient?
a) 0010 (2 in decimal)
b) 0100 (4 in decimal)
c) 0110 (6 in decimal)
d) 1110 (14 in decimal)
11. Which of the following is an advantage of the non-restoring division algorithm over the restoring division
algorithm?
a) It avoids overflow errors.
b) It is faster and requires fewer steps.
c) It is easier to implement.
d) It works only with signed numbers.
12. What is the main difference between restoring and non-restoring division algorithms?
a) Non-restoring does not restore the dividend after a negative result.
b) Restoring requires an additional register.
c) Non-restoring algorithm works only for signed numbers.
d) Restoring algorithm is used only in floating-point division.
Answer: a) Non-restoring does not restore the dividend after a negative result.
13. Floating-point numbers in computers are typically represented using which standard?
a) ASCII
b) IEEE 754
c) Unicode
d) Gray code
15. In IEEE 754 floating-point standard, which part determines whether the number is positive or negative?
a) Exponent
b) Mantissa
c) Sign bit
d) Bias
17. Which of the following is a valid representation of a floating-point number in IEEE 754 format?
a) -1.101 × 2^3
b) 1.0101 × 10^5
c) 10011 × 2^-4
d) 10.11 × 2^2
18. In floating-point addition, what must be done first before adding two numbers?
a) Align the mantissas
b) Align the exponents
c) Adjust the sign bit
d) Normalize the result