?? pl_dpsk2.vhd
字號:
library ieee;
use ieee.std_logic_arith.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity PL_DPSK2 is
port(clk :in std_logic; --系統(tǒng)時鐘
x :in std_logic; --整形后的方波輸入信號
y :out std_logic); --絕對碼輸出信號
end PL_DPSK2;
architecture behav of PL_DPSK2 is
signal q:integer range 0 to 511:=0; --計數(shù)器
signal xx1,xx2:std_logic; --寄存相對碼
begin
process(clk,x) --此進程完成相對碼到絕對碼的轉(zhuǎn)換
begin
if clk'event and clk='1' then
if q=0 then q<=1;xx1<=x;xx2<=xx1; --用xx2寄存前一個碼元周期內(nèi)的相對碼信號
--用xx1寄存當(dāng)前周期的相對碼信號
elsif q=1 then q<=2;
if xx1=xx2 then y<='0';--如果相對碼沒有變化,則解調(diào)出'0'
else y<='1'; --如果相對碼發(fā)生變化,則解調(diào)出'1'
end if;
else q<=q+1;
end if;
end if;
end process;
end behav;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -