QPSK Modulation/Demodulation VHDL Source Code
Advertisement
This page provides VHDL source code for QPSK modulation and demodulation.
VHDL Code
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- entity declaration
entity qpsk_mod_n is
Port (
clk : in std_logic; -- global clock
valid_in : in std_logic; -- when high din is valid
data_in : in std_logic_vector(1 downto 0); -- data in
reset : in std_logic; -- asynchronous active high reset
valid_out : out std_logic; -- when high real and imag is valid
dout_real, dout_imag : out std_logic_vector(15 downto 0) -- real and imag out
);
end qpsk_mod_n;
-- architecture declaration
architecture Behavioral of qpsk_mod_n is
signal sig_valid_out : std_logic;
signal valid_out1 : std_logic;
signal sig_valid_out1 : std_logic;
begin
-- process to map QPSK constellation
process(clk, reset)
begin
if(reset = '1') then
dout_real <= x"0000";
dout_imag <= x"0000";
valid_out1 <= '0';
sig_valid_out <= '0';
sig_valid_out1 <= '0';
elsif(clk = '1' and clk'event) then
valid_out1 <= '1';
sig_valid_out <= valid_out1;
sig_valid_out1 <= sig_valid_out;
if valid_in = '1' then
case data_in is
when "00" =>
dout_imag <= x"2d41";
dout_real <= x"2d41";
valid_out1 <= '1'; -- Based on the input data assign
when "01" =>
dout_imag <= x"D2BF"; -- values to the output ports
dout_real <= x"2d41";
valid_out1 <= '1';
when "10" =>
dout_imag <= x"2d41";
dout_real <= x"D2BF";
valid_out1 <= '1';
when "11" =>
dout_imag <= x"D2BF";
dout_real <= x"D2BF";
valid_out1 <= '1';
when others =>
dout_imag <= x"D2BF";
dout_real <= x"D2BF";
valid_out1 <= '1';
end case;
else
dout_imag <= x"0000";
dout_real <= x"0000";
valid_out1 <= '0';
end if;
end if;
end process;
valid_out <= valid_out1;
end behavioral;
Continue Learning Modulation Types
- AM Vs. FM Vs. PM : Difference between Analog Modulation Techniques
- ASK Vs. FSK Vs. PSK : Difference between Digital Modulation Techniques
- PAM Vs. PWM Vs. PPM : Difference between Pulse Modulation Techniques
- BPSK Vs. QPSK : Key Differences
- 16-QAM Vs. 64-QAM Vs. 256-QAM : Key Differences
- 512-QAM Vs. 1024-QAM Vs. 2048-QAM Vs. 4096-QAM
- 4096QAM Modulation Used in Wi-Fi 7
- MSK Vs. GMSK : Modulation Technique used in GSM
- LORa Modulation Used in LoRaWAN
- 10% ASK & 100% ASK Modulation used in NFC
- OOK Vs. VPPM Vs. CSK : Visible Light Communication (VLC) Modulation Techniques
- QPSK Vs. OQPSK Vs. PI/4 QPSK
- PAM4 Modulation Used in Gigabit Ethernet
- CCK Vs. DSSS Vs. OFDM Used in WLAN (Wi-Fi) Standards
Explore VHDL Comms, Encoding & Conversions
- Binary to Gray Code Conversion in VHDL
- Gray to Binary Conversion (VHDL)
- 2-bit Parallel to Serial Conversion (VHDL Code)
- 2-bit Serial to Parallel Conversion in VHDL
- Convolutional Encoder (VHDL Source Code)
- RS Encoder (VHDL Source Code)
- Scrambler / Descrambler (VHDL Code)
- Interleaver / Deinterleaver (VHDL Source Code)
- BPSK Modulation (VHDL Source Code)
- QPSK Modulation Demodulation (VHDL Source Code)
- 16QAM Modulation (VHDL Source Code)
- 64QAM Modulation (VHDL Source Code)
- Mapper / Demapper (VHDL Source Code)
- IFFT / FFT (VHDL Source Code)
- Radix-4 Butterfly (VHDL Source Code)
