Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make transistors to store their states, not nodes #54

Open
kosarev opened this issue Jun 14, 2023 · 0 comments
Open

Make transistors to store their states, not nodes #54

kosarev opened this issue Jun 14, 2023 · 0 comments
Assignees

Comments

@kosarev
Copy link
Owner

kosarev commented Jun 14, 2023

The original https://github.com/trebonian/visual6502 code maintains separate states for nodes and transistors. 48a84a6 changed that to store transistors' states in their gate nodes, because these were always supposed to be the same. However, making nodes stateless and gates themselves be storing their states might be better idea.

Firstly, not all nodes are tied to gates. This means we waste time updating them. When a node 'state' is needed, we should be able to compute it on demand without having to store anything.

Secondly, storing gate states in nodes means there is no way for several gates connected to the same node to have different states, which we need to simulate various possible orders of switching transistor states (#51).

@kosarev kosarev self-assigned this Jun 14, 2023
kosarev added a commit that referenced this issue Jul 1, 2023
The total runtime of the tests is almost halved as a result of
not wasting time updating non-gate nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant