Simplify a boolean algebra expression to switch between values

45 Views Asked by At

I'm a little rusty on my boolean algebra and am looking for some help. I need to select between two values (Y & Z), based on the value of X. If X is true, W should be equal to the value of Y. If X is false, W should be equal to the value of Z. Below I have an expression I think works and a truth table:

Example

I'm looking at it and am thinking this expression can be simplified to two blocks. I'm actually writing some logic in a controller and I need to do this many times, so a cleaner expression would help. My options for logic operators are:

  • AND
  • OR
  • XOR
  • XNOR

And I have the ability to NOT any of the inputs. Can this be simplified? Thanks.