Add helper function for binary to 1-hot#466
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## development #466 +/- ##
=============================================
+ Coverage 91.9% 91.9% +0.1%
=============================================
Files 24 24
Lines 6413 6417 +4
=============================================
+ Hits 5888 5893 +5
+ Misses 525 524 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fdxmw
left a comment
There was a problem hiding this comment.
Thank you for your contribution! Looks good overall, just some comments on documentation and code readability
fdxmw
left a comment
There was a problem hiding this comment.
Looks great, just a couple more minor comments, sorry I didn't catch these the first time :(
pyrtl/helperfuncs.py
Outdated
| required input). Example inputs: ``0b10``, ``0b1000``, ``4``. | ||
| :param max_bitwidth: Optional integer maximum bitwidth for the resulting one-hot WireVector. | ||
| :return: WireVector with the bit position given by the input set to 1 and all other bits | ||
| set to 0 (bit position 0 being the least significant bit). |
There was a problem hiding this comment.
I think the alignment is off here, four spaces are needed before set so Sphinx understands that this is a continuation of the :return: above, and not a new paragraph (see generated docs)
Takes an input representing a bit position and returns a WireVector with that bit position set to 1 and the others to 0.
Closes #465