bpc-los_04 - VHDL-dat. typy, operátory, soub. příkazy, podm. přiřaz.
Níže je uveden pouze náhled materiálu. Kliknutím na tlačítko 'Stáhnout soubor' stáhnete kompletní formátovaný materiál ve formátu PDF.
LIBRARY ieee; -- Knihovna IEEE
USE ieee.std_logic_1164.ALL; -- Knihovní balík std_logic_1164
-- Deklarace entity mux4
ENTITY mux4 IS
PORT (a, b, c, d: IN std_logic; -- Datové vstupy
i: IN std_logic_vector(1 DOWNTO 0); -- Výběrové vstupy
y: OUT std_logic); -- Výstup
END mux4;
-- Popis architektury mux4
ARCHITECTURE Behavioral OF mux4 IS
BEGIN y <= a WHEN (i = "00") ELSE -- Podmíněné přiřazení
b WHEN (i = "01") ELSE c WHEN (i = "10") ELSE d;
END Behavioral;
Příklad použití podmíněného přiřazení
LIBRARY ieee; -- Knihovna IEEE
USE ieee.std_logic_1164.ALL; -- Knihovní balík std_logic_1164
-- Deklarace entity mux4p
ENTITY mux4p IS
PORT (a, b, c, d: IN std_logic; -- Datové vstupy
i: IN std_logic_vector(3 DOWNTO 0); -- Výběrové vstupy
y: OUT std_logic); -- Výstup
END mux4p;
-- Popis architektury mux4p
ARCHITECTURE Behavioral OF mux4p IS
BEGIN y <= a WHEN (i(3) = '1') ELSE -- Podmíněné přiřazení
b WHEN (i(2) = '1') ELSE c WHEN (i(1) = '1') ELSE d WHEN (i(0) = '1') ELSE
'0';
END Behavioral;
Jazyk VHDL - seznam klíč. slov
architecture
access after alias all and
abs
array assert attribute
begin block body buffer bus
case component configuration constant
disconnect downto
else elsif end entity exit
file for function
generate generic group guarded
if impure in inertial inout is
label library linkage literal loop
map mod
nand new next
not null
of on open or others outpackage port postponed procedure process pure
range record register reject rem report return rol ror
select severity shared signal sla sll sra srl subtype
then to transport type
unaffected units until use
variable
wait when while with
xnor xor
nor
Jazyk VHDL - seznam klíč. slov
architecture
access after alias all and
assert attribute
begin block body buffer bus
case component configuration constant
disconnect
elsif end entity exit
file for function
generate generic group guarded
if impure in inertial inout is
label library linkage literal loop