VHDL Code for the I/Q Convolver

After setting up a design library, typically, you would use the ModelSim Editor to create and modify your VHDL code. For this tutorial, open and examine the existing file iqconv.vhd. This section highlights areas of code in iqconv.vhd that are of interest for a ModelSim and MATLAB test bench:

  1. Start ModelSim from MATLAB by issuing a call to the MATLAB vsim function.

  2. In ModelSim, change your current directory to the /vhdl/manchester subdirectory you created in Setting Up Tutorial Files. If you set up the files elsewhere, adjust the path accordingly.

    ModelSim> cd C:/MyPlayArea/vhdl/manchester
    
  3. Open iqconv.vhd in the edit window with the edit command, as follows:

    ModelSim> edit iqconv.vhd
    

    ModelSim opens its edit window and displays the VHDL code for iqconv.vhd.

  4. Search for ENTITY iqconv. This statement defines the entity iqconv.

    ENTITY iqconv IS
    PORT (
      clk     : IN std_logic ;
      enable  : IN std_logic ;
      reset   : IN std_logic ;
    
      i_wf : IN std_logic ;
      q_wf : IN std_logic ;
      samp : IN std_logic ;
    
      isum : OUT std_logic_vector(4 DOWNTO 0);
      qsum : OUT std_logic_vector(4 DOWNTO 0);
      )
    END iqconv;
    

    You will be verifying this entity in the MATLAB environment. Note the following:

  5. Browse through the rest of iqconv.vhd. The remaining code defines a behavioral architecture for iqconv that

    1. Performs an XOR on the data with each of the I/Q waveforms generated by the state counter.

    2. Performs the XOR operation.

    3. Clocks the isum and qsum into a register.

  6. Close the ModelSim edit window.


Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS