Question

A and B are two 8-bit 2’s complement numbers. The result of A & B is...

A and B are two 8-bit 2’s complement numbers. The result of

A & B is 10011000

and the result of

A ^ B is 00100110.

(a) What is the sum

A + B

expressed in 8-bit two’s complement notation (use 1s and 0s, e.g. 10100101)?

Will the carry flag be set?

Will the overflow flag be set?

Homework Answers

Answer #1

Given A&B = 10011000 (A and B) -Eqn 1

and A^B = 00100110 (A XOR B) - Eqn 2

Now, from these 2 equations, we will find the value of A and B, then we will calculate its sum(A+B).

We will proceed bit by bit starting from left to right-

Bit 1 - A&B is 1 means both A and B bit should be 1

Bit 2- A^B is 0 means both A and B bit should be the same(0 or 1), and A&B is 0. So A and B's bit will be 0

Bit 3 - A^B is 1 means both A and B bit is different. A&B is 0. So either of the combinations follows - A-0/1, B-1/0

Bit 4- A&B is 1 means both A and B bit should be 1

Bit 5 - A&B is 1 means both A and B bit should be 1

Bit 6 - A^B is 1 means both A and B bit is different. A&B is 0. So either of the combinations follows - A-0/1, B-1/0

Bit 7 - A^B is 1 means both A and B bit is different. A&B is 0. So either of the combinations follows - A-0/1, B-1/0

Bit 8 - A^B is 0 means both A and B bit should be the same(0 or 1), and A&B is 0. So A and B's bit will be 0

Now, A and B will look like -

A = 1 0 1/0 1 1 1/0 1/0 0

B = 1 0 0/1 1 1 0/1 0/1 0

Here the order of 0/1 should be followed. If A is taken as 1 then B should be 0 and vice versa.

Now, the sum A+B will be as expressed in 2's complement notation -

A+B = 0 1 0 1 0 1 1 0, with a carry of 1

Yes, the carry flag will be set as the addition of the two numbers caused a carry to occur.

Yes, the overflow flag will be set, as addition of 2 signed bit numbers with leftmost bit 1 has caused the answer with leftmost bit to be 0. Leftmost bit 1 indicates negative number, and 0 indicates positive. Overflow means answer is not correct. Here, addition of 2 negative numbers caused overflow and rounded off to a positive number. So the overflow flag will be set.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
A). Convert following decimal integers to 8-bit two's complement binary numbers using any method . Explain...
A). Convert following decimal integers to 8-bit two's complement binary numbers using any method . Explain why, If decimal number cannot be represented with 8 bits. a. -46 b. -63 c. 118 d. -128 e. 128 B). Perform following operations by converting the decimal numbers to 8-bit two’s complement binary. Check results by converting final result to decimal a. 94-53 b. 15–84
Express the decimal number (-37)10 as an 8-bit 2's complement binary number. Given the two signed...
Express the decimal number (-37)10 as an 8-bit 2's complement binary number. Given the two signed binary numbers (2's comp.) X = -8 and Y = 14, what is their sum? What is the BCD representation of the decimal value (9371)10?
Represent the following decimal numbers in binary using 8-bit signed magnitude, one’s complement, and two’s complement:...
Represent the following decimal numbers in binary using 8-bit signed magnitude, one’s complement, and two’s complement: a) 77 b) -42 c) 119 d) -107 E) 60 f) -60 g) 20 h) -20
Ques.3: Consider the addition of n-bit numbers on a machine of width n-bits. Specifically, the two...
Ques.3: Consider the addition of n-bit numbers on a machine of width n-bits. Specifically, the two n-bit 2’s complement numbers A=an-1,an-2,…a1,a0 and B=bn-1,bn-2,…b-1,b0 are added to get the n-bit sum C=cn-1,cn-2,…c1,c0. Provide a Boolean function F (defined in terms of the input variables ai and bi and output variables ci, where 0 <= i < n ) that determines if an overflow has occurred in this addition – the function should be expressed in terms of input variables. F should...
Determine the 2’s complement equivalent of the following numbers in 8-bit format (N.B: You must show...
Determine the 2’s complement equivalent of the following numbers in 8-bit format (N.B: You must show your work for full credit)!   -12 = -9 =
(2marks) Consider the following 12-bit numbers below. Assuming they are unsigned, add them to produce a...
(2marks) Consider the following 12-bit numbers below. Assuming they are unsigned, add them to produce a 12-bit sum the same way a computer would. Also, state whether or not an error results using the same method a computer would. 110010001001 011010001101 Repeat the addition and error detection from the previous question, but this time assuming that the numbers are in two’s complement representation. Also: without converting to decimal, but simply by intuition, i.e. looking at the three numbers and applying...
Design a 4-bit adder-subtractor circuit using the 4-bit binary Full adders (74LS83) and any necessary additional...
Design a 4-bit adder-subtractor circuit using the 4-bit binary Full adders (74LS83) and any necessary additional logic gates. The circuit has a mode input bit, M, that controls its operation. Specifically, when M=0, the circuit becomes a 4-bit adder, and when M=1, the circuit becomes a 4-bit subtractor that performs the operation A plus the 2’s complement of B.Where A and B are two 4-bits binary numbers. That is, * When M=0, we perform A+B, and we assume that both...
Convert (96)10 to binary form in 2's complement representation. Given the two binary numbers X =...
Convert (96)10 to binary form in 2's complement representation. Given the two binary numbers X = 1010011 and Y = 1010010 perform the subtraction X - Y. Enter your result below: Which bit of a signed binary number represents the sign?
The 8-bit signed binary 2's complement number equal to the decimal number -73 is [a].
The 8-bit signed binary 2's complement number equal to the decimal number -73 is [a].
Implement a 2-bit adder using only a 32x3 ROM. The adder adds two 2-bit numbers, {A1...
Implement a 2-bit adder using only a 32x3 ROM. The adder adds two 2-bit numbers, {A1 A0} and {B1 B0}. The adder also has a carry-in (Cin) input. Thus there are 5 inputs: A1 A0, B1 B0, Cin. There are 3 outputs, a 2-bit sum (S1 S0) as well as a carry-out (Cout). Include a diagram of the ROM: label inputs/outputs correctly and show the contents of ROM cells (0's/1's).
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT