Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous truth table / minterms / maxterms #22

Open
ukanuk opened this issue Sep 3, 2024 · 3 comments · May be fixed by #27
Open

Ambiguous truth table / minterms / maxterms #22

ukanuk opened this issue Sep 3, 2024 · 3 comments · May be fixed by #27

Comments

@ukanuk
Copy link

ukanuk commented Sep 3, 2024

Reading the documentation, it is not immediately obvious to me to which truth table the examples correspond. Knowing the corresponding truth table is critical for knowing which cells correspond to which minterms/maxterms.

After some initial research, I gathered that these examples corresponded to these truth tables:

\begin{karnaugh-map}[4][4][1][$X_0$][$X_1$][$X_2$][$X_3$]
\end{karnaugh-map}
X_0 X_1 X_2 X_3 minterm
0 0 0 0 m_0
0 0 0 1 m_1
0 0 1 0 m_2
0 0 1 1 m_3
\begin{karnaugh-map}*[4][4][4][$a$][$b$][$c$][$d$][$e$][$f$]
\end{karnaugh-map}
a b c d e f minterm
0 0 0 0 0 0 m_0
0 0 0 0 0 1 m_1
0 0 0 0 1 0 m_2
0 0 0 0 1 1 m_3

However after further research, I believe those are exactly reversed from what they should be:

\begin{karnaugh-map}[4][4][1][$X_0$][$X_1$][$X_2$][$X_3$]
\end{karnaugh-map}
X_3 X_2 X_1 X_0 minterm
0 0 0 0 m_0
0 0 0 1 m_1
0 0 1 0 m_2
0 0 1 1 m_3
\begin{karnaugh-map}*[4][4][4][$a$][$b$][$c$][$d$][$e$][$f$]
\end{karnaugh-map}
f e d c b a minterm
0 0 0 0 0 0 m_0
0 0 0 0 0 1 m_1
0 0 0 0 1 0 m_2
0 0 0 0 1 1 m_3

I am still not 100% sure, though. It would be helpful if the documentation made this unambiguous.

@2pi
Copy link
Owner

2pi commented Sep 4, 2024

It might just be me, but it isn't obvious to me what you are asking here... Care to clarify?

@ukanuk
Copy link
Author

ukanuk commented Sep 4, 2024

Another way of asking the same thing is that with your package when you define
\begin{karnaugh-map}*[4][4][4][$a$][$b$][$c$][$d$][$e$][$f$] and then
\minterms{1}, does that correspond to a'b'c'd'e'f, or does that correspond to f'e'd'b'c'a.

Is that clearer? I was thinking this could be clarified by including a truth table in the docs, but maybe there's a better way.

@ukanuk
Copy link
Author

ukanuk commented Sep 9, 2024

Maybe another way of saying it is this -- I am taking a class where the instructor provides this example problem in the lecture, which also matches how an example is given with a truth table on Wikipedia https://en.wikipedia.org/wiki/Karnaugh_map#Example
image

While trying to do this example and similar problems for myself in LaTeX with your package, I enter this code which is intuitive to me and find the variables are unexpectedly swapped.
image

Of course I noticed this right away, but assumed it was just another re-arrangement of variables and the minterm cell positions would also move accordingly. Just like the minterms are in a different position for this German K-map. https://de.wikipedia.org/wiki/Datei:Karnaugh_map_KV_4mal4_Gruppe102.svg
image

I believe that if I had seen in the documentation the equation $f(X3,X2,X1,X0$ or a truth table for the same, I would have realized before doing hours of work that the variables were actually entered in the opposite order I had been expecting.

@ukanuk ukanuk linked a pull request Jan 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants