diff options
author | Daniel Jones <admin@danieljon.es> | 2020-06-23 21:52:36 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2020-06-23 21:52:36 +0930 |
commit | f6db0a081d2d359ba18d97fd5588b11cedbf6911 (patch) | |
tree | fd2886035d44b724fc15737bbbd54d98899ae840 /Gate.cpp | |
parent | 10da4b7eaa8bc739bd7e0846f2cec7b5a466cec3 (diff) | |
download | foxlogicgates-f6db0a081d2d359ba18d97fd5588b11cedbf6911.tar.gz foxlogicgates-f6db0a081d2d359ba18d97fd5588b11cedbf6911.zip |
finished implementing all logic gates
Diffstat (limited to 'Gate.cpp')
-rw-r--r-- | Gate.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } |