NanoTekSpice
DigitalElectronics
C4008.hpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2019
3 ** OOP_NanoTekSpice
4 ** File description:
5 ** C4008 class
6 */
7 
15 #ifndef C4008_HPP_
16  #define C4008_HPP_
17 
18 #include "IComponent.hpp"
19 #include "Component.hpp"
20 #include <iostream>
21 #include <string>
22 #include <map>
23 
29 {
30  public:
36  C4008();
40  ~C4008();
50  nts::Tristate compute(std::size_t pin = 1) override;
60  void setLink(std::size_t pin , nts::IComponent &other, std::size_t otherPin) final;
66  void dump() const noexcept override;
76  void setInput(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final;
86  void setOutput(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final;
87 
88  private:
97  void checkSelfLink(std::size_t pin1, std::size_t pin2);
106  nts::Tristate computeInput(nts::Pin &pin);
116  nts::Tristate computeOutput(nts::Door &door);
127  void computeCarryOut(nts::Tristate intput1, nts::Tristate input2);
134  void computeCarryIn();
135 
136  std::map<size_t, nts::Door> _doors;
137  nts::Pin _carryIn;
138  nts::Pin _carryOut;
139 
140 };
141 
142 #endif /* !C4008_HPP_ */
Definition: IComponent.hpp:45
C4008()
Component 4008 Constructor.
Definition: C4008.cpp:12
Definition: Component.hpp:19
void setLink(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final
Set link method.
Definition: C4008.cpp:172
nts::Tristate compute(std::size_t pin=1) override
Compute.
Definition: C4008.cpp:131
void dump() const noexcept override
Display information.
Definition: C4008.cpp:266
Definition: IComponent.hpp:18
~C4008()
Component 4008 Destructor.
Definition: C4008.cpp:38
void setInput(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final
Set input link method.
Definition: C4008.cpp:217
4-Bit Full Adder With Parallel Carry Out
Definition: C4008.hpp:28
void setOutput(std::size_t pin, nts::IComponent &other, std::size_t otherPin) final
Set output link method.
Definition: C4008.cpp:246
Definition: IComponent.hpp:52