I need help writing the correct boolean function for a circuit

75 Views Asked by At

I was given a pre-made circuit. I was tasked with determining the input/output table and also the correct boolean function.

The results of the input/output table is:

~x,~y = 0

~x,y = 0

x,~y = 0

x,y = 1

From the results, I think the boolean function should simply be f(x,y) = xy

The confusion comes when I analyze the circuit. It gives the formula: ~(~x y + ~(x y))

Am I overthinking things or is there more to boolean function?

1

There are 1 best solutions below

3
On

One thing I would advise is to break yourself of the habit of using the symbol "$\require{begingroup} \begingroup=$" to signify a relation between things that are not equal.

Unless you've been told to use "," in "$x,y$" as some sort of operator I've never seen a "," used for, $x,y$ by itself isn't really a meaningful expression. If you write it like $\{x,y\}$ you have a set of one or two elements (only one element if $x = y$); if you write $(x,y)$ you have an ordered pair of two elements. Since it makes little sense to write the input to a Boolean function as a set, you presumably meant to write ordered pairs.

So now it looks like you tried to write $\newcommand{\lsim}{\mathord{\sim}}(\lsim x,\lsim y) = 0$ and $(\lsim x,y) = 0.$ By the transitive and symmetric properties of equality, that means $(\lsim x,\lsim y) = (\lsim x,y),$ which is never a true statement for any values of $x$ or $y.$

It was better before (although still wrong) when you were using $1$ and $0$ instead of $x$ and $\lsim x.$ It is still not true that $(0,0) = 0$ and $(0,1) = 0,$ because $(0,0) \neq (0,1),$ but you could have fixed the equations with just one extra symbol per line: \begin{align} f(0,0) &= 0 \\ f(0,1) &= 0 \\ f(1,0) &= 0 \\ f(1,1) &= 1 \\ \end{align}

This says that when we take the two inputs $0$ and $0$ and apply the Boolean function $f$ to them, the result is $0,$ and so forth for other possible input values. I think that's what you meant to write in the first place, but by not actually writing what you meant (by forgetting to give any indication that a function was being applied to the two numbers on the left of each equation), you wrote nonsense, and confused yourself into writing things like $f(x,y) = x,y$ which I'm sure is not at all what your circuit was supposed to be about.

To the names of functions when you functions like to something in English while no verbs. (That is, "Neglecting to write the names of functions when you use functions is like trying to explain something in English while using no verbs.")

If we try to write your edited equations as applications of the function $f,$ however, we get things like this: $$ f(x,y) = 1. $$ What does that mean? We don't usually have a rule that the symbol $x$ always represents a $1$; instead, $x$ might be $1$ or might be $0.$ Likewise, $y$ might be $1$ or might be $0.$ But if $x=0$ and $y=1$ (which is a possible assignment), you have just asserted that $f(0,1) = 1,$ which I'm fairly sure is not something your Boolean circuit would agree with.

So yes, there is something more to Boolean functions than $f(x,y) = x,y.$

For the "correct Boolean function" part of the question, I suppose you were meant to put something on the right-hand side of $f(x,y) = \ldots$ that would make a true equation for all $x$ and $y.$ It seems that by examining the circuit you have concluded that $f(x,y) = \lsim((\lsim x) y + \lsim(x y)).$ You can also replace the right-hand side of this equation with a much simpler expression involving $x$ and $y.$ Possibly you were meant to write the simpler expression, but we'd have to see exactly how the problem was put and how similar examples were previously answered in order to say whether the exercise was to copy the circuit literally or to find the simplest equivalent form.