int mArray[] = {0b0001,0b0010,0b0100,0b1000};
void main(void)
{
int S; //Since the inputs are always read before this is used,
while (true)
{ //assuming the switches really do need to update every loop
S = input_b() & 0x3; // Dejo solo B0 y B1, todo lo demas queda en 0, aprovecho de que ya están ordenados
output_bit(LD1, input_a() & mArray[S]);
}
}