De MediaWiki do Campus São José
Ir para navegação
Ir para pesquisar
Estrutura
- Circuito deserializador/serializador (Recebe logic, sai logic_vector)
- 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
Código
|
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity fast_deserializer is
generic (n: integer := 4; bits : integer :=2);
port(
clk: in std_logic;
din: in std_logic;
count_out: out std_logic_vector(bits-1 downto 0); -- so para depuracao
--sclk_teste: out std_logic;
dout: out std_logic_vector (n-1 downto 0));
end entity;
architecture fast_deserializer of fast_deserializer is
begin
process(clk)
variable count : integer range 0 to n := 0;
variable internal: std_logic_vector (n-1 downto 0);
begin
if(rising_edge(clk)) then
internal(count) := din;
count_out <= std_logic_vector(to_unsigned(count, bits));
count := count +1;
if (count= n) then --enable to update "internal"
dout <= internal;
count := 0;
end if;
end if;
end process;
end architecture;
|
Testbench
200px
200px
Simulações
Nº Bits
|
ALMs
|
Delay
|
Potência (mW)
|
x |
x |
x |
x
|
x |
x |
x |
x
|
x |
x |
x |
x
|
x |
x |
x |
x
|