I'm trying to make a circuit with both a AND gate and XOR gate as outputs. I thought about using a NOT gate, so that the OR gate only functions when AND is off (giving XOR).
I succeeded in making all these 3 gates work separatedly, but when I put them together, it doesn't work.
-If I remove the right parts of the following circuit, the AND works correctly. -If I remove the AND part, the OR functions correctly as well -However, if I keep all together, both leds are always turned on.
Then with my multimeter I saw that there was nothing going on from the AND part to the mosfet on the right (so nothing between M1's source and M2's gate). I would have expected to have a voltage diff of 0V between M2's D-S, but I got around 5V, so I can't seem to use it as a NOT to prevent current from going to the OR (XOR)..
I thought about adding resistors around but I really don't know how I can make it work. Would having P type mosfets help ? I'm a bit lost..
Edit: Now added a pic showing the voltages I got (Gray: A and B, red: Only A, blue: Only B), with changes suggested by Immibis.