Baixe o app para aproveitar ainda mais
Prévia do material em texto
Prof. Dr. Dilmar Malheiros Meira Curso de Engenharia de Controle e Automação Implementação de Sistemas Digitais com Dispositivos Lógicos Programáveis (PLD) Sistemas Digitais Prof. Dr. Dilmar M. Meira 2 Circuito Integrado Sistemas Digitais Prof. Dr. Dilmar M. Meira 3 Circuito Integrado (II) Sistemas Digitais Prof. Dr. Dilmar M. Meira 4 Chip Sistemas Digitais Prof. Dr. Dilmar M. Meira 5 Chip (II) Sistemas Digitais Prof. Dr. Dilmar M. Meira 6 Chip (III) Sistemas Digitais Prof. Dr. Dilmar M. Meira 7 “Wafer” de silício Sistemas Digitais I Prof. Dilmar M. Meira 8 Sistemas “Customizáveis” Lógica Padrão (Standard Logic) Microprocessadores “Chips” Digitais Sistemas Digitais I Prof. Dilmar M. Meira 9 Sistemas “Customizados” / “Customizáveis” Dispositivos Lógicos Programáveis (PLD) “Standard Cells” “Gate Arrays” “Full Custom” Sistemas Digitais I Prof. Dilmar M. Meira 10 Dispositivos Lógicos Programáveis (PLD) Princípio de funcionamento Sistemas Digitais I Prof. Dilmar M. Meira 11 Dispositivos Lógicos Programáveis (PLD) SPLD CPLD FPGA Sistemas Digitais I Prof. Dilmar M. Meira 12 Dispositivos Lógicos Programáveis (PLD) Arquitetura PAL (Programmable Array Logic) Sistemas Digitais I Prof. Dilmar M. Meira 13 Dispositivos Lógicos Programáveis (PLD) Arquitetura PLA (Programmable Logic Array) Sistemas Digitais I Prof. Dilmar M. Meira 14 Dispositivos Lógicos Programáveis (PLD) Arquitetura GAL (Generic PAL) Sistemas Digitais I Prof. Dilmar M. Meira 15 Dispositivos Lógicos Programáveis (PLD) Arquitetura CPLD (Complex PLD) Sistemas Digitais I Prof. Dilmar M. Meira 16 Dispositivos Lógicos Programáveis (PLD) Arquitetura FPGA (Field Programmable Gate Array) CLB: Configurable Logic Block Sistemas Digitais I Prof. Dilmar M. Meira 17 Sistemas Digitais I Prof. Dilmar M. Meira 18 Sistemas Digitais I Prof. Dilmar M. Meira 19 Sistemas Digitais I Prof. Dilmar M. Meira 20 Sistemas Digitais I Prof. Dilmar M. Meira 21 Library Entity Architecture Unidades Fundamentais da linguagem Sistemas Digitais I Prof. Dilmar M. Meira 22 Library: Contém uma lista de todas as bibliotecas utilizadas no projeto (“design”) do circuito. Exemplo: LIBRARY ieee; USE ieee.std_logic.1164.all; LIBRARY std; USE std.standard.all; Unidades Fundamentais da linguagem Sistemas Digitais I Prof. Dilmar M. Meira 23 Entity: Contém uma lista de todos os pinos de entrada e de saída (PORTS) do circuito. Exemplo: ENTITY and_gate IS PORT (a, b : IN BIT; x : OUT BIT); END and_gate; Unidades Fundamentais da linguagem Sistemas Digitais I Prof. Dilmar M. Meira 24 Architecture: Contém uma descrição de como o circuito deve ser construído ou de como ele deve se comportar. Exemplo: ARCHITECTURE arq_1 OF and_gate IS BEGIN x <= a AND b; END arq_1; Unidades Fundamentais da linguagem Sistemas Digitais I Prof. Dilmar M. Meira 25 LIBRARY std; USE std.standard.all; ENTITY and_gate IS PORT ( a, b : IN BIT; x : OUT BIT); END and_gate; ARCHITECTURE arq_1 OF and_gate IS BEGIN X <= a AND b; END arq_1; Uma descrição Completa Sistemas Digitais I Prof. Dilmar M. Meira 26 BIT (‘0’, ‘1’) BIT_VECTOR STD_LOGIC (‘X’, ‘0’, ‘1’, ‘Z’, ‘W’, ‘L’, ‘H’, ‘-’) STD_LOGIC_VECTOR BOOLEAN (true, false) INTEGER (-2 147 483 647 até +2 147 483 647) NATURAL (0 até +2 147 483 647) REAL (-1.0E38 até +1.0E38) SIGNED UNSIGNED Outros tipos, definidos pelo usuário Principais tipos de dados Sistemas Digitais I Prof. Dilmar M. Meira 27 Para atribuir valores a um sinal (SIGNAL): <= Para atribuir valores a uma variável (VARIABLE): := Para atribuir um valor a um elemento de um vetor: => Operadores lógicos: NOT, AND, OR, NAND, NOR, XOR, XNOR Operadores aritméticos: +, -, *, / Operadores de comparação: =, /=, <, <=, >= Operadores de concatenação: &, ( , , ,) Principais operadores 28 Sistemas Digitais Prof. Dr. Dilmar M. Meira O conceito de concorrência em VHDL Sistemas Digitais I Prof. Dilmar M. Meira 29 Exemplos de código concorrente Sistemas Digitais I Prof. Dilmar M. Meira 30 -- Exemplo: Projeto, em VHDL, de um multiplexador equivalente ao C.I. TTL 74LS151 Entity MUX74151 is port (E: in bit_vector(7 downto 0); S: in bit_vector(2 downto 0); H : in bit; Y : buffer bit; W : out bit ); end MUX74151; -- H é ativa no nível baixo; -- W é a saída invertida; Architecture equacao of MUX74151 is begin Y <= not H and ( (not S(2) and not S(1) and not S(0) and E(0)) or (not S(2) and not S(1) and S(0) and E(1)) or (not S(2) and S(1) and not S(0) and E(2)) or (not S(2) and S(1) and S(0) and E(3)) or ( S(2) and not S(1) and not S(0) and E(4)) or ( S(2) and not S(1) and S(0) and E(5)) or ( S(2) and S(1) and not S(0) and E(6)) or ( S(2) and S(1) and S(0) and E(7)) ); W <= not Y; end equacao; Sistemas Digitais I Prof. Dilmar M. Meira 31 -- Exemplo: Projeto, em VHDL, de um codificador simples, com prioridade entity CODIFICADOR is port ( INPUT : in bit_vector(7 downto 0); A : out integer range 0 to 7; VALIDO: out bit ); end CODIFICADOR; architecture SIMPLES of CODIFICADOR is begin A <= 7 when INPUT(7) = '1' else 6 when INPUT(6) = '1' else 5 when INPUT(5) = '1' else 4 when INPUT(4) = '1' else 3 when INPUT(3) = '1' else 2 when INPUT(2) = '1' else 1 when INPUT(1) = '1' else 0; VALIDO <= INPUT(7) or INPUT(6) or INPUT(5) or INPUT(4) or INPUT(3) or INPUT(2) or INPUT(1) or INPUT(0); end SIMPLES; Sistemas Digitais I Prof. Dilmar M. Meira 32 -- Exemplo: Projeto, em VHDL, de um decodificador equivalente ao C.I. TTL 74LS138 Entity LS74138A is port ( a: in bit_vector (5 downto 0); y: out bit_vector (7 downto 0) ); end LS74138A; -- a(5), a(4) e a(3) são as entradas de habilitação. a(5) éativa no nível alto, enquanto que -- a(4) e a(3) são ativas no nível baixo. -- a(2), a(1) e a(0) são as entradas de dados, em binário. -- Y(7) a y(0) são as saídas de dados decodificadas, ativas no nível baixo. Architecture simples of LS74138A is begin with a select y <= "11111110" when "100000", "11111101" when "100001", "11111011" when "100010", "11110111" when "100011", "11101111" when "100100", "11011111" when "100101", "10111111" when "100110", "01111111" when "100111", "11111111" when others; end simples;
Compartilhar