Skip to content

Mask ​

Bitwise AND of an integer signal with a constant mask: out = in & mask. Use to isolate individual bit fields or strip flags from a status word.

Category: Digital Logic / Bits

Ports ​

NameDirectionValue typeNotes
ininputint
outoutputint

Parameters ​

NameLabelTypeDefaultUnitsDescription
maskMaskint255—Bit mask AND-ed with the input. Default 255 (0xFF) keeps the low 8 bits. Use any int — e.g. 0xF0 to extract the high nibble of a byte, 0x80000000 to isolate the sign bit.