Unsigned bit field packing calculator
Assign a bit width to an upper field and a lower field. The calculator shifts the upper value by the lower width and combines the two nonoverlapping fields.
Result
- Packed decimal
- 177
- Hexadecimal
- B1
- Binary pattern
- 10110001
- Decoded upper
- 5
- Decoded lower
- 17
Verify the field boundary
Upper value 5 in three bits is 101. Lower value 17 in five bits is 10001. Their concatenated pattern is 10110001, decimal 177 and hexadecimal B1. The decoded values let you check that the boundary was placed correctly.
Reject overflow in either field
Each width must be a whole number from 1 through 32. A field value must fit its assigned unsigned width. The output retains the combined width, including leading zero bits. It does not add byte alignment, sign extension, checksums or protocol-specific ordering.