Mudanças entre as edições de "DI2022802 2021 1 AULA16"
Ir para navegação
Ir para pesquisar
Linha 21: | Linha 21: | ||
#Realizar o projeto de um contador síncrono, com uma sequência pré-definida em VHDL e simular. | #Realizar o projeto de um contador síncrono, com uma sequência pré-definida em VHDL e simular. | ||
#Comentar os exemplos: | #Comentar os exemplos: | ||
− | + | ::Exemplo 1 | |
<syntaxhighlight lang=vhdl> | <syntaxhighlight lang=vhdl> | ||
library ieee; | library ieee; | ||
Linha 47: | Linha 47: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ::Exemplo 2 | |
<syntaxhighlight lang=vhdl> | <syntaxhighlight lang=vhdl> | ||
library ieee; | library ieee; | ||
Linha 79: | Linha 79: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ::Exemplo 3 | |
<syntaxhighlight lang=vhdl> | <syntaxhighlight lang=vhdl> | ||
library ieee; | library ieee; |
Edição das 13h09min de 6 de setembro de 2021
Lista de Exercícios para AT2
Parte 1 - VHDL
- O que significa CPLD, FPGA e VHDL?
- Quais as principais vantagens no uso do VHDL?
- Quais as etapas de um ciclo de projeto de sistemas em VHDL?
- Qual a diferença entre uma Entidade (entity) e uma Arquitetura (architecture)?
- O que são os Ports?
- Que tipo de pinos (ports) existem e onde são aplicados?
- O que é uma Descrição comportamental?
- O que é uma Descrição por fluxo de dados?
- O que é uma Descrição estrutural?
- Quais são as regras para a formação dos Identificadores?
- O que é uma constante?
- Qual a diferença de Sinais e de Variáveis?
- Quais os tipos de dados disponíveis em VHDL?
- Projetar e simular:
- Biestável tipo JK com clock e borda de subida, com descrição comportamental.
- Idem, com Preset e Clear assíncronos
- Realizar o projeto de um contador síncrono, com uma sequência pré-definida em VHDL e simular.
- Comentar os exemplos:
- Exemplo 1
library ieee;
use ieee.std_logic_1164.all;
entity FF_D is
port
(
D : in std_logic;
clk : in std_logic;
Q : out std_logic
);
end FF_D;
architecture Ex1 of FF_D is
begin
-- Update the register output on the clock's rising edge
process (clk)
begin
if (rising_edge(clk)) then
Q <= D;
end if;
end process;
end Ex1;
- Exemplo 2
library ieee;
use ieee.std_logic_1164.all;
ENTITY ff_jk is
port(j,k,clk: in bit;
q: out bit);
END ff_jk;
ARCHITECTURE teste of ff_jk is
BEGIN
process(clk)
variable temp : bit :='0';
begin
if( falling_edge(clk) ) then
if (j='1' and k='0') then
temp:='1';
elsif (j='0' and k='1') then
temp:='0';
elsif (j='1' and k='1') then
temp:= not temp;
else
temp:=temp;
end if;
q<=temp;
end if;
end process;
END teste;
- Exemplo 3
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
entity CONTADOR is
port(
CLK: in std_logic;
RESET: in std_logic;
ENABLE: in std_logic;
Q: out std_logic_vector (3 downto 0)
);
end CONTADOR;
architecture CONTADOR_arq of CONTADOR is
begin
process(CLK,RESET)
variable X: integer range 0 to 15;
begin
if (RESET = '1') then
X := 0;
elsif (CLK'event and CLK='1') then
if (ENABLE = '1') then
X := X + 1;
end if;
end if;
Q <= conv_std_logic_vector(X, 4);
end process;
end CONTADOR_arq;