-
Notifications
You must be signed in to change notification settings - Fork 589
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
util: add GrayCode #2353
util: add GrayCode #2353
Conversation
e077aeb
to
756fb76
Compare
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 a good util to have.
I'm pretty sure that the GrayToBinary is just something like
Cat((in.getWidth - 2 to 0 by -1).scanLeft(in.head(1)) { case (prev, ii) => prev ^ in(ii) }
so you can get rid of the var
.
Co-authored-by: Jack Koenig <jack.koenig3@gmail.com>
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.
lgtm
@jackkoenig Did you want to backport this? |
Why not! |
(cherry picked from commit 91d7baa)
Contributor Checklist
docs/src
?Type of Improvement
API Impact
Backend Code Generation Impact
Desired Merge Strategy
Reviewer Checklist (only modified by reviewer)
3.4.x
, [small] API extension:3.5.x
, API modification or big change:3.6.0
)?Please Merge
?