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
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 =
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...
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).
1a) 0xCAFE can be written in decimal (base 10) as: 1b) The decimal number -94 can...
1a) 0xCAFE can be written in decimal (base 10) as: 1b) The decimal number -94 can be expressed (in 8 bits) Using signed magnitude representation as: Using one's complement representation as: Using two's complement representation as: Using excess-M representation (with the appropriate value of M) as: 1c) Using the simple floating point model (1-bit sign, 5-bit biased exponent, and 8-bit significand), the number -0.125 (decimal) can be expressed as: (Do not use spaces or any English text. Provide only the...
Design a combinational circuit that forms the 2-bit binary sum S1S0 of two 2-bit numbers X1X0...
Design a combinational circuit that forms the 2-bit binary sum S1S0 of two 2-bit numbers X1X0 and Y1Y0 and can produce a carry output C. Design the entire circuit with the help of three half adder circuit implementing each of the three outputs with XOR-AND and OR gates.
Assuming nine-bit 2’s complement representation, convert the decimal number -137 to binary, show the effect of...
Assuming nine-bit 2’s complement representation, convert the decimal number -137 to binary, show the effect of the ROL operation on it with initial carry C=1, show the status bits and then convert the result back to decimal. Repeat with the ASR operation. Write the RTL specification of both operations shown here.
Adder Start out by picking 2 positive six bit binary numbers that are less than 3210,...
Adder Start out by picking 2 positive six bit binary numbers that are less than 3210, written in 2's complement notation. The eventual goal is to add these two numbers. 1) Look at the LSB bit of the numbers, and using logic gates (NANDs, NORs, etc.) design a circuit that correctly gives the right output for any possible combination of bits in the LSB place. 2) Now look at the next column to the left (next to LSB). In this...
6)Two integers A and B are stored in two’s complement format. Show how B is subtracted...
6)Two integers A and B are stored in two’s complement format. Show how B is subtracted from A. (-23) - (+13) =(-36). Hint: Let A = (-23) and B = (+13) and show how to do (A – B) in two’s complement format. Use 8-bits torepresent each number in binary.Verify that your final answer in binary is equal to -36 in decimal. Show your work?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT