In general, it's enough that two functions have the same truth table to prove that
they are the same. Since we don't want to give away the Mux, consider instead the
"Greater than or equal to 2" function. This function outputs 1 if two or more
of its inputs are 1.
a b c | out
0 0 0 | 0
0 0 1 | 0
0 1 0 | 0
0 1 1 | 1
1 0 0 | 0
1 0 1 | 1
1 1 0 | 1
1 1 1 | 1
The canonical representation of this function would be
_ _ _
out = abc + abc + abc + abc
Unless we write 3-input And and 4-input Or, this is going to take quite a bit of HDL — 3 Nots, 8 Ands and 3 Ors.
The usual way to optimize canonical representations is using a Karnaugh Map.
See http://www.facstaff.bucknell.edu/mastascu/elessonshtml/Logic/Logic3.html for a good introduction.
For this function, the optimized representation is
out = ab + ac + bc
A formal proof using Boolean algebra might run something like
_ _ _
out = abc + abc + abc + abc
_ _ _
out = abc + abc + abc + abc + abc + abc
_ _ _
out = (abc + abc) + (abc + abc) + (abc + abc)
_ _ _
out = ab(c+c) + ac(b+b) + bc(a+a)
out = ab + ac + bc
This is much easier to do in HDL — 3 Ands and 2 Ors.
There is an even better optimization from the TECS nested abstractions point of view. Study the truth table above and see if you can find the 3-line implementation using a Mux and two other gates.
--Mark