Skip to content

Bit Extract

Extracts a single bit from an integer signal: out = (in >> bit_index) & 1. Useful for picking individual flags out of a status word.

Category: Digital Logic / Bits

Keywords: bit, extract, field, isolate, flag, shift, bit-extract

Ports

NameDirectionValue typeNotes
ininputint
outoutputint

Parameters

NameLabelTypeDefaultUnitsDescription
bit_indexBitint0Bit position to extract (0 = LSB). Result is 0 or 1: out = (in >> bit_index) & 1.

Implemented in C++ class SimCompCtlBitExtract (components/control/CSim_comp_ctl_bit_extract/sim_comp_ctl_bit_extract.h).

Released under the MIT License.