Question: 1. Explain using an example (use 4-bit 1010) how a 2s compliment number can be represented in usual positional number representation- except the weight of

1. Explain using an example (use 4-bit 1010) how a 2s compliment number can be represented in usual positional number representation- except the weight of the MSB will be negative.

2. Indicate how the following +ve numbers will be represented in (a) Twos compliment (b) twos complement (c) BCD (d) Twos compliment and (e) Excess-7 representations? [or state not possible]

0 , 1, 6, 8

3. Indicate how the following ve numbers will be represented in (a) Twos compliment (b) twos complement and (c) Excess-7 representations? [or state not possible]

-1, -5, - 8, -9

4. Discuss how an overflow can be detected in twos complement systems.

Is there any relationship between overflow, and carry-in to MSB and carry-out from MSB?

5. Assume a compiler represent very small integers (say vsint) as 4-bit (nibble) 2s complement numbers.

a. What is the range of vsint?

Suppose variables W, X, Y, and Z are initialized as follows (type vsint).

vsint W = -1, X = 3, Y = 6, Z = -6

b. How X, Y and Z will be represented?

c. Show how the following operations will be calculated by a 4-bit ALU?

X + X, X + Y, X + Z, W + Z, Z + Z, X Y, Y X, Z X , X Z and W Z

d. Which of the above operations will overflow?

e. Show how X*Y and X*Z will be calculated (assume intermediate calculations will be done in 8-bit register). Write an algorithm to demonstrate this operation.

f. Show how Y/X and Z/X will be calculated.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!