document #329

dfdl:binaryNumberRep="offsetBinary" new behavior

Added by Michael Beckerle over 1 year ago.

Status:submitted Start date:10/03/2017
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:DFDL v2.0
Document Type:Proposed Recommendation

Description

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.

Also available in: Atom PDF