Changing bit offset. #10

Closed
opened 2025-09-19 14:51:42 +00:00 by taylorh140 · 2 comments

Some older conventions have the bit numbering starting at 1 instead of zero. I know it sounds a bit odd. But it should be possible to offset this.

image.png

ARINC 429 for example

Some older conventions have the bit numbering starting at 1 instead of zero. I know it sounds a bit odd. But it should be possible to offset this. ![image.png](/attachments/a7de7c7f-9fae-4157-97b5-df5f0bd3114f) ARINC 429 for example
Owner

You can use the start property on a structure to set the starting bit. I do realize now that it is now documented in the manual.

Your example can be done like this, although it is currently not possible to change name alignement (like MSB / DATA / LSB):

#import "@preview/rivet:0.3.0": schema

#let arinc = schema.load(```yaml
structures:
  main:
    bits: 32
    start: 1
    ranges:
      32:
        name: P
      31-30:
        name: SSM
      29-11:
        name: DATA
      10-9:
        name: SDI
      8-1:
        name: LABEL
```)

#schema.render(arinc)

arinc.png

You can use the `start` property on a structure to set the starting bit. I do realize now that it is now documented in the manual. Your example can be done like this, although it is currently not possible to change name alignement (like MSB / DATA / LSB): ```typ #import "@preview/rivet:0.3.0": schema #let arinc = schema.load(```yaml structures: main: bits: 32 start: 1 ranges: 32: name: P 31-30: name: SSM 29-11: name: DATA 10-9: name: SDI 8-1: name: LABEL ```) #schema.render(arinc) ``` ![arinc.png](/attachments/1712bb86-57de-4fe1-bea5-5cba78b81bc5)
Author

Wow, that's fantastic. totally missed it too.

Wow, that's fantastic. totally missed it too.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: HEL/rivet-typst#10
No description provided.