TP 01 VHDL
TP 01 VHDL
PS VHDL - FPGA
-. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Student -. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
names
-. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
library IEEE;
use IEEE.std_logic_1164.all;
entity f1 is
port (a : in std_logic;
b : in std_logic;
c : in std_logic;
s : out std_logic;
r : out std_logic);
end f1;
architecture rtl of f1 is
begin
s <= (a xor b) xor c;
r <= (a and b) or (c and a) or (c and b);
end rtl;
2. Determine inputs and outputs.
Inputs are: . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Outputs are: . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dr. A. Ganouche
3. Give the corresponding logic circuit (using the following logic gates):
5. Simulate the program with different inputs and give the truth table.
Press Simulate → start simulation → + work → select entity name → OK → View → Wave →
Drag entity name from 'Instance' to 'wave' → right click on entry 'a' → force → value → put 0
or 1 → in the same way force the inputs 'b' and 'c' → then press 'Simulate' → 'Run' → 'Run
100'.
If nothing appears on 'wave' change '0 ns' to '100 ns', then press 'Simulate' → 'Run' → 'Run
100'
The truth table:
7. Change the VHDL description to perform the function f1 ignoring input ‘c’.
Dr. A. Ganouche