Appearance
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
Keywords: bit, AND, filter, field, flag, bitmask, bit mask, bitwise
Ports
| Name | Direction | Value type | Notes |
|---|---|---|---|
in | input | int | |
out | output | int |
Parameters
| Name | Label | Type | Default | Units | Description |
|---|---|---|---|---|---|
mask | Mask | int | 255 | — | 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. |
Implemented in C++ class SimCompCtlMask (components/control/CSim_comp_ctl_mask/sim_comp_ctl_mask.h).