141 lines
4.9 KiB
TeX
141 lines
4.9 KiB
TeX
\documentclass[a4paper,french,12pt]{article}
|
|
|
|
\title{Logique Programmable --- CTD2}
|
|
\author{}
|
|
\date{Dernière compilation~: \today{} à \currenttime}
|
|
|
|
\usepackage{../../cours}
|
|
\usepackage{enumitem}
|
|
|
|
\begin{document}
|
|
|
|
\maketitle
|
|
|
|
\begin{enumerate}
|
|
|
|
\item Donner l'acronyme d'EDA\@.
|
|
Donner les 3 étapes du workflow pour configurer un FPGA\@.
|
|
|
|
\item Expliquer la différence entre le VHDL de simulation et le VHDL de synthèse.
|
|
Donner le mot clef non synthétisable.
|
|
|
|
Le VHDL de simulation n'est pas forcément synthétisable.
|
|
C'est le VHDL algorithmique, de test, etc.
|
|
Le VHDL de synthèse sert à configurer des FPGA\@.
|
|
|
|
\texttt{wait} n'est pas synthétisable.
|
|
|
|
\item En VHDL, dans l'architecture, à quoi sert un signal~?
|
|
|
|
À interconnecter des process.
|
|
|
|
\item
|
|
|
|
\item
|
|
|
|
\item \begin{itemize}
|
|
\item Rappeler les équations logiques d'un demi-additionneur 2 bits.
|
|
Le décrire en VHDL\@.
|
|
\begin{align*}
|
|
\texttt{s} &= \texttt{a} \oplus \texttt{b} \\
|
|
\texttt{cout} &= \texttt{a} \cdot \texttt{b}
|
|
\end{align*}
|
|
\begin{tabular}{cc|cc}
|
|
\toprule
|
|
A & B & S & Cout \\
|
|
\midrule
|
|
0 & 0 & 0 & 0 \\
|
|
0 & 1 & 1 & 0 \\
|
|
1 & 0 & 1 & 0 \\
|
|
1 & 1 & 0 & 1 \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\begin{lstlisting}[gobble=20]
|
|
library IEEE;
|
|
use IEEE.std_logic_1164.all;
|
|
|
|
entity DA is
|
|
port(
|
|
A: in std_logic;
|
|
B: in std_logic;
|
|
S: out std_logic;
|
|
Cout: out std_logic);
|
|
end DA;
|
|
|
|
architecture arch_DA of DA is
|
|
begin
|
|
S <= A xor B;
|
|
Cout <= A and B;
|
|
end arch_DA;
|
|
\end{lstlisting}
|
|
Variation avec une clock~:
|
|
\begin{lstlisting}[gobble=20]
|
|
library IEEE;
|
|
use IEEE.std_logic_1164.all;
|
|
|
|
entity DA is
|
|
port(
|
|
A: in std_logic;
|
|
B: in std_logic;
|
|
S: out std_logic;
|
|
Cout: out std_logic);
|
|
end DA;
|
|
|
|
architecture arch_DA of DA is
|
|
process (rst, clk)
|
|
begin
|
|
if (rst = '1') then
|
|
S <= 0;
|
|
Cout <= 0;
|
|
elsif(rising_edge(clk))
|
|
S <= A xor B;
|
|
Cout <= A and B;
|
|
endif;
|
|
endprocess;
|
|
end arch_DA;
|
|
\end{lstlisting}
|
|
|
|
\item Rappeler les équations logiques d'un additionneur complet.
|
|
Le décrire en VHDL à partir de la description d'un demi-additionneur.
|
|
\begin{tabular}{ccc|cc}
|
|
\toprule
|
|
full\_a & full\_b & full\_cin & full\_s & full\_cout \\
|
|
\midrule
|
|
0 & 0 & 0 & 0 & 0 \\
|
|
0 & 0 & 1 & 1 & 0 \\
|
|
0 & 1 & 0 & 1 & 0 \\
|
|
0 & 1 & 1 & 0 & 1 \\
|
|
1 & 0 & 0 & 1 & 0 \\
|
|
1 & 0 & 1 & 0 & 1 \\
|
|
1 & 1 & 0 & 0 & 1 \\
|
|
1 & 1 & 1 & 1 & 1 \\
|
|
\bottomrule
|
|
\end{tabular}
|
|
\begin{align*}
|
|
\texttt{full\_s} &= \texttt{full\_a} \oplus \texttt{full\_b} \oplus \texttt{full\_cin} \\
|
|
\texttt{full\_cout} &= \texttt{full\_a} \cdot \texttt{full\_b} + \texttt{full\_cin} \cdot (\texttt{full\_a} \oplus \texttt{full\_b})
|
|
\end{align*}
|
|
\begin{lstlisting}[gobble=20]
|
|
library IEEE;
|
|
use IEEE.std_logic_1164.all;
|
|
|
|
entity DA is
|
|
port(
|
|
full_a: in std_logic;
|
|
full_b: in std_logic;
|
|
full_cin: in std_logic;
|
|
full_s: out std_logic;
|
|
full_cout: out std_logic);
|
|
end DA;
|
|
|
|
architecture arch_DA of DA is
|
|
begin
|
|
full_s <= full_a xor full_b xor full_cin;
|
|
full_cout <= full_a and full_b or full_cin and (full_a xor full_b);
|
|
end arch_DA;
|
|
\end{lstlisting}
|
|
\end{itemize}
|
|
|
|
\end{enumerate}
|
|
|
|
\end{document}
|