Mudanças entre as edições de "DLP29007-2019-2"

De MediaWiki do Campus São José
Ir para navegação Ir para pesquisar
Linha 124: Linha 124:
 
   y(7) <= p0123 xor p4567;
 
   y(7) <= p0123 xor p4567;
 
end optimal_tree_arch;
 
end optimal_tree_arch;
 +
 +
</syntaxhighlight>
 +
 +
 +
= Aula 30/08/2019 –  Eficiência de Circuitos Sequenciais =
 +
 +
 +
 +
<syntaxhighlight lang=vhdl>
 +
 +
--=============================
 +
-- Listing 9.1 async clear
 +
--=============================
 +
library ieee;
 +
use ieee.std_logic_1164.all;
 +
use ieee.numeric_std.all;
 +
entity mod10_counter is
 +
  port(
 +
      clk, reset: in std_logic;
 +
      q: out std_logic_vector(3 downto 0)
 +
  );
 +
end mod10_counter;
 +
 +
--architecture poor_async_arch of mod10_counter is
 +
--  signal r_reg: unsigned(3 downto 0);
 +
--  signal r_next: unsigned(3 downto 0);
 +
--  signal async_clr: std_logic;
 +
--begin
 +
--  -- register
 +
--  process(clk,async_clr)
 +
--  begin
 +
--      if (async_clr='1') then
 +
--        r_reg <= (others=>'0');
 +
--      elsif (clk'event and clk='1') then
 +
--        r_reg <= r_next;
 +
--      end if;
 +
--  end process;
 +
--  -- asynchronous clear
 +
--  async_clr <= '1' when (reset='1' or r_reg="1010") else
 +
--                '0';
 +
--  -- next state logic
 +
--  r_next <= r_reg + 1;
 +
--  -- output logic
 +
--  q <= std_logic_vector(r_reg);
 +
--end poor_async_arch;
 +
 +
 +
--=============================
 +
-- Listing 9.2
 +
--=============================
 +
architecture two_seg_arch of mod10_counter is
 +
  signal r_reg: unsigned(3 downto 0);
 +
  signal r_next: unsigned(3 downto 0);
 +
begin
 +
  -- register
 +
  process(clk,reset)
 +
  begin
 +
      if (reset='1') then
 +
        r_reg <= (others=>'0');
 +
      elsif (clk'event and clk='1') then
 +
        r_reg <= r_next;
 +
      end if;
 +
  end process;
 +
  -- next-state logic
 +
  r_next <= (others=>'0') when r_reg=9 else
 +
            r_reg + 1;
 +
  -- output logic
 +
  q <= std_logic_vector(r_reg);
 +
end two_seg_arch;
  
 
</syntaxhighlight>
 
</syntaxhighlight>

Edição das 17h15min de 30 de agosto de 2019

Dispositivos Lógicos Programáveis 2: Diário de Aula 2019-2

Links Úteis

Materiais de Aula

Aula 29/07/2019 – Apresentação

  • Apresentação do professor.
  • Apresentação da disciplina.
  • Projetos com FPGA

Aula 02/08/2019 – Complexidade e Projeto de Sistemas Digitais


Aula 09/08/2019 – Complexidade e Projeto de Sistemas Digitais (cont.)


Aula 12/08/2019 – Não Houve Aula


Aula 16/08/2019 – Síntese do VHDL



Aula 23/08/2019 – Eficiência de Circuitos Combinacionais

  • Leitura recomendada:
    • Capítulo 7 do livro do Chu

Aula 26/08/2019 – Eficiência de Circuitos Combinacionais


--=============================
-- Listing 7.19 reduced-xor-vector circuit
--=============================
library ieee;
use ieee.std_logic_1164.all;
entity reduced_xor_vector is
   port(
      a: in std_logic_vector(7 downto 0);
      y: out std_logic_vector(7 downto 0)
   );
end reduced_xor_vector;

architecture direct_arch of reduced_xor_vector is
begin
   y(0) <= a(0);
   y(1) <= a(1) xor a(0);
   y(2) <= a(2) xor a(1) xor a(0);
   y(3) <= a(3) xor a(2) xor a(1) xor a(0);
   y(4) <= a(4) xor a(3) xor a(2) xor a(1) xor a(0);
   y(5) <= a(5) xor a(4) xor a(3) xor a(2) xor a(1) xor a(0);
   y(6) <= a(6) xor a(5) xor a(4) xor a(3) xor a(2) xor a(1)
           xor a(0);
   y(7) <= a(7) xor a(6) xor a(5) xor a(4) xor a(3) xor a(2)
           xor a(1) xor a(0);
end direct_arch;



--=============================
-- Listing 7.23
--=============================
architecture optimal_tree_arch of reduced_xor_vector is
   signal p01, p23, p45, p67, p012,
          p0123, p456, p4567: std_logic;
begin
   p01 <= a(0) xor a(1);
   p23 <= a(2) xor a(3);
   p45 <= a(4) xor a(5);
   p67 <= a(6) xor a(7);
   p012 <= p01 xor a(2);
   p0123 <= p01 xor p23;
   p456 <= p45 xor a(6);
   p4567 <= p45 xor p67;
   y(0) <= a(0);
   y(1) <= p01;
   y(2) <= p012;
   y(3) <= p0123;
   y(4) <= p0123 xor a(4);
   y(5) <= p0123 xor p45;
   y(6) <= p0123 xor p456;
   y(7) <= p0123 xor p4567;
end optimal_tree_arch;


Aula 30/08/2019 – Eficiência de Circuitos Sequenciais

--=============================
-- Listing 9.1 async clear
--=============================
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity mod10_counter is
   port(
      clk, reset: in std_logic;
      q: out std_logic_vector(3 downto 0)
   );
end mod10_counter;

--architecture poor_async_arch of mod10_counter is
--   signal r_reg: unsigned(3 downto 0);
--   signal r_next: unsigned(3 downto 0);
--   signal async_clr: std_logic;
--begin
--   -- register
--   process(clk,async_clr)
--   begin
--      if (async_clr='1') then
--         r_reg <= (others=>'0');
--      elsif (clk'event and clk='1') then
--         r_reg <= r_next;
--      end if;
--   end process;
--   -- asynchronous clear
--   async_clr <= '1' when (reset='1' or r_reg="1010") else
--                '0';
--   -- next state logic
--   r_next <= r_reg + 1;
--   -- output logic
--   q <= std_logic_vector(r_reg);
--end poor_async_arch;


--=============================
-- Listing 9.2
--=============================
architecture two_seg_arch of mod10_counter is
   signal r_reg: unsigned(3 downto 0);
   signal r_next: unsigned(3 downto 0);
begin
   -- register
   process(clk,reset)
   begin
      if (reset='1') then
         r_reg <= (others=>'0');
      elsif (clk'event and clk='1') then
         r_reg <= r_next;
      end if;
   end process;
   -- next-state logic
   r_next <= (others=>'0') when r_reg=9 else
             r_reg + 1;
   -- output logic
   q <= std_logic_vector(r_reg);
end two_seg_arch;