## 7.1.9.3 Septet representation

Page 160 of 800 |
| Search internet |

In vectors and in many other places in Logiweb, naturals (i.e. natural numbers) are expressed in 'septet representation'. Septet representation is a representation in which naturals are expressed little endian base 128 and in which 128 is added to all bytes except the last.

We shall refer to a natural in the range 0..255 as a 'byte', to a natural in the range 0..127 as an 'end septet', and to a natural in the range 128..255 as a 'middle septet'. In septet representation, a natural is represented by a sequence of zero, one, or more middle septets followed by precisely one end septet.

As an example, the septet sequence

129 130 131 4

represents the natural

1+128*(2+128*(3+128*4))=8438017

As another example, the septet sequence

128 2

represents the natural

0+128*2=256

As a final example, the septet sequence

2

represents the natural

2

In general, naturals in the range 0..127 are represented by themselves.

Page 160 of 800 |
| Search logiweb.eu |

Copyright © 2010
Klaus Grue,
GRD-2010-01-05