逻辑函数Y(如下图)的最简与—或表达式为?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Q756543
{
class Program
{
static bool Compare(Func<bool, bool, bool, bool> f1, Func<bool, bool, bool, bool> f2)
{
for (int i = 0; i < 8; i++)
{
bool a = i % 2 != 0;
bool b = (i / 2) % 2 != 0;
bool c = (i / 4) % 2 != 0;
if (f1(a, b, c) != f2(a, b, c)) return false;
}
return true;
}
static void Main(string[] args)
{
Func<bool, bool, bool, bool> Y = new Func<bool, bool, bool, bool>((a, b, c) => (a && b) || (!a && b) || (a && b && c) );
Console.WriteLine(Compare(Y, (a, b, c) => b || !a ));
Console.WriteLine(Compare(Y, (a, b, c) => b || (a & c) ));
Console.WriteLine(Compare(Y, (a, b, c) => a || b ));
Console.WriteLine(Compare(Y, (a, b, c) => b ));
}
}
}
False
False
False
True
Press any key to continue . . .
所以选D
Y = AB+A'B+ABC = B(A+A'+AC) = B(1+AC) = B