Skip to content

6 implémentation des composants de portes#37

Merged
maelemiel merged 8 commits intomainfrom
6-implémentation-des-composants-de-portes
Mar 9, 2025

Hidden character warning

The head ref may contain hidden characters: "6-impl\u00e9mentation-des-composants-de-portes"
Merged

6 implémentation des composants de portes#37
maelemiel merged 8 commits intomainfrom
6-implémentation-des-composants-de-portes

Conversation

@SamGave07
Copy link
Collaborator

This pull request includes significant changes to the component creation and simulation logic in the codebase. The most important changes include adding new component classes, updating the factory methods, and refactoring the simulation logic for existing components.

New Component Classes:

  • Added NANDComponent and NORComponent classes with their respective header and implementation files. These components include methods for setting links, simulating, and computing their states. (src/elementaryComponents/NANDComponent.hpp, src/elementaryComponents/NANDComponent.cpp, src/elementaryComponents/NORComponent.hpp, src/elementaryComponents/NORComponent.cpp) [1] [2] [3] [4]

Factory Updates:

  • Updated the Factory class to include methods for creating NANDComponent, NORComponent, and several gate components (4001, 4011, 4030, 4069). These methods are now integrated into the createComponent function. (src/Factory.cpp, include/Factory.hpp) [1] [2] [3] [4]

Simulation Logic Refactoring:

  • Refactored the simulate methods of existing components (ANDComponent, ORComponent, XORComponent, NOTComponent) to use a new calculateState method for determining their output states. This change improves code readability and maintainability. (src/elementaryComponents/ANDComponent.cpp, src/elementaryComponents/ANDComponent.hpp, src/elementaryComponents/ORComponent.cpp, src/elementaryComponents/ORComponent.hpp, src/elementaryComponents/XORComponent.cpp, src/elementaryComponents/XORComponent.hpp, src/elementaryComponents/NOTComponent.cpp, src/elementaryComponents/NOTComponent.hpp) [1] [2] [3] [4] [5] [6] [7] [8]

Makefile and Source Inclusion:

  • Updated the Makefile to include the new component source files. (Makefile)
  • Included new component headers in the Factory.cpp file. (src/Factory.cpp)

Additional Changes:

  • Removed redundant code in the AComponent constructor and Circuit class. (src/AComponent.cpp, src/Circuit.cpp) [1] [2]

These changes collectively enhance the functionality and maintainability of the component creation and simulation processes.

@SamGave07 SamGave07 requested a review from maelemiel March 9, 2025 22:16
@SamGave07 SamGave07 self-assigned this Mar 9, 2025
Copy link
Contributor

@maelemiel maelemiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proxy-image1

@maelemiel maelemiel changed the base branch from dev to main March 9, 2025 22:26
@maelemiel maelemiel merged commit 9ad6fe4 into main Mar 9, 2025
10 checks passed
@SamGave07 SamGave07 linked an issue Mar 9, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implémentation des composants de portes

2 participants