Merged
Conversation
- negative numbers can now be displayed in 2's compliment binary
|
lolocomotive
suggested changes
Jan 13, 2023
|
|
||.text|.rodata|.bss|.data|Total (RAM)|Total (ROM)|%0A|-|-:|-:|-:|-:|-:|-:|%0A|Base|822852 bytes|478609 bytes|226512 bytes|1820 bytes|228332 bytes|1303281 bytes|%0A|Head|835508 bytes|487325 bytes|226504 bytes|1820 bytes|228324 bytes|1324653 bytes|%0A||+12656 bytes|+8716 bytes|-8 bytes|+0 bytes|-8 bytes|+21372 bytes|%0A||+1.5 %25|+1.8 %25|-0.0 %25|+0.0 %25|-0.0 %25|+1.6 %25|%0A |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Binary Logic Toolbox
Numworks is about to release some basic binary functions in Epsilon. I tried them out, and they are honestly pretty useless, with inputs of just 'True' and 'False' and just AND/OR/NOT functions. Here's my take on a toolbox with much more powerful logic functions to be used on both unsigned and signed integers. I have also extended the '...' (Additional Results) display to show the 2's complement binary/hex of negative numbers.
Additional Results
Negative integers can now be displayed in binary/hex. Simply navigate to the ellipsis ('...') on the right of a negative integer result to see a 2's complement representation of the number:
Functions Implemented
Basic Logic Operations
AND
OR
XOR - Exclusive OR
NOT
Bit Shifts
Shift Logical Left
Shift Logical Right
Arithmetic Shift Right
Rotate Left
Rotate Right
Setting And Clearing Bits
Get Bit
Set Bit
Clear Bit
Flip Bit
Clear 'a' With 'b'
Logic Operations (With Explicit Number of Bits)
Some logic operations (like NOT) end up generating large 32-bit numbers as the default precision is 32 bits. This adds frustration when 32 bits of precision is undesired. So some of the functions have overridden methods that have an extra argument that allows the user to control the number of output bits.
2'S Compliment Conversions/Helpers
2's Compliment Equivalent
Ceiling Log2
Other Information