diff options
Diffstat (limited to 'graphics/pgf/contrib/cartonaugh/test')
7 files changed, 491 insertions, 0 deletions
diff --git a/graphics/pgf/contrib/cartonaugh/test/cartonaugh-bw-color.tex b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-bw-color.tex new file mode 100644 index 0000000000..e45b0215c6 --- /dev/null +++ b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-bw-color.tex @@ -0,0 +1,16 @@ +\documentclass{standalone} +\usepackage{cartonaugh} +\begin{document} + \begin{cartonaugh}*[4][4][1] + \implicant{0}{0} + \implicant{4}{5} + \implicant{12}{15} + \implicant{8}{10} + \end{cartonaugh} + \begin{cartonaugh}[4][4][1] + \implicant{0}{0} + \implicant{4}{5} + \implicant{12}{15} + \implicant{8}{10} + \end{cartonaugh} +\end{document} diff --git a/graphics/pgf/contrib/cartonaugh/test/cartonaugh-grid.tex b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-grid.tex new file mode 100644 index 0000000000..61663a86bc --- /dev/null +++ b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-grid.tex @@ -0,0 +1,12 @@ +\documentclass{standalone} +\usepackage{cartonaugh} +\begin{document} + \begin{cartonaugh}[2][2][1]\end{cartonaugh} + \begin{cartonaugh}[2][4][1]\end{cartonaugh} + \begin{cartonaugh}[4][2][1]\end{cartonaugh} + \begin{cartonaugh}[4][4][1]\end{cartonaugh} + \begin{cartonaugh}[4][4][2]\end{cartonaugh} + \begin{cartonaugh}[4][4][4]\end{cartonaugh} + \begin{cartonaugh}[4][4][2][$X_1X_0$][$X_3X_2$][$X_5X_4$][1]\end{cartonaugh} + \begin{cartonaugh}[4][4][4][$X_1X_0$][$X_3X_2$][$X_5X_4$][1]\end{cartonaugh} +\end{document} diff --git a/graphics/pgf/contrib/cartonaugh/test/cartonaugh-implicant.tex b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-implicant.tex new file mode 100644 index 0000000000..2951c8e7db --- /dev/null +++ b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-implicant.tex @@ -0,0 +1,248 @@ +\documentclass{standalone} +\usepackage{cartonaugh} +\begin{document} + % draw cell implicants(single, horizontal, vertical, and 2x2 block), default submap + \begin{cartonaugh}[2][2][1] + % single cell + \implicant{0}{0} + % horizontal + \implicant{2}{3} + % vertical + \implicant{1}{3} + % block + \implicant{0}{3} + \end{cartonaugh} + \begin{cartonaugh}[2][4][1] + % single cell + \implicant{0}{0} + \implicant{1}{1} + % horizontal + \implicant{2}{3} + % vertical + \implicant{3}{7} + % block + \implicant{6}{5} + \end{cartonaugh} + \begin{cartonaugh}[4][2][1] + % single cell + \implicant{0}{0} + \implicant{1}{1} + % horizontal + \implicant{4}{5} + % vertical + \implicant{1}{5} + % block + \implicant{3}{6} + \end{cartonaugh} + \begin{cartonaugh}[4][4][1] + % single cell + \implicant{0}{0} + \implicant{1}{1} + \implicant{2}{2} + \implicant{3}{3} + % horizontal + \implicant{9}{11} + % vertical + \implicant{4}{12} + % block + \implicant{5}{15} + \end{cartonaugh} + \begin{cartonaugh}[4][4][2] + % single cell + \implicant{0}{0} + \implicant{1}{1} + \implicant{2}{2} + \implicant{3}{3} + % horizontal + \implicant{9}{11} + % vertical + \implicant{4}{12} + % block + \implicant{5}{15} + \end{cartonaugh} + \begin{cartonaugh}[4][4][4] + % single cell + \implicant{0}{0} + \implicant{1}{1} + \implicant{2}{2} + \implicant{3}{3} + % horizontal + \implicant{9}{11} + % vertical + \implicant{4}{12} + % block + \implicant{5}{15} + \end{cartonaugh} + % draw on 0th and 2nd submaps(when possible) + \begin{cartonaugh}[2][2][1] + % single cell + \implicant{0}{0}[0,2] + % horizontal + \implicant{2}{3}[0,2] + % vertical + \implicant{1}{3}[0,2] + % block + \implicant{0}{3}[0,2] + \end{cartonaugh} + \begin{cartonaugh}[2][4][1] + % single cell + \implicant{0}{0}[0,2] + \implicant{1}{1}[0,2] + % horizontal + \implicant{2}{3}[0,2] + % vertical + \implicant{3}{7}[0,2] + % block + \implicant{6}{5}[0,2] + \end{cartonaugh} + \begin{cartonaugh}[4][2][1] + % single cell + \implicant{0}{0}[0,2] + \implicant{1}{1}[0,2] + % horizontal + \implicant{4}{5}[0,2] + % vertical + \implicant{1}{5}[0,2] + % block + \implicant{3}{6}[0,2] + \end{cartonaugh} + \begin{cartonaugh}[4][4][1] + % single cell + \implicant{0}{0}[0,2] + \implicant{1}{1}[0,2] + \implicant{2}{2}[0,2] + \implicant{3}{3}[0,2] + % horizontal + \implicant{9}{11}[0,2] + % vertical + \implicant{4}{12}[0,2] + % block + \implicant{5}{15}[0,2] + \end{cartonaugh} + \begin{cartonaugh}[4][4][2] + % single cell + \implicant{0}{0}[0,2] + \implicant{1}{1}[0,2] + \implicant{2}{2}[0,2] + \implicant{3}{3}[0,2] + % horizontal + \implicant{9}{11}[0,2] + % vertical + \implicant{4}{12}[0,2] + % block + \implicant{5}{15}[0,2] + \end{cartonaugh} + \begin{cartonaugh}[4][4][4] + % single cell + \implicant{0}{0}[0,2] + \implicant{1}{1}[0,2] + \implicant{2}{2}[0,2] + \implicant{3}{3}[0,2] + % horizontal + \implicant{9}{11}[0,2] + % vertical + \implicant{4}{12}[0,2] + % block + \implicant{5}{15}[0,2] + \end{cartonaugh} + % draw multiple different implicants + \begin{cartonaugh}[2][2][1] + % single cell + \implicant{0}{0}[0] + % horizontal + \implicant{2}{3}[0] + % vertical + \implicant{1}{3}[0] + % block + \implicant{0}{3}[0] + \end{cartonaugh} + \begin{cartonaugh}[2][4][1] + % single cell + \implicant{0}{0}[0] + \implicant{1}{1}[0] + % horizontal + \implicant{2}{3}[0] + % vertical + \implicant{3}{7}[0] + % block + \implicant{6}{5}[0] + \end{cartonaugh} + \begin{cartonaugh}[4][2][1] + % single cell + \implicant{0}{0}[0] + \implicant{1}{1}[0] + % horizontal + \implicant{4}{5}[0] + % vertical + \implicant{1}{5}[0] + % block + \implicant{3}{6}[0] + \end{cartonaugh} + \begin{cartonaugh}[4][4][1] + % single cell + \implicant{0}{0}[0] + \implicant{1}{1}[0] + \implicant{2}{2}[0] + \implicant{3}{3}[0] + % horizontal + \implicant{9}{11}[0] + % vertical + \implicant{4}{12}[0] + % block + \implicant{5}{15}[0] + \end{cartonaugh} + \begin{cartonaugh}[4][4][2] + % single cell + \implicant{0}{0}[0] + \implicant{1}{1}[0] + \implicant{2}{2}[0] + \implicant{3}{3}[0] + \implicant{0}{0}[1] + \implicant{1}{1}[1] + \implicant{2}{2}[1] + \implicant{3}{3}[1] + % horizontal + \implicant{9}{11}[0] + \implicant{9}{11}[1] + % vertical + \implicant{4}{12}[0] + \implicant{4}{12}[1] + % block + \implicant{5}{15}[0] + \implicant{5}{15}[1] + \end{cartonaugh} + \begin{cartonaugh}[4][4][4] + % single cell + \implicant{0}{0}[0] + \implicant{1}{1}[0] + \implicant{2}{2}[0] + \implicant{3}{3}[0] + \implicant{0}{0}[1] + \implicant{1}{1}[1] + \implicant{2}{2}[1] + \implicant{3}{3}[1] + \implicant{0}{0}[2] + \implicant{1}{1}[2] + \implicant{2}{2}[2] + \implicant{3}{3}[2] + \implicant{0}{0}[3] + \implicant{1}{1}[3] + \implicant{2}{2}[3] + \implicant{3}{3}[3] + % horizontal + \implicant{9}{11}[0] + \implicant{9}{11}[1] + \implicant{9}{11}[2] + \implicant{9}{11}[3] + % vertical + \implicant{4}{12}[0] + \implicant{4}{12}[1] + \implicant{4}{12}[2] + \implicant{4}{12}[3] + % block + \implicant{5}{15}[0] + \implicant{5}{15}[1] + \implicant{5}{15}[2] + \implicant{5}{15}[3] + \end{cartonaugh} +\end{document} diff --git a/graphics/pgf/contrib/cartonaugh/test/cartonaugh-implicantcorner.tex b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-implicantcorner.tex new file mode 100644 index 0000000000..740e4f263c --- /dev/null +++ b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-implicantcorner.tex @@ -0,0 +1,38 @@ +\documentclass{standalone} +\usepackage{cartonaugh} +\begin{document} + % test default(should only draw on 0th submap) + \begin{cartonaugh}[4][4][1] + \implicantcorner + \end{cartonaugh} + \begin{cartonaugh}[4][4][2] + \implicantcorner + \end{cartonaugh} + \begin{cartonaugh}[4][4][4] + \implicantcorner + \end{cartonaugh} + % draw on 0th and 2nd submaps(when possible) + \begin{cartonaugh}[4][4][1] + \implicantcorner[0,2] + \end{cartonaugh} + \begin{cartonaugh}[4][4][2] + \implicantcorner[0,2] + \end{cartonaugh} + \begin{cartonaugh}[4][4][4] + \implicantcorner[0,2] + \end{cartonaugh} + % draw multiple different implicants + \begin{cartonaugh}[4][4][1] + \implicantcorner[0] + \end{cartonaugh} + \begin{cartonaugh}[4][4][2] + \implicantcorner[0] + \implicantcorner[1] + \end{cartonaugh} + \begin{cartonaugh}[4][4][4] + \implicantcorner[0] + \implicantcorner[1] + \implicantcorner[2] + \implicantcorner[3] + \end{cartonaugh} +\end{document} diff --git a/graphics/pgf/contrib/cartonaugh/test/cartonaugh-implicantedge.tex b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-implicantedge.tex new file mode 100644 index 0000000000..b8dd02ec33 --- /dev/null +++ b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-implicantedge.tex @@ -0,0 +1,69 @@ +\documentclass{standalone} +\usepackage{cartonaugh} +\begin{document} + % vertical and horizontal implicants(when possible), default submap + \begin{cartonaugh}[2][4][1] + \implicantedge{0}{1}{4}{5} + \end{cartonaugh} + \begin{cartonaugh}[4][2][1] + \implicantedge{1}{3}{5}{7} + \end{cartonaugh} + \begin{cartonaugh}[4][4][1] + \implicantedge{1}{3}{9}{11} + \implicantedge{4}{12}{6}{14} + \end{cartonaugh} + \begin{cartonaugh}[4][4][2] + \implicantedge{1}{3}{9}{11} + \implicantedge{4}{12}{6}{14} + \end{cartonaugh} + \begin{cartonaugh}[4][4][4] + \implicantedge{1}{3}{9}{11} + \implicantedge{4}{12}{6}{14} + \end{cartonaugh} + % draw on 0th and 2nd submaps(when possible) + \begin{cartonaugh}[2][4][1] + \implicantedge{0}{1}{4}{5}[0,2] + \end{cartonaugh} + \begin{cartonaugh}[4][2][1] + \implicantedge{1}{3}{5}{7}[0,2] + \end{cartonaugh} + \begin{cartonaugh}[4][4][1] + \implicantedge{1}{3}{9}{11}[0,2] + \implicantedge{4}{12}{6}{14}[0,2] + \end{cartonaugh} + \begin{cartonaugh}[4][4][2] + \implicantedge{1}{3}{9}{11}[0,2] + \implicantedge{4}{12}{6}{14}[0,2] + \end{cartonaugh} + \begin{cartonaugh}[4][4][4] + \implicantedge{1}{3}{9}{11}[0,2] + \implicantedge{4}{12}{6}{14}[0,2] + \end{cartonaugh} + % draw multiple different implicants + \begin{cartonaugh}[2][4][1] + \implicantedge{0}{1}{4}{5}[0] + \end{cartonaugh} + \begin{cartonaugh}[4][2][1] + \implicantedge{1}{3}{5}{7}[0] + \end{cartonaugh} + \begin{cartonaugh}[4][4][1] + \implicantedge{1}{3}{9}{11}[0] + \implicantedge{4}{12}{6}{14}[0] + \end{cartonaugh} + \begin{cartonaugh}[4][4][2] + \implicantedge{1}{3}{9}{11}[0] + \implicantedge{4}{12}{6}{14}[0] + \implicantedge{1}{3}{9}{11}[1] + \implicantedge{4}{12}{6}{14}[1] + \end{cartonaugh} + \begin{cartonaugh}[4][4][4] + \implicantedge{1}{3}{9}{11}[0] + \implicantedge{4}{12}{6}{14}[0] + \implicantedge{1}{3}{9}{11}[1] + \implicantedge{4}{12}{6}{14}[1] + \implicantedge{1}{3}{9}{11}[2] + \implicantedge{4}{12}{6}{14}[2] + \implicantedge{1}{3}{9}{11}[3] + \implicantedge{4}{12}{6}{14}[3] + \end{cartonaugh} +\end{document} diff --git a/graphics/pgf/contrib/cartonaugh/test/cartonaugh-options.tex b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-options.tex new file mode 100644 index 0000000000..6fe84ba61b --- /dev/null +++ b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-options.tex @@ -0,0 +1,29 @@ +% Test to test out the different package options +\documentclass[]{standalone} +\usepackage{cartonaugh} +\begin{document} + % Normal stuff + \begin{cartonaugh}[4][4][4] + \autoterms[-] + \end{cartonaugh} + % Test out non-seperated kmap + \begin{cartonaugh}[4][4][4][$BA$][$DC$][$FE$][1] + \autoterms[-] + \end{cartonaugh} + % Test changing color + \begin{cartonaugh}[4][4][4] + \implicant{0}{2}[0] + \implicant{4}{6}[0] + \changecolor{blue} + \implicant{8}{10}[0] + \implicant{12}{14}[0] + \end{cartonaugh} + % Test changing the implicant corner spread + \begin{cartonaugh}[4][4][4] + \implicantcorner[0] + \implicantspread{0.2}{0.7} + \implicantcorner[1] + \resetimplicantspread + \implicantcorner[2] + \end{cartonaugh} +\end{document} diff --git a/graphics/pgf/contrib/cartonaugh/test/cartonaugh-terms.tex b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-terms.tex new file mode 100644 index 0000000000..aae274f8be --- /dev/null +++ b/graphics/pgf/contrib/cartonaugh/test/cartonaugh-terms.tex @@ -0,0 +1,79 @@ +\documentclass{standalone} +\usepackage{cartonaugh} +\begin{document} + % fill all fields (autoterms) + \begin{cartonaugh}[2][2][1] + \autoterms[-] + \end{cartonaugh} + \begin{cartonaugh}[2][4][1] + \autoterms[-] + \end{cartonaugh} + \begin{cartonaugh}[4][2][1] + \autoterms[-] + \end{cartonaugh} + \begin{cartonaugh}[4][4][1] + \autoterms[-] + \end{cartonaugh} + \begin{cartonaugh}[4][4][2] + \autoterms[-] + \end{cartonaugh} + \begin{cartonaugh}[4][4][4] + \autoterms[-] + \end{cartonaugh} + % fill remaining after '\indeterminants' '\manualterms' '\maxterms' and '\minterms' + \begin{cartonaugh}[2][2][1] + \manualterms{m} + \indeterminants{1} + \maxterms{2} + \minterms{3} + \autoterms[a] + \end{cartonaugh} + \begin{cartonaugh}[2][2][1] + \manualterms{m} + \terms{1}{T} + \indeterminants{1} + \maxterms{2} + \minterms{3} + \autoterms[a] + \end{cartonaugh} + \begin{cartonaugh}[2][4][1] + \manualterms{m} + \indeterminants{1} + \maxterms{2} + \minterms{3} + \terms{4}{T} + \autoterms[a] + \end{cartonaugh} + \begin{cartonaugh}[4][2][1] + \manualterms{m} + \indeterminants{1} + \maxterms{2} + \minterms{3} + \terms{4}{T} + \autoterms[a] + \end{cartonaugh} + \begin{cartonaugh}[4][4][1] + \manualterms{m,m} + \indeterminants{2,3} + \maxterms{4,5} + \minterms{6,7} + \terms{8,9}{T} + \autoterms[a] + \end{cartonaugh} + \begin{cartonaugh}[4][4][2] + \manualterms{m,m,m,m} + \indeterminants{4,5,6,7} + \maxterms{8,9,10,11} + \minterms{12,13,14,15} + \terms{16,17,18,19}{T} + \autoterms[a] + \end{cartonaugh} + \begin{cartonaugh}[4][4][4] + \manualterms{m,m,m,m} + \indeterminants{4,5,6,7} + \maxterms{8,9,10,11} + \minterms{12,13,14,15} + \terms{16,17,18,19}{T} + \autoterms[a] + \end{cartonaugh} +\end{document} |