- 306

- 6

**1. Homework Statement**

Write a sequence of LC-3 instructions (in bits) to set R0 equal to R1 XOR R2. Assume that values have already been placed into R1 and R2 for you. You may not change the values of any other registers (only R0, R1, and R2). Include RTL or assembly comments explaining the action of each binary instruction.

*Hints: You MAY change R1 and R2. You should only need eight instructions.*

**2. Homework Equations**

LC3

**3. The Attempt at a Solution**

I came up with X XOR Y = [(xy')' & (x'y)']'

using demorgans, but I can't figure out a way to XOR R1 and R2 using only the 3 registers. R1 and R2 should hold the values to be XOR'd and R0 should store the result. How do I do this?