Problem

Assume that registers R1 and R2 in Figure 6-6 hold two unsigned numbers. When select input...

Assume that registers R1 and R2 in Figure 6-6 hold two unsigned numbers. When select input X is equal to 1, the adder–subtractor circuit performs the arithmetic operation “R1 + 2s complement of R2.” This sum and the output carry Cn are transferred into R1 and C when K1 = 1 and a positive edge occurs on the clock.

(a) Show that if C = 1, then the value transferred to R1 is equal to R1R2, but if C = 0, the value transferred to R1 is the 2s complement of R2R1.


(b) Indicate how the value in the C bit can be used to detect a borrow after the subtraction of two unsigned numbers.


(c) How does the behavior of the C bit change if R1 and R2 hold signed 2scomplement numbers?

Figure Implementation of Add and Subtract Microoperations

Step-by-Step Solution

Solution 1

(a)

Initially assume that the carry bit.

Now, perform the action.

Since select input X is 1 therefore

Suppose

To perform the difference in binary number, first find the 2s complement of R2, then add it with R1.

So,

For 2s complement of R2, first find the 1s complement and then add 1.

So,

Therefore,

Now, add “

So,

Finally, store the sum into register and carry bit store into.

Above process shows that if c=1 than then value transferred to R1 is

Equal to .

Assume that the carry bit.

Now, perform the action.

To perform the difference in binary number, first find the 2s complement of R1, then add it into R2.

So,

For 2s complement of R1, first find the 1s complement and then add 1.

So,

Therefore,

Now, add “

So,

Finally, take the 2s complement of result.

So,

To find 2s complement of, first find the 1s complement and then add 1.

So, .

Therefore,

Finally, store the sum into register and carry bit store into .

Above process shows that if c=0 than then value transferred to R1 is

Equal to 2s compliment of .

(b)

The carry bit is used as borrow to subtract the two binary number. It is required to borrow from the most significant bit subtraction.

In unsigned binary subtraction, borrow bit is used to detect the error from file.

If carry bit is 1, is not present. .

If carry bit is 0, it denotes there is. And borrow is 1.

Consider the following example to indicate the carry bit is used to detect the ‘borrow’.

Select two unsigned binary number and store it into two register such as and .

It’s clear that

.

For 2s complement of R2, first find the 1s complement and then add 1.

So,

Therefore,

Now, add “

So,

Finally, most significant bit indicates the carry flag is on.

It is clear from the above example that C bit can be used to detect a borrow after the subtraction of two unsigned numbers.

(c)

Signed bit represent the sign of number. Since the most significant bit in signed number represent the behavior of number, either the number is positive or negative. If the most significant bit is 0, it represents the positive number and if the most significant bit is 1, it means number is negative.

So, according to the definition of signed number carry bit C represent the behavior of number.

Add your Solution
Textbook Solutions and Answers Search