Fix: SR Latch Logic in FlipFlop Gate #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The FlipFlop gate was previously implemented with D flip-flop behavior. This commit corrects the Handler function in
gate/flipflop.goto implement the proper SR latch logic:A new test suite,
TestFlipFlop_SR_Latch_Logic, has been added togate/flipflop_test.goto thoroughly verify the corrected SR latch functionality. These tests cover various input combinations, including the enable signal behavior and state maintenance, ensuring the gate behaves as expected. All new tests are passing.