Circuito Serializador - Pedroni VHDL
Ir para navegação
Ir para pesquisar
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
Código |
---|
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;
|
Testbench
Código |
---|
- Resultado Funcional:
- Resultado Temporal:
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 |