Mudanças entre as edições de "Circuito Serializador - Pedroni VHDL"

De MediaWiki do Campus São José
Ir para navegação Ir para pesquisar
(Limpou toda a página)
 
Linha 1: Linha 1:
__NOTOC__
 
==Estrutura==
 
*Circuito serializador (Recebe logic_vector, sai logic)
 
*Possui um contador de teste afim de depuração (Exemplo do Loop: conta até 3 e joga o bit que está na entrada ṕara a saída.)
 
  
==VHDL==
 
{{Collapse top | Código}}
 
<syntaxhighlight lang=vhdl>
 
library ieee;
 
use ieee.std_logic_1164.all;
 
use ieee.numeric_std.all;
 
 
entity fast_serializer is
 
 
generic (n: integer := 4 ; bits : integer :=2);
 
port(
 
clk: in std_logic;
 
din: in std_logic_vector(n-1 downto 0);
 
count_out: out std_logic_vector(bits-1 downto 0);
 
dout: out std_logic);
 
--sclk_teste: out std_logic);
 
end entity;
 
 
architecture fast_serializer of fast_serializer is
 
 
    signal internal: std_logic_vector(n-1 downto 0);
 
 
 
begin
 
 
process(clk)
 
variable count : integer range 0 to n;
 
begin
 
if(rising_edge(clk)) then
 
count := count +1;
 
if (count= n-1) then --enable to update "internal"
 
internal <= din;
 
elsif (count=n) then --count is 0-to-(n-1)
 
count := 0;
 
end if;
 
dout <= internal(count); --continous serial output
 
end if;
 
count_out <= std_logic_vector(to_unsigned(count, bits));
 
end process;
 
end architecture;
 
 
 
</syntaxhighlight>
 
{{Collapse bottom}}
 
 
==Testbench==
 
{{Collapse top | Código}}
 
<syntaxhighlight lang=vhdl>
 
 
</syntaxhighlight>
 
{{Collapse bottom}}
 
 
*Resultado Funcional:
 
[[Arquivo: .png | 200px]]
 
*Resultado Temporal:
 
[[Arquivo: .png | 200px]]
 
 
==Simulações==
 
{| border="1" cellpadding="5" cellspacing="0" style="text-align: center;"
 
! colspan="1" style="background: #efefef;" | Nº Bits
 
! colspan="1" style="background: #efefef;" | ALMs
 
! colspan="1" style="background: #efefef;" | Delay
 
! colspan="1" style="background: #efefef;" | Potência (mW)
 
|-
 
| x || x || x || x
 
|-
 
| x || x || x || x
 
|-
 
| x || x || x || x
 
|-
 
| x || x || x || x
 
|-
 
|}
 

Edição atual tal como às 07h41min de 30 de março de 2016