COMP2120 Computer Organization
Assignment 1
Due date Feb 25, 11:00 PM
Problem 1
Write down the logic expression P = f(A, B, C) corresponding to the following truth table (simplification of logical expression is not required):
Problem 2
Consider a 16-bit 2’s complement representation
(a). What is the largest (most positive) value and the smallest (most negative) value in this representation scheme?
(b). Write down the bit-pattern repre- senting 18, -18, 25, and -25, respectively.
(c). What are the value of above bit pattern if they are treated as unsigned numbers?
(d). Add the bit patterns together for the following:
(1). 18 + 25
(2). 18 +(-25)
(3). (-18)+25
(4). (-18)+ (-25)
Problem 3
Prove that the multiplication of an n-bit binary number A and an m-bit binary number B gives a product A × B of no more than n + m bits.
Problem 4
Verify the validity of the multiplication of integers (2’s complement) procedure in the lecture note. (Give the proof)
Problem 5
Any floating-point representation used in a computer can represent only certain real numbers exactly; all others must be approximated. If A
′
is the stored value approximating the real value A, then the relative error, r, is expressed as
Represent the decimal quantity +0.4 in the following floating-point format: base = 2; exponent: biased, 4 bits; significand, 7 bits. What is the relative error?
Problem 6
Consider a 40-bit floating point representation with a sign bit S, an exponent E (biased, 11 bits), and a significand f (28 bits). The value is
Here E = 11 . . . 1 and 00 . . . 0 don’t have special meanings.
(a). Write down the largest positive number that can be represented.
(b). Write down the smallest positive number other than zero that can be represented.
(c). Write down the bit pattern representing the value 15.3125.
(d). Write down the value represented by the bit pattern c06f800000 (hex).
(e). If we assign 16 bits and 23 bits for exponent E and significand f, respectively. What is the largest positive number that can be represented ? Discuss what is the relation between range and precision in floating point number representation?