Mudanças entre as edições de "DLP29006-Engtelecom (Diário) - Prof. Marcos Moecke"
Ir para navegação
Ir para pesquisar
Linha 105: | Linha 105: | ||
===Unidade 2 - Introdução ao VHDL e ambienta EDA - QUARTUS=== | ===Unidade 2 - Introdução ao VHDL e ambienta EDA - QUARTUS=== | ||
* 5 ENCONTROS | * 5 ENCONTROS | ||
− | {{collapse top| Unidade 2 - Introdução ao VHDL e ambienta EDA - QUARTUS}} | + | {{collapse top| expand = true | Unidade 2 - Introdução ao VHDL e ambienta EDA - QUARTUS}} |
− | ;Aula 5 (12 abr. | + | ;Aula 5 (12 abr.) |
* Introdução ao VHDL e ambiente EDA - QUARTUS | * Introdução ao VHDL e ambiente EDA - QUARTUS | ||
* Estrutura do código VHDL | * Estrutura do código VHDL |
Edição das 15h39min de 12 de abril de 2022
Registro on-line das aulas
Unidade 1 - Introdução a disciplina
- 4 ENCONTROS
Unidade 1 - Introdução a disciplina | ||||
---|---|---|---|---|
|
Unidade 2 - Introdução ao VHDL e ambienta EDA - QUARTUS
- 5 ENCONTROS
Unidade 2 - Introdução ao VHDL e ambienta EDA - QUARTUS |
---|
library library_name;
use library_name.package_name.all;
entity entity_name is
[generic (
cons_name1: const_type const_value;
cons_name2: const_type const_value;
...
cons_nameN: const_type const_value);]
[port (
signal_name1: mode signal_type;
signal_name2: mode signal_type;
...
signal_nameN: mode signal_type);]
[declarative_part]
[begin
statement_part]
end [entity] [entity_name];
architecture arch_name of entity_name is
[declarative_part]
begin
statement_part
end [architecture] [arch_name];
library std;
use std.standard.all;
entity nand_gate is
port (a, b: in bit; x: out bit);
end entity;
architecture nome_arch of nand_gate is
begin
x <= a nand b;
end architecture;
Exemplo de descrição de um multiplexador de 4 entradas entity mux_novo is
port
(
-- Input ports
X: in bit_vector (3 downto 0);
S : in bit_vector (1 downto 0);
-- Output ports
Y : out bit
);
end entity mux_novo;
-- Implementação com lógica pura
architecture v_logica_pura of mux_novo is
begin
Y <= (X(0) and (not S(1)) and (not S(0))) or
(X(1) and (not S(1)) and (S(0))) or
(X(2) and (S(1)) and (not S(0))) or
(X(3) and (S(1)) and (S(0)));
end architecture Logica_pura;
-- Implementação com WHEN ELSE
architecture v_WHEN of mux_novo is
begin
Y <= X(0) when S = "00" else
X(1) when S = "01" else
X(2) when S = "10" else
X(3);
end architecture v_WHEN;
-- Implementação com WITH SELECT
architecture v_WITH_SELECT of mux_novo is
begin
with S select
Y <= X(0) when "00", -- note o uso da ,
X(1) when "01",
X(2) when "10",
X(3) when others; -- note o uso de others, para todos os demais valores.
-- Não pode ser substituido por "11" mesmo que o signal seja bit_vector.
end architecture v_WITH_SELECT;
-- Implementação com IF ELSE
architecture v_IF_ELSE of mux_novo is
begin
-- Uma arquitetura vazia como essa é denominada de STUB,
-- Pode ser utilizada em um projeto durante para conferir as conexões externas.
-- Posteriormente a arquitetura será descrita.
end architecture v_IF_ELSET;
-- Design Unit que associa a architecture com a entity
configuration cfg_ifsc of mux_novo is
-- for v_WITH_SELECT end for;
for v_WHEN end for;
end configuration;
|