drfog
(Dr Fog)
1
The following logical equation defines the output of a cascaded set of six 2:1 multiplexers:
Y[n] = If[If[Y(n-2),If[Y(n-3),A(n-1),B(n-1)],If[Y(n-3),C(n-1),D(n-1)]],If[Y(n-2),A(n),B(n)],If[Y(n-2),C(n),D(n)]]
it is relatively easy to write Y(n) as a logical function of the several inputs Y(), A(), B(), C() and D(), using “and”, “or” and “not” gates.
Is there a mechanism in Mathematica to convert the Ifs into an equivalent logical expression? Thanks
You probably want BooleanConvert. But first you need to correct your respective expression:
- function arguments should be enclosed within
[...]
- do not begin own variable names using capitel letters!
- the documentation is excellent - use it!
drfog
(Dr Fog)
3
Vielen Dank Henrik for the tip and coding style suggestions, that was indeed the function I wanted:
Y1[n] = BooleanConvert[ If[If[Y[n - 2], If[Y[n - 3], a[n - 1], b[n - 1]], If[Y[n - 3], c[n - 1], d[n - 1]]], If[Y[n - 2], a[n], b[n]], If[Y[n - 2], c[n], d[n]]]] // TraditionalFormBooleanMinimize[Y21[n], "DNF"] // TraditionalForm
BooleanMinimize[Y1[n], "DNF"] // TraditionalFor
Collect[Y1[n], {Y[n - 1], ! Y[n - 1]}, Simplify] // TraditionalForm
Not yet in the simple sum of products I expected, but it is getting there.