Question:

What is the state of carry, auxiliary carry and parity flags after execution of following instructions: MOV A, #3F
ADD A, #BE

Show Hint

Parity = 1 for even number of 1s, else 0.
Updated On: Jul 2, 2026
  • CY=0, AC=0, P=0
  • CY=1, AC=1, P=0
  • CY=0, AC=1, P=0
  • CY=1, AC=1, P=1
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Concept: Flags in 8051 are affected by arithmetic operations.

Step 1: Convert values to binary \[ 3F = 0011\ 1111 \] \[ BE = 1011\ 1110 \]

Step 2: Perform addition \[ 00111111 + 10111110 = 11111101 \]

Step 3: Carry flag (CY) Since sum exceeds 8 bits → Carry = 1

Step 4: Auxiliary Carry (AC) Carry from lower nibble (4 bits) → AC = 1

Step 5: Parity flag (P) Result = 11111101 → number of 1s = 7 (odd) So parity = 0

Conclusion: \[ \boxed{CY=1,\ AC=1,\ P=0} \]

Final Answer: \[ \boxed{(B)} \]
Was this answer helpful?
0
0