\documentclass[a4paper,french,12pt]{article}

\title{Logique Programmable --- Prérequis --- Exercices}
\author{}
\date{Dernière compilation~: \today{} à \currenttime}

\usepackage{../styles}
\usepackage{enumitem}

\begin{document}

\maketitle

\section{Simplification des fonctions logiques}

    \subsection{Exercice 1}

        \begin{multicols}{4}

            \begin{enumerate}[label=\alph*)]

                \item $a \cdot b \cdot c \cdot d = 1$

                \item $a + b + c + d = 0$

                \item $a + b + c + d = 1$

                \item $a \cdot b \cdot c \cdot d = 0$

            \end{enumerate}

        \end{multicols}

    \subsection{Exercice 2}

        \begin{enumerate}[label=\alph*)]

            \item \begin{align*}
                    F(a, b, c) &= a\bar{b} + abc + a\bar{c} \\
                    F(0,1,1) &= 0 \\
                    F(1,1,0) &= 1 \\
                    F(1,0,0) &= 1 \\
                \end{align*}

            \item \begin{equation*}
                    F(a, b) = \bar{a}\bar{b} + b = \bar{a} + b
                \end{equation*}

                \begin{center}
                \begin{tabular}{cc|c|c|c|c}
                    \toprule
                    $a$ & $b$ & $\bar{a}\bar{b}$ & $\bar{a}\bar{b} + b$ & $\bar{a}$ & $\bar{a} + b$ \\
                    \midrule
                    0 & 0 & 1 & 1 & 1 & 1 \\
                    0 & 1 & 0 & 1 & 0 & 1 \\
                    1 & 0 & 0 & 0 & 0 & 0 \\
                    1 & 1 & 0 & 1 & 0 & 1 \\
                    \midrule
                      &   &   & $\uparrow$ & = & $\uparrow$ \\
                    \bottomrule
                \end{tabular}
                \end{center}

            \item \begin{align*}
                    F(a, b, c) &= a\bar{b} + ab + ac \\
                               &= a (\bar{b} + b + c) \\
                               &= a (1 + c) \\
                               &= a \cdot 1 = a
                \end{align*}

            \item \begin{align*}
                    F(a, b, c) &= \bar{a}\bar{b}c + a\bar{b}\bar{c} + a\bar{b}c + ab\bar{c} + abc \\
                               &= \bar{a}\bar{b}c + a\bar{b}\bar{c} + ab\bar{c} + ac(b + \bar{b}) \\
                               &= \bar{a}\bar{b}c + a\bar{b}\bar{c} + ab\bar{c} + ac \\
                               &= \bar{a}\bar{b}c + a\bar{c} + ac \\
                               &= \bar{a}\bar{b}c + a \\
                \end{align*}

        \end{enumerate}

    \subsection{Exercice 3}

        \begin{enumerate}[label=\alph*)]

            \item \begin{align*}
                    F_1 &= (a + b) \cdot (\bar{a} + \bar{b}) \\
                    \overline{F_1} &= \overline{(a + b) \cdot (\bar{a} + \bar{b})} \\
                                   &= \overline{(a + b)} + \overline{(\bar{a} + \bar{b})} \\
                                   &= \bar{a}\bar{b} + ab \\
                                   &= \overline{a \oplus b} \\
                                   &= \bar{a} \oplus b = a \oplus \bar{b} \\
                \end{align*}

            \item \begin{align*}
                    F_2 &= a (c + d) + (\bar{a} + c) \cdot (\bar{b} + c + d) \\
                    \overline{F_2} &= \overline{a (c + d) + (\bar{a} + c) \cdot (\bar{b} + c + d)} \\
                                   &= \overline{a (c + d)} \cdot \overline{(\bar{a} + c)} + \overline{(\bar{b} + c + d)} \\
                                   &= \overline{ac + ad} \cdot a\bar{c} + b\bar{c}\bar{d} \\
                                   &= \overline{ac} \cdot \overline{ad} \cdot a\bar{c} + b\bar{c}\bar{d} \\
                                   &= (\bar{a} + \bar{c}) \cdot (\bar{a} + \bar{d}) \cdot a\bar{c} + b\bar{c}\bar{d} \\
                                   &= (\bar{a} + \bar{a}\bar{d} + \bar{a}\bar{c} + \bar{c}\bar{d}) \cdot a\bar{c} + b\bar{c}\bar{d} \\
                                   &= a\bar{c}\bar{d} + b\bar{c}\bar{d} \\
                                   &= (a + b) \cdot \bar{c}\bar{d} \\
                \end{align*}

        \end{enumerate}

    \subsection{Exercice 4}

    \subsection{Exercice 5}

    \subsection{Exercice 6}

    \subsection{Exercice 7}

\section{Circuits de logique combinatoire}

    \subsection{Exercice 1}

        \includegraphics[width=0.6\linewidth]{./img/2.1.png}

    \subsection{Exercice 2}

        a/ Élaborer l'équation logique $F(S_1,S_0,C,a,b)$ du circuit ci-dessous.

        \includegraphics[width=\linewidth]{./img/2.2.png}

        \begin{equation*}
            F = \bar{c} + \overline{S_0}(ab + \bar{a}\bar{b}S_1)
        \end{equation*}

        b/ Compléter le tableau suivant pour C = 0~:

        $F = \bar{c}$

        \begin{tabularx}{0.8\linewidth}{cccY}
            \toprule
            C & $S_1$ & $S_0$ & $F(a,b)$ \\
            \midrule
            0 & 0 & 0 & 1 \\
            0 & 0 & 1 & 1 \\
            0 & 1 & 0 & 1 \\
            0 & 1 & 1 & 1 \\
            \bottomrule
        \end{tabularx}

        c/ Compléter le tableau suivant pour C = 1~:

        $F = \overline{S_0}(ab + \bar{a}\bar{b}S_1)$

        \begin{tabularx}{0.8\linewidth}{cccY}
            \toprule
            C & $S_1$ & $S_0$ & $F(a,b)$ \\
            \midrule
            1 & 0 & 0 & $ab$ \\
            1 & 0 & 1 & 0 \\
            1 & 1 & 0 & $ab + \bar{a}\bar{b}$ \\
            1 & 1 & 1 & 0 \\
            \bottomrule
        \end{tabularx}

    \subsection{Exercice 3}

        Soit le schéma de $H(A,B,C,D)$ utilisant un multiplexeur à 3 entrées d'adresse.

        \includegraphics[width=0.6\linewidth]{./img/2.3.png}

        a/ Donner la table de vérité de la fonction $H$.

        \begin{tabularx}{0.7\linewidth}{X|YYY|Y|Y}
            \toprule
                   & A & B & C & D & H \\
            \midrule
            0      & 0 & 0 & 0 & 0 & 0 \\
            1      & 0 & 0 & 0 & 1 & 0 \\
            2      & 0 & 0 & 1 & 0 & 0 \\
            3      & 0 & 0 & 1 & 1 & 1 \\
            4      & 0 & 1 & 0 & 0 & 0 \\
            5      & 0 & 1 & 0 & 1 & 1 \\
            6      & 0 & 1 & 1 & 0 & 1 \\
            7      & 0 & 1 & 1 & 1 & 0 \\
            \midrule
            8 (0)  & 1 & 0 & 0 & 0 & 0 \\
            9 (1)  & 1 & 0 & 0 & 1 & 0 \\
            10 (2) & 1 & 0 & 1 & 0 & 0 \\
            11 (3) & 1 & 0 & 1 & 1 & 1 \\
            12 (4) & 1 & 1 & 0 & 0 & 0 \\
            13 (5) & 1 & 1 & 0 & 1 & 1 \\
            14 (6) & 1 & 1 & 1 & 0 & 1 \\
            15 (7) & 1 & 1 & 1 & 1 & 0 \\
            \bottomrule
        \end{tabularx}

        b/ Exprimer $H(A,B,C,D)$ sous la forme disjonctive.

        \begin{align*}
            H(A,B,C,D) &= \bar{A}\bar{B}CD + \bar{A}B\bar{C}D + \bar{A}BC\bar{D} + A\bar{B}CD + AB\bar{C}D + ABC\bar{D} \\
                       &= \sum(3, 5, 6, 11, 13, 14)
        \end{align*}

    \subsection{Exercice 4}

\end{document}
