summaryrefslogtreecommitdiff
path: root/examples/xor.qua
blob: 50eb731285b7eed4973ac3db09c212a4968b6d11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
x   y   speedX  speedY  color
# Re-route inputs
1   0   0       0       GA
0   1   0       0       GA
1   1   0       0       GA
# 2 duplicators create copies of 2 bits
-1  0   0       0       PU
2   0   0       0       PU
# What is done with the bottom copy (NAND)
-1  2   0       0       GA
2   3   0       0       YE
8   2   0       0       GA
8   1   0       0       GA
6   1   0       0       GA
6   11  0       0       GA
8   11  0       0       GA
8   10  0       0       GA
4   10  0       0       GA
# What is done with the top copy    (OR)
-1  -1  0       0       GA
2   -2  0       0       GA
-2  -1  0       0       GA
-3  -2  0       0       GA
-3   5  0       0       !examples/or.qua
# The combining (AND)
3    12 0       0       !examples/and.qua
# A XOR B = (A OR B) AND (A NAND B)
# Inputs: 0, 0
#         1, 0
# Output: 6, 12
# Time:   54