Я только что написал простую небольшую C # -программу, чтобы проверить каждую возможную комбинацию ввода, и она не может найти решение. Так что, если я не сделал какую-то программную ошибку, не существует решения этой проблемы.
using System;
class Program
{
static void Main(string[] args)
{
bool[] aValues = new bool[] { false, false, false, false, true, true, true, true };
bool[] bValues = new bool[] { false, false, true, true, false, false, true, true };
bool[] cValues = new bool[] { false, true, false, true, false, true, false, true };
bool[] carryValues = new bool[] { false, false, false, true, false, true, true, true };
bool[] constantFalse = new bool[] { false, false, false, false, false, false, false, false };
bool[] constantTrue = new bool[] { true, true, true, true, true, true, true, true };
bool[] sumValues = new bool[] { false, true, true, false, true, false, false, true };
bool[][] allInputs = new bool[][] { aValues, bValues, cValues, carryValues, constantFalse, constantTrue };
for (int controlOneIndex = 0; controlOneIndex < allInputs.Length; controlOneIndex++)
for (int controlTwoIndex = 0; controlTwoIndex < allInputs.Length; controlTwoIndex++)
for (int inputOneIndex = 0; inputOneIndex < allInputs.Length; inputOneIndex++)
for (int inputTwoIndex = 0; inputTwoIndex < allInputs.Length; inputTwoIndex++)
for (int inputThreeIndex = 0; inputThreeIndex < allInputs.Length; inputThreeIndex++)
for (int inputFourIndex = 0; inputFourIndex < allInputs.Length; inputFourIndex++)
{
for (int calculationIndex = 0; calculationIndex < sumValues.Length; calculationIndex++)
{
if (MuxResult(allInputs[controlOneIndex][calculationIndex],
allInputs[controlTwoIndex][calculationIndex],
allInputs[inputOneIndex][calculationIndex],
allInputs[inputTwoIndex][calculationIndex],
allInputs[inputThreeIndex][calculationIndex],
allInputs[inputFourIndex][calculationIndex]) != sumValues[calculationIndex])
{
goto tryNextValue;
}
}
Console.WriteLine("Success: controls: {0} {1} inputs: {2} {3} {4} {5}",
controlOneIndex, controlTwoIndex, inputOneIndex, inputTwoIndex, inputThreeIndex, inputFourIndex);
tryNextValue: ;
}
Console.WriteLine("done");
Console.ReadLine();
}
private static bool MuxResult(bool controlOne, bool controlTwo, bool inputOne, bool inputTwo, bool inputThree, bool inputFour)
{
if (controlOne)
{
if (controlTwo)
return inputFour;
else
return inputTwo;
}
else
{
if (controlTwo)
return inputThree;
else
return inputOne;
}
}
}