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

Subversion Repositories ofdm

[/] [ofdm/] [branches/] [avendor/] [vhdl/] [serial.vhd] - Diff between revs 2 and 13

Only display areas with differences | Details | Blame | View Log

Rev 2 Rev 13
library IEEE;
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_1164.all;
use IEEE.STD_LOGIC_ARITH.all;
use IEEE.STD_LOGIC_ARITH.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
use IEEE.STD_LOGIC_UNSIGNED.all;
 
 
--  Uncomment the following lines to use the declarations that are
--  Uncomment the following lines to use the declarations that are
--  provided for instantiating Xilinx primitive components.
--  provided for instantiating Xilinx primitive components.
--library UNISIM;
--library UNISIM;
--use UNISIM.VComponents.all;
--use UNISIM.VComponents.all;
 
 
entity serial is
entity serial is
  port (
  port (
    clk    : in  std_logic;
    clk    : in  std_logic;
    rst    : in  std_logic;
    rst    : in  std_logic;
    input  : in  std_logic_vector(1 downto 0);
    input  : in  std_logic_vector(1 downto 0);
--       tbaux  : out std_logic_vector(1 downto 0);
--       tbaux  : out std_logic_vector(1 downto 0);
    output : out std_logic);
    output : out std_logic);
end serial;
end serial;
 
 
architecture serial of serial is
architecture serial of serial is
  type states is (st0, st1);
  type states is (st0, st1);
  signal state : states;
  signal state : states;
 
 
 
 
  signal aux : std_logic_vector(1 downto 0);
  signal aux : std_logic_vector(1 downto 0);
 
 
begin
begin
 
 
--tbaux <= aux;
--tbaux <= aux;
  process(clk, rst)
  process(clk, rst)
  begin
  begin
    if rst = '1' then
    if rst = '1' then
      aux <= (others => '0');
      aux <= (others => '0');
                output <= '0';
                output <= '0';
    elsif clk'event and clk = '1' then
    elsif clk'event and clk = '1' then
           case state is
           case state is
                   when st0 =>
                   when st0 =>
                           aux <= input;
                           aux <= input;
                                output <= aux(0);
                                output <= aux(0);
                                state <= st1;
                                state <= st1;
                   when st1 =>
                   when st1 =>
                           output <= aux(1);
                           output <= aux(1);
                                state <= st0;
                                state <= st0;
                end case;
                end case;
    end if;
    end if;
  end process;
  end process;
 
 

powered by: WebSVN 2.1.0

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