//----------------------------------------------------------------------
// IAY0150 - Homework #2. Espresso result of the example task.
//----------------------------------------------------------------------
// (C) Peeter Ellervee - 2026 - Tallinn
//----------------------------------------------------------------------
module fs_espresso (input x1, x2, x3, x4, output y1, y2, y3, y4);

  assign y1 = ((!x1) & x2 & (!x3) & x4) |
              (x2 & (!x3) & (!x4)) |
              ((!x1) & (!x4)) | (x1 & x3);

  assign y2 = !( ((!x1) & x2 & (!x3) & x4) |
                 (x1 & (!x2) & (!x4)) | (x1 & x3) );

  assign y3 = (x2 & (!x3) & (!x4)) | (x2 & x4) |
              ((!x1) & x3 & (!x4)) | (x1 & (!x2) & (!x4));

  assign y4 = (x1 & x3 & x4) | ((!x2) & x3) |
              ((!x1) & x3 & (!x4)) | (x1 & (!x2) & (!x4));

endmodule
