Two switches (Input A and Input B) control the states of the logic gates. I connect the internal pull-up resistors (which are set to INPUT mode) to digital pins 2 and 3 of the Arduino. When a button is pressed, the corresponding input pin is pulled LOW. Four LEDs connected to pins 4, 5, 6, and 7 represent the outputs of the AND, OR, NOR, and NAND gates, while the internal pull-up resistor pushes the pin HIGH when it is not touched. When the gate condition is met, the matching LED will turn on (HIGH); otherwise, it will stay off (LOW).
/*Paste your code here*/
https://wokwi.com/projects/442627901849931777
Add a video of the output (know more)