How to use logic in Simulink?
Logical Operator (Simulink Reference) The Logical Operator block performs the specified logical operation on its inputs. An input value is TRUE (1) if it is nonzero and FALSE (0) if it is zero. You select the Boolean operation connecting the inputs with the Operator parameter list.