Skip to content
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

dfdl:binaryNumberRep="offsetBinary" new behavior #7

Open
mbeckerle opened this issue Nov 23, 2020 · 0 comments
Open

dfdl:binaryNumberRep="offsetBinary" new behavior #7

mbeckerle opened this issue Nov 23, 2020 · 0 comments
Labels
DFDL 2.0 For issues associated with DFDL v2.0 (next major revision)

Comments

@mbeckerle
Copy link
Collaborator

We have found a number of places that use offset-binary numeric representation. This is also called excess-K, or biased, but I think offset binary is a better description of it.

In this representation you take an unsigned binary, and just subtract an offset. E.g., for a 3-bit number, mostSignificantBitFirst:

bits unsigned twos-comp offsetBinary

000 0 0 -4
001 1 1 -3
010 2 2 -2
011 3 3 -1
100 4 -4 0
101 5 -3 1
110 6 -2 2
111 7 -1 3

At the moment, users have to work around this in Daffodil using inputValueCalc and outputValueCalc. This is feasible, but really awkward for such a simple concept.

So we suggest that the next revision of DFDL include dfdl:binaryNumberRep="offsetBinary" as a required feature.

@mbeckerle mbeckerle added the DFDL 2.0 For issues associated with DFDL v2.0 (next major revision) label Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DFDL 2.0 For issues associated with DFDL v2.0 (next major revision)
Projects
None yet
Development

No branches or pull requests

1 participant