1

I'm writing an Ama file generating simulator. In the Ama specifications, it gives the number of bytes(not bits) for a field as BCD16, BCD12 etc(BCD{a number}).

For fields with BCD16 the actual length is 8 bytes. Can anyone please tell me what that BCD16 means ? I know BCD is Binary coded decimal but don't understand what BCD16 means.

Prasad Weera
  • 1,223
  • 3
  • 13
  • 25

2 Answers2

2

It looks like a 2-byte (16-bit) BCD encoding. See here.

This is 2 bytes and can store a 4 digit BDC16 encoded number, with one BCD digit stored in each half byte, (aka nibble).

Example - 0011-0110 0010-0101 is 3-6 2-5 which is 3x100 + 6x10 + 2x1 + 5x0.1 = 362.5

Brian Agnew
  • 268,207
  • 37
  • 334
  • 440
0

I think after talking with a senior I found a definition.

BCD{x} means, for a single digit it takes x bits. With that ,if it is BCD3, it would take three bits to represent a single digit. Of-course with that we cannot represent every combination.But we can represent some very large values.

Eg: In BCD1 we can represent- 11111111 using one byte.

This is what I found. If there is something wrong with the definitions, please correct me.

Prasad Weera
  • 1,223
  • 3
  • 13
  • 25