OpenCores
URL https://opencores.org/ocsvn/ofdm/ofdm/trunk

Subversion Repositories ofdm

[/] [ofdm/] [branches/] [avendor/] [vhdl/] [serial.vhd] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 tmsiqueira
library IEEE;
2
use IEEE.STD_LOGIC_1164.all;
3
use IEEE.STD_LOGIC_ARITH.all;
4
use IEEE.STD_LOGIC_UNSIGNED.all;
5
 
6
--  Uncomment the following lines to use the declarations that are
7
--  provided for instantiating Xilinx primitive components.
8
--library UNISIM;
9
--use UNISIM.VComponents.all;
10
 
11
entity serial is
12
  port (
13
    clk    : in  std_logic;
14
    rst    : in  std_logic;
15
    input  : in  std_logic_vector(1 downto 0);
16
--       tbaux  : out std_logic_vector(1 downto 0);
17
    output : out std_logic);
18
end serial;
19
 
20
architecture serial of serial is
21
  type states is (st0, st1);
22
  signal state : states;
23
 
24
 
25
  signal aux : std_logic_vector(1 downto 0);
26
 
27
begin
28
 
29
--tbaux <= aux;
30
  process(clk, rst)
31
  begin
32
    if rst = '1' then
33
      aux <= (others => '0');
34
                output <= '0';
35
    elsif clk'event and clk = '1' then
36
           case state is
37
                   when st0 =>
38
                           aux <= input;
39
                                output <= aux(0);
40
                                state <= st1;
41
                   when st1 =>
42
                           output <= aux(1);
43
                                state <= st0;
44
                end case;
45
    end if;
46
  end process;
47
end serial;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.