Skip to content

Commit b749327

Browse files
committed
gh-992 clearify bcd description
1 parent b983da9 commit b749327

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

doc/dev_guide/internals/box_protocol.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,21 @@ so ``byte >> 4`` is the first digit and ``byte & 0x0f`` is the second digit.
9797
The leftmost digit in the array is the most significant.
9898
The rightmost digit in the array is the least significant.
9999

100-
The first byte in the ``BCD`` array may have only the second digit.
101-
The last byte in the BCD array has only the first digit and a ``nibble``.
100+
The first byte of the ``BCD`` array contains the first digit of the number
101+
represented as follows:
102+
103+
.. code-block:: none
104+
105+
| 4 bits | 4 bits |
106+
= 0x = the 1st digit
107+
108+
The last byte of the ``BCD`` array contains the last digit of the number and the
109+
``nibble`` represented as follows:
110+
111+
.. code-block:: none
112+
113+
| 4 bits | 4 bits |
114+
= the last digit = nibble
102115
103116
The ``nibble`` represents the number's sign:
104117
``0x0a``, ``0x0c``, ``0x0e``, ``0x0f`` stand for plus,

0 commit comments

Comments
 (0)