add and-gate and inverter