| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
Logic and Bit Operations

The Bit Set block sets the specified bit of the stored integer to one. Scaling is ignored.
You can specify the bit to be set to one with the Index of bit parameter, where bit zero is the least significant bit.
The Bit Set block supports Simulink integer, fixed-point, and Boolean data types. The block does not support true floating-point data types or enumerated data types.

If the Bit Set block is turned on for bit 2, bit 2 is set to 1. A vector of constants 2.^[0 1 2 3 4] is represented in binary as [00001 00010 00100 01000 10000]. With bit 2 set to 1, the result is [00101 00110 00100 01100 10100], which is represented in decimal as [5 6 4 12 20].
Direct Feedthrough | Yes |
Scalar Expansion | Yes |
![]() | Bit Clear | Bitwise Operator | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |