Skip to content

Conversation

@mraj8370-NI
Copy link
Contributor

@mraj8370-NI mraj8370-NI commented Oct 29, 2025

TODO: Check the above box with an 'x' indicating you've read and followed CONTRIBUTING.md.

What does this Pull Request accomplish?

DBL to FXP conversion is incorrect in FPGA Addon for some FXP datatypes

Why should this Pull Request be merged?

Adds a guard for small negative floating-point values in the FXP conversion. Values that would truncate to zero are returned as 0 instead of being incorrectly converted to the minimum fixed-point value. This prevents edge-case errors while preserving the existing conversion logic.

What testing has been done?

Experiment VI
image

Observation after fix
delta is .03125 so any value i.e data/delta > .5 it will round to delta in this case it will round to -.03125.
image

delta is .03125 so any value i.e data/delta < .5 it will round to 0 in this case it will round to -.03125.
image

@niveristand-diff-bot
Copy link
Collaborator

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

FPGA Register IO.lvlib--DBL to FXP Raw.vi.png

capture

@mraj8370-NI mraj8370-NI changed the title Fxing DBL to FXP conversion Fixing DBL to FXP conversion Oct 30, 2025
@niveristand-diff-bot
Copy link
Collaborator

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

FPGA Register IO Tests.lvclass--test_FXP Signed Value Conversion_-0.5LSBto0.vi.png

capture

FPGA Register IO.lvlib--DBL to FXP Raw.vi.png

capture

@niveristand-diff-bot
Copy link
Collaborator

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

FPGA Register IO Tests.lvclass--test_FXP Signed Value Conversion_-0.5LSBto0.vi.png

capture

FPGA Register IO.lvlib--DBL to FXP Raw.vi.png

capture

@niveristand-diff-bot
Copy link
Collaborator

Bleep bloop!

LabVIEW Diff Robot here with some diffs served up hot for your pull request.

Notice something funny? Help fix me on my GitHub repo.

FPGA Register IO Tests.lvclass--test_FXP Signed Value Conversion_-0.5LSBto0.vi.png

capture

FPGA Register IO.lvlib--DBL to FXP Raw.vi.png

capture

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.

4 participants