Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vaaniarora
Copy link
Contributor

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

@codecov
Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.9%. Comparing base (5b282f3) to head (c51b4dc).
Report is 8 commits behind head on development.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@fdxmw fdxmw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! Looks good overall, just some comments on documentation and code readability

Copy link
Member

@fdxmw fdxmw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just a couple more minor comments, sorry I didn't catch these the first time :(

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).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

@fdxmw fdxmw merged commit 7b8d86a into UCSBarchlab:development Feb 24, 2025
5 checks passed
@vaaniarora vaaniarora deleted the binary2onehot-dev branch February 24, 2025 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a helper function to encode binary to 1-hot

2 participants