[DFDL-WG] propose new dfdl:binaryNumberRep "offsetBinary"

Steve Hanson smh at uk.ibm.com
Thu Sep 14 21:49:01 EDT 2017


Hi Mike

If I understand this correctly, it is just a way of being able to encode 
negative numbers. For a given precision the offset is always fixed, so in 
your example no of bits is 3 so offset is 4. So the lengthKind must be 
'explicit' or 'implicit'.

If so then the table in 13.7 becomes:

Logical Type
Permitted Value
Decimal, Integer, NonNegativeInteger
packed, bcd, binary, ibm4690Packed
Long, Int, Short, Byte,
packed, binary, offsetBinary, ibm4690Packed (but not bcd)
UnsignedLong, Unsignedint, UnsignedShort, UnsignedByte
packed, bcd, binary, ibm4690Packed

Any other subtleties?

Regards
 
Steve Hanson
IBM Hybrid Integration, Hursley, UK
Architect, IBM DFDL
Co-Chair, OGF DFDL Working Group
smh at uk.ibm.com
tel:+44-1962-815848
mob:+44-7717-378890



From:   Mike Beckerle <mbeckerle.dfdl at gmail.com>
To:     "dfdl-wg at ogf.org" <dfdl-wg at ogf.org>
Date:   14/09/2017 01:35
Subject:        [DFDL-WG] propose new dfdl:binaryNumberRep "offsetBinary"
Sent by:        "dfdl-wg" <dfdl-wg-bounces at ogf.org>



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"

Thoughts?

...mikeb

Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology | 
www.tresys.com
Please note: Contributions to the DFDL Workgroup's email discussions are 
subject to the OGF Intellectual Property Policy
--
  dfdl-wg mailing list
  dfdl-wg at ogf.org
  
https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ogf.org_mailman_listinfo_dfdl-2Dwg&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=AJa9ThEymJXYnOqu84mJuw&m=0CprgI4LRiiIkD6dh9cisdJtiwY8eKVEU17rB6-QG5c&s=pBqzjiTNl3fsPo49Frk7CrYFB04XSwJg2RqwFBGiHd0&e= 


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20170915/09a0fd00/attachment.html>


More information about the dfdl-wg mailing list