Ambiguous truth table / minterms / maxterms
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.
It might just be me, but it isn't obvious to me what you are asking here... Care to clarify?
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.
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
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.
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
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.