-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f743ca6
commit 6799bd4
Showing
12 changed files
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "Nor.hpp" | ||
|
||
namespace nts { | ||
void Nor::simulate(std::size_t tick) { | ||
for (auto &pin : _pins) | ||
pin.second.updatePin(tick); | ||
|
||
if (_pins[1].getState() == Tristate::True || _pins[2].getState() == Tristate::True) { | ||
_pins[3].setState(Tristate::False); | ||
return; | ||
} else if (_pins[1].getState() == Tristate::Undefined || _pins[2].getState() == Tristate::Undefined) { | ||
_pins[3].setState(Tristate::Undefined); | ||
return; | ||
} else { | ||
_pins[3].setState(Tristate::True); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#include "../../AComponent.hpp" | ||
|
||
namespace nts { | ||
class Nor : public AComponent { | ||
public: | ||
Nor() : AComponent(3, nts::ComponentType::COMPONENT) {}; | ||
void simulate(std::size_t tick); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
#include "4001.hpp" | ||
|
||
namespace nts { | ||
void C4001::simulate(std::size_t tick) { | ||
for (auto &pin : _pins) | ||
pin.second.updatePin(tick); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
#pragma once | ||
|
||
#include "../../AComponent.hpp" | ||
|
||
namespace nts { | ||
class C4001 : public AComponent { | ||
public: | ||
C4001() : AComponent(14) {}; | ||
void simulate(std::size_t tick); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters