; homework 13 
; using de morgans law 
; no XOR instruction in lc3 assemble lang only AND and NOT 
; A XOR B = (A NAND (A NAND B)) NAND (B NAND (A NAND B))
; A NAND B = NOT(A AND B) = #R3

AND   R3,R1,R2     
NOT   R3,R3

AND   R1,,R1,R3     
NOT   R1,R1

AND   R2,R2,R3     
NOT   R2,R2

AND   R0,R1,R2     
NOT   R0,R0

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: