MIL-STD-1553B Command Word Decoder
Decode and build 1553B command words: RT address, T/R, subaddress, word count, mode codes.
bits 15–11 RT · 10 T/R · 9–5 subaddress · 4–0 word count / mode code
This tool decodes and builds MIL-STD-1553B command words. Enter a 16-bit hex word to break out the RT address, T/R direction, subaddress, and word count or mode code — or set the fields to generate the word. It handles the mode-command rule (subaddress 0/31) and shows the odd-parity bit. Reference: 0x183E = RT 3, receive, subaddress 1, 30 data words.
How it works
The bus controller starts every 1553 transfer with a command word. Its 16 bits pack four fields — RT(5) · T/R(1) · SA(5) · WC/mode(5) — transmitted most-significant bit first, framed by a 3-bit command sync and closed with an odd-parity bit. The subaddress is the switch that changes the meaning of the final field: 0 or 31 makes it a mode code, anything else makes it a word count (with 0 meaning a full 32 words). Getting that rule right is the whole game when reading a captured word.
Worked example
RT 3 · T/R 0 (receive) · SA 1 · WC 30
→ BC → RT transfer of 30 data words to RT 3, subaddress 1
0x2C02 → RT 5, transmit, SA 0 → mode code 2 = Transmit Status Word
Parameters
| Parameter | Value | Notes |
|---|---|---|
| RT address | bits 15–11 | 0–30, 31 = broadcast |
| T/R | bit 10 | 1 transmit, 0 receive |
| Subaddress | bits 9–5 | 0 or 31 → mode command |
| Word count | bits 4–0 | 1–32 (field 0 → 32) |
| Mode code | bits 4–0 | when subaddress 0/31 |
| Parity | odd | over the 16 bits |
C reference
#include <stdint.h>
/* Decode a MIL-STD-1553B command word (16-bit content) */
typedef struct { uint8_t rt, tr, sa, wc_mode; } cw_t;
cw_t decode_cw(uint16_t w)
{
cw_t c;
c.rt = (w >> 11) & 0x1F; /* RT address 0-31 */
c.tr = (w >> 10) & 0x01; /* 1=transmit, 0=receive */
c.sa = (w >> 5) & 0x1F; /* subaddress (0/31=mode) */
c.wc_mode = w & 0x1F; /* word count or mode code */
return c; /* 0x183E -> RT3 Rx SA1 WC30 */
}FAQ
▸How is a 1553B command word laid out?
Sixteen bits, MSB first: bits 15-11 are the remote terminal (RT) address (0-31), bit 10 is the Transmit/Receive (T/R) bit, bits 9-5 are the subaddress (0-31), and bits 4-0 are the word count or mode code. A 3-bit command sync and an odd-parity bit bracket these 16 bits on the wire.
▸When is the last field a word count versus a mode code?
The subaddress decides. Subaddress 0 or 31 signals a mode command, so bits 4-0 are a mode code (0-31). Any other subaddress means a data transfer, and bits 4-0 are the word count — where a field value of 0 means 32 data words, not zero.
▸What does the T/R bit mean?
1 = transmit: the addressed RT sends data to the bus controller (RT → BC). 0 = receive: the RT receives data from the bus controller (BC → RT). For mode commands the T/R bit also selects between transmit-type and receive-type mode codes.
▸What is RT address 31?
Address 31 (0b11111) is the broadcast address — all RTs act on the command and, per the standard, do not return a status word for a broadcast receive. Individual RTs use addresses 0-30.
▸How is the parity computed?
Odd parity over the 16-bit word: the parity bit is set so the total number of 1s across the 16 content bits plus the parity bit is odd. This tool shows the parity bit for any word you decode or build.
Related tools
MIL-STD-1553B Status Word Decoder
Decode 1553B status words: RT address and every status flag bit.
MIL-STD-1553B Message Decoder
Lay out a full 1553B transaction: command, data words and status, with parity checks.
MIL-STD-1553B Mode Code Reference
Look up 1553B mode codes by T/R bit and code, with data-word rules.