[
https://issues.apache.org/jira/browse/DAFFODIL-1889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17679925#comment-17679925
]
Mike Beckerle commented on DAFFODIL-1889:
-----------------------------------------
See this DFDL ticket on adding new binaryNumberReps:
[https://github.com/OpenGridForum/DFDL/issues/36]
These can be added as experimental (aka dfdlx) features by adding QNames to the
binaryNumberRep property where those QNames use the dfdlx namespace.
> binaryNumberRep='offsetBinary'
> ------------------------------
>
> Key: DAFFODIL-1889
> URL: https://issues.apache.org/jira/browse/DAFFODIL-1889
> Project: Daffodil
> Issue Type: New Feature
> Components: Back End, Front End
> Reporter: Mike Beckerle
> Priority: Minor
>
> Implement the binaryNumberRep 'offsetBinary'.
> This is a good first project for someone new to the Daffodil code base.
> This is a proposal for inclusion in the DFDL language, needed for some
> formats such as STANAG 5516.
> 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.
> The DFDL spec would change so table 13.7 allows 'offsetBinary' for the signed
> integer types.
> The lengthKind would have to be implicit or explicit. (SDE otherwise).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)