From e3ee67bfda0e8f4aa91992a196adb283f812475e Mon Sep 17 00:00:00 2001 From: David Phillips Date: Thu, 28 Dec 2017 14:09:34 +1300 Subject: Strip out wire+node concepts, rely only on gates --- gate.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 gate.h (limited to 'gate.h') 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 + +#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 -- cgit v1.1