import machine
from machine import Pin
# Salidas
led0 = Pin(0, Pin.OUT)
led1 = Pin(1, Pin.OUT)
led2 = Pin(2, Pin.OUT)
# Entradas
number0 = Pin(4, Pin.IN, Pin.PULL_UP)
number1 = Pin(5, Pin.IN, Pin.PULL_UP)
number2 = Pin(6, Pin.IN, Pin.PULL_UP)
number3 = Pin(7, Pin.IN, Pin.PULL_UP)
while True:
N0 = number0.value()
N1 = number1.value()
N2 = number2.value()
N3 = number3.value()
S0 = (N0 ^ N2)
S1 = ((N0 and N2) ^ (N1 ^ N3))
S2 = (N1 and N3) or (N0 and N2 and (N1 ^ N3))
led0.value(int(S0))
led1.value(int(S1))
led2.value(int(S2))