summaryrefslogtreecommitdiff
path: root/Gate.cpp
diff options
context:
space:
mode:
authorDaniel Jones <admin@danieljon.es>2020-06-23 21:52:36 +0930
committerDaniel Jones <admin@danieljon.es>2020-06-23 21:52:36 +0930
commitf6db0a081d2d359ba18d97fd5588b11cedbf6911 (patch)
treefd2886035d44b724fc15737bbbd54d98899ae840 /Gate.cpp
parent10da4b7eaa8bc739bd7e0846f2cec7b5a466cec3 (diff)
downloadfoxlogicgates-f6db0a081d2d359ba18d97fd5588b11cedbf6911.tar.gz
foxlogicgates-f6db0a081d2d359ba18d97fd5588b11cedbf6911.zip
finished implementing all logic gates
Diffstat (limited to 'Gate.cpp')
-rw-r--r--Gate.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Gate.cpp b/Gate.cpp
index d5779c8..4a789c3 100644
--- a/Gate.cpp
+++ b/Gate.cpp
@@ -85,7 +85,7 @@ void Gate::update_state()
case NAND:
{
if (!input_gate1 || !input_gate2) {this->output_state = false; return; }
- output_state = ~(input_gate1->get_output_state() & input_gate2->get_output_state());
+ output_state = !(input_gate1->get_output_state() & input_gate2->get_output_state());
break;
}
@@ -93,7 +93,7 @@ void Gate::update_state()
case NOR:
{
if (!input_gate1 || !input_gate2) {this->output_state = false; return; }
- output_state = ~(input_gate1->get_output_state() | input_gate2->get_output_state());
+ output_state = !(input_gate1->get_output_state() | input_gate2->get_output_state());
break;
}
@@ -109,7 +109,7 @@ void Gate::update_state()
case XNOR:
{
if (!input_gate1 || !input_gate2) {this->output_state = false; return; }
- output_state = ~(input_gate1->get_output_state() ^ input_gate2->get_output_state());
+ output_state = !(input_gate1->get_output_state() ^ input_gate2->get_output_state());
break;
}