Homework 3 - decimal value), and also show the state (1 or...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
ELEC 2220 Homework #3 Due Friday, May 28 2’s Complement Arithmetic and “Flags” Given the following decimal numbers: A = 105 B = 57 C = -95 D = -76 Using 8-bit two’s complement arithmetic, perform the following six calculations as they would be done on an 8-bit microprocessor. Recall that subtraction is performed by negating the second operand and adding, i.e. all operations are performed with an adder circuit. 1. A+B 2. A-B 3. A+C 4. A-C 5. C+D 6. C-D For each calculation, show the 8-bit result (and check that it corresponds to the correct
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: decimal value), and also show the state (1 or 0) of each of the following condition codes: Z = result zero N = result negative C = carry out of the most significant bit V = signed overflow For example: 5 -10 = 00000101 00001010 = 00000101 + 11110110 = 11111011 = - 00000101 = -5 N = 1 (result negative) Z = 0 (result not zero) C = 1 (carry out of MSB of adder) V = 0 (no signed overflow)...
View Full Document

Ask a homework question - tutors are online