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

Subversion Repositories ofdm

[/] [ofdm/] [branches/] [avendor/] [vhdl/] [qam.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 qam is
12
  port (
13
    clk   : in  std_logic;
14
    rst   : in  std_logic;
15
    input : in  std_logic_vector(1 downto 0);
16
    Iout  : out std_logic_vector(11 downto 0);
17
    Qout  : out std_logic_vector(11 downto 0));
18
end qam;
19
 
20
architecture qam of qam is
21
 
22
begin
23
 
24
  process (clk, rst)
25
    constant mais1  : std_logic_vector(11 downto 0) := "001100000000";
26
    constant menos1 : std_logic_vector(11 downto 0) := "110100000000";
27
  begin
28
    if rst = '1' then
29
      Iout <= (others => '0');
30
      Qout <= (others => '0');
31
    elsif clk'event and clk = '1' then
32
-- 0123.45678901 bits
33
--      0011.00000000 = +1
34
--      1101.00000000 = -1
35
 
36
--                Q
37
--        o       |       o 
38
--        01      |       00
39
--                |
40
--        ----------------- I
41
--                |
42
--        11      |       10
43
--        o       |        o
44
 
45
      case input is
46
        when "00" =>
47
          Iout <= mais1;
48
          Qout <= mais1;
49
        when "01" =>
50
          Iout <= menos1;
51
          Qout <= mais1;
52
        when "10" =>
53
          Iout <= mais1;
54
          Qout <= menos1;
55
        when others =>
56
          Iout <= menos1;
57
          Qout <= menos1;
58
      end case;
59
    end if;
60
  end process;
61
 
62
end qam;

powered by: WebSVN 2.1.0

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