diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-16 09:34:19 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-06-16 09:34:19 +0200 |
commit | bb9a753477870961d776143bd37fb28b8c09c4c9 (patch) | |
tree | 205aa00eedcc7f548ff90d665049862606bc0b06 | |
parent | 3cf454ef959b36f90803fb63fcb2fe26b85335a0 (diff) |
WIP debugging
-rw-r--r-- | GateAnd.h | 4 | ||||
-rw-r--r-- | GateNand.cpp | 2 | ||||
-rw-r--r-- | GateNand.h | 8 | ||||
-rw-r--r-- | circuits/nand-test.txt | 22 |
4 files changed, 30 insertions, 6 deletions
@@ -3,6 +3,8 @@ #include "Node.h" class GateAnd : public Node { + using Node::Node; + public: GateAnd() = default; ~GateAnd() = default; @@ -11,8 +13,6 @@ public: protected: SignalLevel level(); - using Node::Node; - private: GateAnd(const GateAnd * prototype); constexpr static const char * type = "and"; diff --git a/GateNand.cpp b/GateNand.cpp index 8ecb90f..5e43618 100644 --- a/GateNand.cpp +++ b/GateNand.cpp @@ -2,7 +2,7 @@ GateNand GateNand::instance(GateNand::type); -// GateNand::GateNand(const char * type) : GateAnd(type) { } +GateNand::GateNand(const char * type) : GateAnd(type) { } SignalLevel GateNand::level() { SignalLevel lvl = GateAnd::level(); @@ -4,11 +4,13 @@ #include "GateAnd.h" class GateNand : public GateAnd { -private: + using GateAnd::GateAnd; + +protected: SignalLevel level(); - // GateNand(const char * type); - using GateAnd::GateAnd; +private: + GateNand(const char * type); constexpr static const char * type = "nand"; static GateNand instance; }; diff --git a/circuits/nand-test.txt b/circuits/nand-test.txt new file mode 100644 index 0000000..03b29a6 --- /dev/null +++ b/circuits/nand-test.txt @@ -0,0 +1,22 @@ +# nand gate truth table +# vim:ft=cfg +LO: INPUT_LOW; +HI: INPUT_HIGH; + +LO_LO: PROBE; +LO_HI: PROBE; +HI_LO: PROBE; +HI_HI: PROBE; + +GATE1: NAND; +GATE2: NAND; +GATE3: NAND; +GATE4: NAND; + +LO: GATE1,GATE1,GATE2,GATE3; +HI: GATE2,GATE3,GATE4,GATE4; + +GATE1: LO_LO; +GATE2: LO_HI; +GATE3: HI_LO; +GATE4: HI_HI; |