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

Subversion Repositories ofdm

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 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 output is
12
    Port ( clk : in std_logic;
13
           rst : in std_logic;
14
           Iout          : in std_logic_vector(13 downto 0);
15
           Qout          : in std_logic_vector(13 downto 0);
16
           Output_enable : in std_logic;
17
           addrout_out   : out  std_logic_vector(5 downto 0);
18
           txserial : out std_logic
19
           );
20
end output;
21
 
22
architecture output of output is
23
 
24
type state is (s0,s1,s2,s3,s4,s5,s6,s7,s8);
25
signal st : state;
26
 
27
signal addr : std_logic_vector(5 downto 0);
28
begin
29
 
30
addrout_out <= addr;
31
 
32
acoes:process(clk,rst)
33
begin
34
   if rst ='1' then
35
      addr <= conv_std_logic_vector(1,6);
36
      txserial <= '1';
37
   elsif clk'event and clk='1' then
38
      case st is
39
         when s0 => -- espera output_enable
40
            txserial <= '1';
41
            addr <= conv_std_logic_vector(1,6);
42
         when s1|s2|s3|s4 => -- qam decoder
43
            txserial <= Iout(13);
44
         when s5|s6|s8 =>
45
            txserial <= Qout(13);
46
         when s7 =>
47
            txserial <= Qout(13);
48
            if addr /= 31 then
49
               addr <= addr+1;
50
            else
51
               addr <= conv_std_logic_vector(1,6);
52
            end if;
53
      end case;
54
   end if;
55
end process;
56
 
57
estados:process(clk,rst)
58
begin
59
   if rst ='1' then
60
      st <= s0;
61
   elsif clk'event and clk='1' then
62
      case st is
63
         when s0 =>
64
            if Output_enable = '1' then
65
               st <= s1;
66
            else
67
               st <= s0;
68
            end if;
69
         when s1 =>
70
            st <= s2;
71
         when s2 =>
72
            st <= s3;
73
         when s3 =>
74
            st <= s4;
75
         when s4 =>
76
            st <= s5;
77
         when s5 =>
78
            st <= s6;
79
         when s6 =>
80
            st <= s7;
81
         when s7=>
82
            st <= s8;
83
         when s8=>
84
            st <= s1;
85
      end case;
86
   end if;
87
end process;
88
end output;

powered by: WebSVN 2.1.0

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