summaryrefslogtreecommitdiff
path: root/gate.h
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-12-28 14:09:34 +1300
committerDavid Phillips <david@sighup.nz>2017-12-28 14:09:34 +1300
commite3ee67bfda0e8f4aa91992a196adb283f812475e (patch)
tree9c1f5629c77b7fd5535920d71adc033599d69e57 /gate.h
parente1a691b2b04b383f052d16931f5c34d6bc9d9e22 (diff)
downloadhence-e3ee67bfda0e8f4aa91992a196adb283f812475e.tar.xz
Strip out wire+node concepts, rely only on gates
Diffstat (limited to 'gate.h')
-rw-r--r--gate.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gate.h b/gate.h
new file mode 100644
index 0000000..fcc84bb
--- /dev/null
+++ b/gate.h
@@ -0,0 +1,20 @@
+#ifndef GATE_H
+#define GATE_H
+
+#include <stddef.h>
+
+#include "logic.h"
+
+struct gate {
+ enum BINARY (*operation)(enum BINARY, enum BINARY);
+ enum BINARY output;
+ struct gate *in1;
+ struct gate *in2;
+};
+
+void gate_update_output(struct gate *);
+int gate_add(struct gate *in1, struct gate *in2);
+int tick(void);
+void gate_init(void);
+
+#endif