Logic and Bit Operations
R2026bBlocks for Boolean logic, signal comparison, edge detection, and bit
manipulation, such as Logical Operator and Relational Operator
Use blocks from the Logic and Bit Operations library to implement decision logic and signal monitoring in your model. You can perform Boolean operations, compare signals, detect rising and falling edges, and convert between bit fields and integers.
To add blocks from this library to your model, see Add Blocks to Models.
Blocks
| Bit Clear | Set specified bit of stored integer to zero | |
| Bit Set | Set specified bit of stored integer to one | |
| Bit to Integer Converter | Map vector of bits to corresponding vector of integers | |
| Bitwise Operator | Specified bitwise operation on inputs | |
| Combinatorial Logic | Implement truth table | |
| Compare To Constant | Determine how signal compares to specified constant | |
| Compare To Zero | Determine how signal compares to zero | |
| Detect Change | Detect change in signal value | |
| Detect Decrease | Detect decrease in signal value | |
| Detect Fall Negative | Detect falling edge when signal value decreases to strictly negative value, and its previous value was nonnegative | |
| Detect Fall Nonpositive | Detect falling edge when signal value decreases to nonpositive value, and its previous value was strictly positive | |
| Detect Increase | Detect increase in signal value | |
| Detect Rise Nonnegative | Detect rising edge when signal value increases to nonnegative value, and its previous value was strictly negative | |
| Detect Rise Positive | Detect rising edge when signal value increases to strictly positive value, and its previous value was nonpositive | |
| Extract Bits | Output selection of contiguous bits from input signal | |
| Float Extract Bits | Extract bits from floating-point input samples (Since R2023a) | |
| Integer to Bit Converter | Map vector of integers to vector of bits | |
| Interval Test | Determine if signal is in specified interval | |
| Interval Test Dynamic | Determine if signal is in specified interval | |
| Logical Operator | Perform specified logical operation on input | |
| Relational Operator | Perform specified relational operation on inputs | |
| Shift Arithmetic | Shift bits or binary point of signal |
Tools
| Library Browser | Find and add blocks to model |
Topics
- Add Blocks to Models
Use the Library Browser and quick insert menu to insert blocks.