-
Notifications
You must be signed in to change notification settings - Fork 72
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
Avoid Module creation for Constant Gate scenarios #481
base: main
Are you sure you want to change the base?
Conversation
Added some more changes based on feedback (intel#481)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking very good, and the tests make sense to me for &, |, and ~
|
||
/// Logical bitwise AND. | ||
Logic operator &(Logic other) => And2Gate(this, other).out; | ||
Logic operator &(Logic other) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon review, I realized that perhaps operators could be overridden on Const
class instead of these special cases here.
For example:
if(other is Const) {
return other & this;
}
Then in Const
you can just override @override Logic operator &(Logic other)
to perform the const version of things.
Description & Motivation
#429
Related Issue(s)
#429
Testing
Added test cases to check if the result of '&', '|' and '~' operations are as expected for constant input scenarios.
Backwards-compatibility
No.
Documentation
No.