🎓 BookMCQ
← Back to 5. The 8085 Microprocessor

📝 Arithmetic and Logical Unit (ALU) of 8085 Microprocessor (8 MCQs)

Arithmetic and Logical Functions of the 8085 ALU

The arithmetic and logical unit is the processing section responsible for performing arithmetic and bitwise operations in the 8085. It operates primarily on eight-bit data and works closely with the accumulator, temporary register and internal data paths. Its operations include addition, subtraction, incrementing, decrementing, AND, OR, XOR, complement, comparison and decimal adjustment.

Accumulator, Temporary Register and Flag Connections

The accumulator supplies one operand for many operations, while another operand may come from a general-purpose register, memory or immediate data. The ALU produces a result that is returned to the accumulator or another specified destination. The flag register records conditions such as sign, zero, auxiliary carry, parity and carry.

Execution of Arithmetic and Logical Operations

During an instruction such as ADD B, the processor supplies the accumulator and register B contents to the ALU. The unit performs addition, places the result in the accumulator and updates the applicable flags. For ANA B, it performs a bitwise AND instead, clearing the carry flag and determining the remaining status conditions from the result.

Numerical Example of Addition and Flag Generation

Suppose A contains 35H and B contains 12H. Executing ADD B produces 47H in the accumulator. The result is positive and nonzero, and its binary representation contains an even number of ones, so the Sign and Zero flags are cleared and the Parity flag is set. Carry and auxiliary carry depend on the corresponding bit boundaries.

Comparison, Decimal Adjustment and Bit Manipulation

CMP performs subtraction internally to update flags without retaining the result in the accumulator. DAA adjusts the accumulator after BCD addition, while CMA complements its bits. Rotate instructions move accumulator bits through or around the carry flag. These capabilities allow the ALU to support numerical calculations, comparisons and bit-level processing.

Misconceptions About ALU Results and Status Flags

'The ALU stores every result permanently inside itself' is incorrect because results are transferred to designated registers. 'CMP changes the accumulator contents' is incorrect because it updates flags without storing the subtraction result. 'All five flags are changed by every instruction' overlooks the specific flag effects of individual operations.

ALU Calculations and Flag-Analysis Examination Questions

Practise hexadecimal arithmetic, binary logical operations and two's-complement subtraction. Determine the Sign, Zero, Auxiliary Carry, Parity and Carry flags for suitable results. Distinguish CMP from SUB, identify DAA requirements and trace how register or memory operands enter the ALU. Questions may also ask which flags remain unaffected by particular instructions.

ALU Operations and Processor Status Terms

  • ALU - Performs arithmetic and logical processing.
  • Accumulator - Holds a principal arithmetic operand.
  • DAA - Adjusts an accumulator result for BCD.
  • ANA - Performs bitwise AND processing.
  • CMP - Compares data through subtraction.
  • Parity Flag - Indicates even or odd result parity.
"Timing and Control Unit of 8085 Microprocessor
2
Easy
4
Medium
2
Hard

📝 All Arithmetic and Logical Unit (ALU) of 8085 Microprocessor MCQs

Q1. What is the bit‑width of the accumulator in the SAP‑III microprocessor?

A.8‑bit ✅
B.16‑bit
C.4‑bit
D.32‑bit
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The accumulator stores the result of all arithmetic and logical operations, and in the SAP‑III design it is an 8‑bit register. This means it can represent unsigned values from 0 to 255 or signed two’s‑complement values from –128 to +127. The other options describe widths that belong to different processors or are unrealistic for this microcontroller, so the correct answer is 8‑bit.

Q2. Which flag in the SAP‑III flag register is set when the accumulator holds a negative (two’s‑complement) value?

A.Sign flag (S) ✅
B.Zero flag (Z)
C.Carry flag (CY)
D.Parity flag (P)
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: The Sign flag reflects the most‑significant bit of the accumulator, which is 1 for negative two’s‑complement numbers. When the result is negative the flag is set (S = 1). The Zero flag signals a zero result, the Carry flag deals with overflow or borrow, and the Parity flag indicates even or odd number of 1s, none of which directly indicate negativity.

Q3. Under what condition is the Zero (Z) flag set after an ALU operation?

A.Result equals zero ✅
B.Result is negative
C.A carry out occurs
D.Result has odd parity
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The Zero flag is asserted when the ALU output is exactly 0, meaning every bit of the result is cleared. This is independent of the sign, carry, or parity of the operation. A negative result would affect the Sign flag, a carry out would affect the Carry flag, and odd parity would affect the Parity flag, so only the first choice correctly describes the Zero flag behavior.

Q4. How does the Carry (CY) flag indicate overflow when adding two signed 8‑bit numbers?

A.Set when a carry out of the MSB occurs
B.Set when the sign bits of the operands are the same and differ from the sign of the result ✅
C.Reset when any overflow occurs
D.Set only for unsigned addition
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: For signed addition, overflow happens when two numbers with the same sign produce a result with a different sign. The hardware detects this by comparing the carry into and out of the most‑significant bit; if they differ, the Carry flag is set to indicate signed overflow. A simple carry out does not always mean overflow for signed numbers, and the flag is not limited to unsigned operations, making option B the accurate description.

Q5. A program loads 0x12 into register H and 0x34 into register L, then loads 0x00 into D and 0xFF into E. It executes a 16‑bit addition of the H‑L pair with the D‑E pair. Which register will contain the high‑order byte of the sum after execution?

A.H ✅
B.L
C.D
D.E
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The H‑L pair represents the 16‑bit value 0x1234 and the D‑E pair represents 0x00FF. Adding them yields 0x1333. In a 16‑bit addition the most‑significant byte of the result is stored back into the high register of the first operand, which is H. Therefore H receives 0x13, while L receives 0x33. The other registers hold the low byte or unchanged values, so only option A is correct.

Q6. If the ALU subtracts 0x05 from 0x03 using two’s‑complement subtraction, which flag(s) will be affected and how?

A.Zero flag set, Carry cleared
B.Carry flag set, Sign flag cleared
C.Carry flag cleared, Sign flag set ✅
D.Parity flag set, Zero cleared
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Subtracting 0x05 from 0x03 yields a negative result (0xFE) in two’s‑complement form, so the Sign flag becomes 1. Because a borrow is required, the Carry flag is cleared (0). No zero result occurs, so the Zero flag stays reset, and the parity of 0xFE (seven 1s) is odd, leaving the Parity flag cleared. Thus the combination described in option C matches the actual flag changes.

Q7. When the ALU adds 0x7F and 0x01, what are the states of the S, Z, CY, and P flags after the operation?

A.S=1, Z=0, CY=0, P=0 ✅
B.S=0, Z=0, CY=1, P=1
C.S=1, Z=1, CY=1, P=0
D.S=0, Z=1, CY=0, P=1
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: Adding 0x7F (01111111) and 0x01 (00000001) produces 0x80 (10000000). The most‑significant bit is 1, so the Sign flag is set (S=1). The result is not zero, so Z=0. No carry out of the MSB occurs, leaving CY=0. The result contains a single ‘1’, an odd number, so the Parity flag is reset (P=0). Only option A reflects this exact combination.

Q8. A logic operation XOR is performed on bytes 0xAA and 0x33. After the operation, what is the state of the Parity (P) flag?

A.Set (even number of 1s) ✅
B.Reset (odd number of 1s)
C.Set only if result is zero
D.Reset only if carry occurs
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: XORing 0xAA (10101010) with 0x33 (00110011) yields 0x99 (10011001). Counting the ones in 0x99 gives four, which is an even number. The Parity flag in the SAP‑III is set when the result contains an even number of 1s, regardless of the result’s value. Therefore the flag is set, matching option A; the other choices describe unrelated conditions.

🔗 Related Topics (MCQs)