Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Choose the correct answer 1) If variable A=0xAB & variable B=B1100 1101, and you

ID: 3720660 • Letter: C

Question

Choose the correct answer

1) If variable A=0xAB & variable B=B1100 1101, and you execute the instruction A=A+B, what's the contents of variables A, B after the execution:

a) CD, AB b) AB, CD c) 178, 00 d) 178, CD e) 78, CD

2) In the instruction above, if we test for the result to be either Negative or Zero (N, Z), after execution what would be the values of the conditions N, Z where 1 means true and 0 means false:

a) 0,0 b) 0,1 c) 0,0 d) 1,0 e) 1,1

3) If variable A=B 1100 1101 & Variable B=0253, and you execute the instruction A=A-B, what's the contents of A, B after the execution:

a) 65, AB b) 22, 00 c) 44, CD d) 22, AB e) CD, AB

4) If variable A=0x05 & register B=0x10, and you compare the variables with the instruction (a>=b), what's the contents of A, B after the comparison:

a) 05, 10 b) 15, 05 c) F1, 00 d) F1, 10 e) 15, 00

5) In the instruction above, what's the value of the N, Z conditions after the execution:

a) 0,0 b) 1,0 c) 0,1 d) 1,1 e) 0,0

6) If A = 0xAB, and you execute a shift right instruction A=A>, what is the contents of A after the execution.

a) 55 b) 56 c) 56 d) 0xD5 e) 55,1

Explanation / Answer

1)

A = 0xAB B = B1100 1101 = 0xCD in hex

A = A+B

= 0xAB + 0xCD

A = 0x178

B will remain same i.e. B = 0xCD

So, correct option is d

2)

As the number is positive and non-zero, therefore N = 0 and Z =0.

Therefore, correct option is a)

3)

A = B 1100 1101 this is binary number as start symbol is B

= CD in hex

B = 0253 this is octal number as start symbol is 0

= AB in hex

A = A - B

= 0xCD - 0xAB

= 22 in hex(0x22)

B will remain same i.e. B = 0xAB

So, correct option is d)

4)

A = 0x05

B = 0x10

We compare variables with instruction (a>=b)

Contents of A,B will remain same i.e. A = 0x05 and B = 0x10 as comparison instruction doesnot change source or destination.

Therefore, correct option is a)