收藏 分享(赏)

JH5001二次开发实验指导书(老师)/供综合设计参考.doc

上传人:dzzj200808 文档编号:2339455 上传时间:2018-09-11 格式:DOC 页数:56 大小:348.50KB
下载 相关 举报
JH5001二次开发实验指导书(老师)/供综合设计参考.doc_第1页
第1页 / 共56页
JH5001二次开发实验指导书(老师)/供综合设计参考.doc_第2页
第2页 / 共56页
JH5001二次开发实验指导书(老师)/供综合设计参考.doc_第3页
第3页 / 共56页
JH5001二次开发实验指导书(老师)/供综合设计参考.doc_第4页
第4页 / 共56页
JH5001二次开发实验指导书(老师)/供综合设计参考.doc_第5页
第5页 / 共56页
点击查看更多>>
资源描述

1、JH5001 型通信原理实验系统二次开发实验参考程序第 1 页(共 54 页)JH5001 二次开发参考程序(以下所有程序均调试通过,可作为编程参考)二 OO 三年一月JH5001 型通信原理实验系统二次开发实验参考程序第 2 页(共 54 页)课程设计一、 可变分频器的实验TITLE “Counter“;SUBDESIGN Counter(%pcm input%FSX_PCM,BCLKT,DT_PCM :INPUT;%m sequence%m_Sequence :INPUT;%SW input%SW70 :INPUT;%control mode%Error_SEL10 :INPUT;%MUX

2、 output%MUX_DT :OUTPUT;MUX_CLK :INPUT;Error_ind :OUTPUT;%Test m sequence%m_SEL10 :INPUT;m_test :OUTPUT;Frame_Ind :OUTPUT;)VARIABLEMain_CLK :LCELL;Counter70 :DFF;Mode10 :LCELL;Counter_Out :LCELL;%students pust defined variables at here%Counter_Reset :LCELL;Counter_Out_Buff :DFF;BEGINMain_CLK=MUX_CLK;

3、JH5001 型通信原理实验系统二次开发实验参考程序第 3 页(共 54 页)Mode=M_SEL;%INPUT:Main_CLK: input 256KHz clockMode10: Control counter modeCounter_Out: Counter outputfunction:if Mode=0: Counter_Out=Main_CLK/213;if Mode=1: Counter_Out=Main_CLK/187;if Mode=2: Counter_Out=Main_CLK/156;if Mode=3: Counter_Out=Main_CLK/15;%-studen

4、ts put his program inhereCASE Mode ISWHEN 0 =Counter_Reset=(Counter=212);WHEN 1 =Counter_Reset=(Counter=186);WHEN 2 =Counter_Reset=(Counter=155);WHEN 3 =Counter_Reset=(Counter=14);END CASE;Counter.clk=Main_CLK;CASE (Counter_Reset) ISWHEN 0 =Counter.d=Counter+1;WHEN 1 =Counter.d=0;END CASE;Counter_Ou

5、t_Buff.clk=!Main_CLK;CASE Mode ISWHEN 0 =Counter_Out_Buff.d=(CounterCounter_Out_Buff.d=(CounterCounter_Out_Buff.d=(CounterCounter_Out_Buff.d=(CounterDelay_m6.d=Delay_m5 $ Delay_m4 $ All_Zero;WHEN 1 =Delay_m6.d=Delay_m4 $ Delay_m3 $ All_Zero;WHEN 2 =Delay_m6.d=Delay_m2 $ Delay_m1 $ All_Zero;WHEN 3 =D

6、elay_m6.d=Delay_m1 $ Delay_m0 $ All_Zero;END CASE;m_out=Delay_m6;-fellowing program cant be rewriteablem_test=m_Out;-not used pinMUX_DT=(FSX_PCM,BCLKT,DT_PCM,m_Sequence,SW70,Error_SEL10,MUX_CLK)=0;(Error_ind,Frame_Ind)=0;END;JH5001 型通信原理实验系统二次开发实验参考程序第 7 页(共 54 页)课程设计三、 噪声信号的产生TITLE “noise generatin

7、g“;SUBDESIGN Noise(%MUX input%MUX_DR,MUX_CLKR :INPUT;%PCM output%DR_PCM :OUTPUT;FSR,BCLKR :INPUT;%m output%DR_m :OUTPUT;Frame_Ind :OUTPUT;%SW output%SW_Out70 :OUTPUT;)VARIABLEDelay_m240 :DFF;PCM_Count30,DR_PCM :DFF;BEGIN%input:FSR: PCM frame indicationBCLKR: PCM data input clockOutput:DR_PCM: noise

8、PCM codefunction:this program output noise to PCM decoder%m sequence generating%Delay_m.clk=FSR;Delay_m230.d=Delay_m241;-200000011JH5001 型通信原理实验系统二次开发实验参考程序第 8 页(共 54 页)Delay_m24.d=Delay_m3 $ Delay_m0 $ (Delay_m=0);%PCM output%PCM_Count.d=PCM_Count+1;PCM_Count.clk=BCLKR PCM_COunt.clrn=FSR;DR_PCM.clk

9、=!BCLKR;CASE PCM_Count ISWHEN 0 =DR_PCM.d=Delay_m0;WHEN 1 =DR_PCM.d=Delay_m1;WHEN 2 =DR_PCM.d=Delay_m2;WHEN 3 =DR_PCM.d=Delay_m3;WHEN 4 =DR_PCM.d=Delay_m4;WHEN 5 =DR_PCM.d=Delay_m5;WHEN 6 =DR_PCM.d=Delay_m6;WHEN 7 =DR_PCM.d=Delay_m7;END CASE;%fellowing program cant be writeable%(DR_m,Frame_Ind)=(MUX

10、_DR,MUX_CLKR)=0);SW_Out70=Delay_m70;END;JH5001 型通信原理实验系统二次开发实验参考程序第 9 页(共 54 页)课程设计四、 复接实验TITLE “FRAME“;%=MUXplex data defining=%CONSTANT UW=B“11100100“;CONSTANT DataA=h“11“;CONSTANT DataB=h“22“;SUBDESIGN Frame(%pcm input%FSX_PCM,BCLKT,DT_PCM :INPUT;%m sequence%m_Sequence :INPUT;%SW input%SW70 :INPU

11、T;%control mode%Error_SEL10 :INPUT;%MUX output%MUX_DT :OUTPUT;MUX_CLK :INPUT;Error_ind :OUTPUT;%Test m sequence%m_SEL10 :INPUT;m_test :OUTPUT;Frame_Ind :OUTPUT;)VARIABLE%students define variable in here%Count40,load,Send_buff70 :DFF;MUX_DT :DFF;Send_bit :LCELL;JH5001 型通信原理实验系统二次开发实验参考程序第 10 页(共 54 页

12、)BEGIN%INPUT:MUX_CLK: input multiplex 256KHz clockSW70: multiplex data 1 - 8 bit switch informationDataA: multiplex data A which is define as constantDataB: multiplex data B which is define as constantUW: multiplex data B which is define as constantoutput:MUX_DT: multiplex data outputFrame_Int: Fram

13、e indicationfunction: ultiplexDataA, DataB,SW,UW is combined as one output data stream%=students program put here=%32 byte counter for per frame is 32 bit%Count.clk=MUX_CLK;Count.d=Count+1;Frame_Ind=Count4;%load generating%load.d=(Count=31) # (Count=7) # (Count=15) # (Count=23);load.clk=!MUX_CLK;%lo

14、ad data%Send_buff.clk=load;CASE (Count43) ISWHEN 0 =Send_Buff.d=UW;WHEN 1 =Send_Buff.d=DataA;WHEN 2 =Send_Buff.d=DataB;WHEN 3 =Send_Buff.d=SW;END CASE;%parallel to serial%CASE Count20 ISWHEN 0 =Send_bit=Send_buff7;WHEN 1 =Send_bit=Send_buff6;WHEN 2 =JH5001 型通信原理实验系统二次开发实验参考程序第 11 页(共 54 页)Send_bit=S

15、end_buff5;WHEN 3 =Send_bit=Send_buff4;WHEN 4 =Send_bit=Send_buff3;WHEN 5 =Send_bit=Send_buff2;WHEN 6 =Send_bit=Send_buff1;WHEN 7 =Send_bit=Send_buff0;END CASE;MUX_DT.d=Send_bit;MUX_DT.clk=!MUX_CLK;%fellowing cant be rewriteable%Error_ind=(FSX_PCM,BCLKT,DT_PCM,m_Sequence,Error_SEL10,m_SEL)=0;m_test=G

16、ND;END;JH5001 型通信原理实验系统二次开发实验参考程序第 12 页(共 54 页)课程设计五、 帧同步实验TITLE “deframe“;%=UW define=%CONSTANT UW=B“11100100“;SUBDESIGN DeFrame(%MUX input%MUX_DR,MUX_CLKR :INPUT;%PCM output%DR_PCM :OUTPUT;FSR,BCLKR :INPUT;%m output%DR_m :OUTPUT;Frame_Ind :OUTPUT;%SW output%SW_Out70 :OUTPUT;)VARIABLE%=student vari

17、able define=%-serial to parallelstop_Buff70 :DFF;-load wordLine_Count40 :DFF;Load_UW,UW_Buff70 :DFF;Load_DataA,DataA_Buff70 :DFF;load_DataB,DataB_Buff70 :DFF;load_SW,SW_Buff70 :DFF;%detect period counter%JH5001 型通信原理实验系统二次开发实验参考程序第 13 页(共 54 页)Period_Count90 :DFF;%synchronous%NO_SYN,Reset :DFF;Delay

18、_NO_SYN20 :DFF;Loss_one_Clock,Hold_Count :LCELL;Error_Word_Count40 :DFF;Frame_ind :DFF; BEGIN%INPUT:MUX_CLK: input multiplex 256KHz clockMUX_DR: multiplex dataoutput:DataA: multiplex data A which is define as constantDataB: multiplex data B which is define as constantSW: multiplex SWUW: multiplex da

19、ta UWFrame_Ind: receiver frame indicationfunction: demultiplexDataA, DataB,SW,UW is extracted from input data stream%=students program put here=%Clock for m sequence%Frame_ind.d=(Line_Count=0);Frame_ind.clk=!MUX_CLKR;%serial to parallel%stop_Buff71.d=stop_Buff60;stop_Buff0.d=MUX_DR;stop_Buff.clk=MUX

20、_CLKR;%load word%Line_Count.d=Line_Count+1;Line_Count.clk=(MUX_CLKR -load UW wordload_UW.d=(Line_Count=7);load_UW.clk=!MUX_CLKR;UW_buff.d=stop_Buff;UW_buff.clk=load_UW;-load DataAload_DataA.d=(Line_Count=15);load_DataA.clk=!MUX_CLKR;DataA_buff.d=stop_Buff;DataA_buff.clk=load_DataA;JH5001 型通信原理实验系统二次

21、开发实验参考程序第 14 页(共 54 页)-load DataBload_DataB.d=(Line_Count=23);load_DataB.clk=!MUX_CLKR;DataB_buff.d=stop_Buff;DataB_buff.clk=load_DataB;-load SWload_SW.d=(Line_Count=31);load_SW.clk=!MUX_CLKR;SW_buff.d=stop_Buff;SW_buff.clk=load_SW;SW_Out=SW_buff;%period counter%Period_Count.d=Period_Count+1;-512 fr

22、amePeriod_Count.clk=Load_UW;%synchronous%NO_SYN.d=(Error_Word_Count30);NO_SYN.clk=load_UW;Reset.d=(period_Count=1);Reset.clk=Load_UW;%loss one clock generating%Delay_NO_SYN20.clk=!MUX_CLKR;Delay_NO_SYN21.d=Delay_NO_SYN10;Delay_NO_SYN0.d=NO_SYN;Loss_one_Clock=(Delay_NO_SYN2 $ Delay_NO_SYN1) %eror wor

23、d counter%Error_Word_Count.clrn=!Reset;Error_Word_Count.clk=!load_UW;Hold_Count=(Error_Word_Count=31);CASE (Hold_Count,(UW_Buff=UW) ISWHEN 0 =Error_Word_Count.d=Error_Word_Count+1;WHEN OTHERS =Error_Word_Count.d=Error_Word_Count;END CASE;%fellowing program cant be change%(DR_PCM,DR_m)=(FSR,BCLKR)=0)

24、 $ (DataA_Buff=0) $ (DataB_Buff=0);END;JH5001 型通信原理实验系统二次开发实验参考程序第 15 页(共 54 页)课程设计六、 扰码实验TITLE “Scrambler“;SUBDESIGN Scrambler(%pcm input%FSX_PCM,BCLKT,DT_PCM :INPUT;%m sequence%m_Sequence :INPUT;%SW input%SW70 :INPUT;%control mode%Error_SEL10 :INPUT;%MUX output%MUX_DT :OUTPUT;MUX_CLK :INPUT;Error_

25、ind :OUTPUT;%Test m sequence%m_SEL10 :INPUT;m_test :OUTPUT;Frame_Ind :OUTPUT;)VARIABLEMain_CLK :LCELL;%students pust defined variables at here%Delay_m60 :DFF;m_Out :LCELL;All_Zero,Scrambler_Out :LCELL;Delay_Buffer60 :DFF;BEGINMain_CLK=MUX_CLK;JH5001 型通信原理实验系统二次开发实验参考程序第 16 页(共 54 页)%INPUT:Main_CLK:

26、input 256KHz clockm_SEL10: select output m sequence type for testOUTPUT:Scrambler_Out: scrambler outputm_test: test Data output%-students put his program inhereAll_Zero=(Delay_m=0);Delay_m.clk=!Main_CLK;Delay_m50.d=Delay_m61;CASE m_SEL ISWHEN 0 =Delay_m6.d=Delay_m5 $ Delay_m4 $ All_Zero;WHEN 1 =Dela

27、y_m6.d=VCC;WHEN 2 =Delay_m6.d=GND;WHEN 3 =Delay_m6.d=!Delay_m6;END CASE;m_out=Delay_m6;-scrambler:X7+X4+1Delay_Buffer.clk=!Main_CLK;Delay_Buffer50.d=Delay_Buffer61;Delay_Buffer6.d=Delay_BUffer0 $ Delay_Buffer4 $ m_Out;Scrambler_Out=Delay_Buffer6;-fellowing program cant be rewriteablem_test=m_out;-no

28、t used pinMUX_DT=Scrambler_Out;(Error_ind,Frame_Ind)=(FSX_PCM,BCLKT,DT_PCM,m_Sequence,SW70,Error_SEL10,MUX_CLK)=0;END;JH5001 型通信原理实验系统二次开发实验参考程序第 17 页(共 54 页)课程设计七、 解扰实验TITLE “descrambler“;SUBDESIGN Descrambler(%MUX input%MUX_DR,MUX_CLKR :INPUT;%PCM output%DR_PCM :OUTPUT;FSR,BCLKR :INPUT;%m output%D

29、R_m :OUTPUT;Frame_Ind :OUTPUT;%SW output%SW_Out70 :OUTPUT;)VARIABLECLKR,DR :LCELL;%=student variable define=%Delay_Buffer70 :DFF;Descrambler_Out :LCELL;BEGINCLKR=!MUX_CLKR;DR=MUX_DR;%INPUT:CLKR: input data clockDR: input dataoutput:Descrambler_Out: descrabmler outputscrambler:X7+X4+1JH5001 型通信原理实验系统

30、二次开发实验参考程序第 18 页(共 54 页)%=students program put here=%-scrambler:X7+X4+1Delay_Buffer.clk=CLKR;Delay_Buffer60.d=Delay_Buffer71;Delay_Buffer7.d=DR;DeScrambler_Out=Delay_Buffer7 $ Delay_Buffer4 $ delay_Buffer0;%fellowing program cant be change%DR_m=Descrambler_Out;(Frame_Ind,DR_PCM,SW_Out)=(FSR,BCLKR)=0

31、);END;JH5001 型通信原理实验系统二次开发实验参考程序第 19 页(共 54 页)课程设计八、 BPSK 相位调实验TITLE “BPSK generating“;SUBDESIGN BPSK(%pcm input%FSX_PCM,BCLKT,DT_PCM :INPUT;%m sequence%m_Sequence :INPUT;%SW input%SW70 :INPUT;%control mode%Error_SEL10 :INPUT;%MUX output%MUX_DT :OUTPUT;MUX_CLK :INPUT;Error_ind :OUTPUT;%Test m sequen

32、ce%m_SEL10 :INPUT;m_test :OUTPUT;Frame_Ind :OUTPUT;)VARIABLE%=students pust defined variables at here=%Main_CLK,Data_SEL10 :LCELL;Delay_m20 :DFF;Data,CLKT_Data,BPSK_Out :LCELL;Data01X10 :DFF;Div_32K20 :DFF;Carrier_Ref :LCELL;BEGINJH5001 型通信原理实验系统二次开发实验参考程序第 20 页(共 54 页)Main_CLK=MUX_CLK;Data_SEL=M_SE

33、L;%INPUT:Main_CLK: input 256KHz clock which is carrierData_SEL10: select output m sequence typeOUTPUT:BPSK_Out: BPSK signal outputdescribing: Data rate is 16Kbpsfunction:Data_SEL=0: 01 coder Data_SEL=1: 0011 coder Data_SEL=2: m1 sequence Data_SEL=3: m2 sequence%=student program put here=%-data clock

34、 generatingDiv_32K.clk=Main_CLK;Div_32K.d=Div_32K+1;CLKT_Data=Div_32K2;-test data generatingData01X.clk=!CLKT_Data;Data01X.d=Data01X+1;Delay_m.clk=!CLKT_Data;Delay_m10.d=Delay_m21;Delay_m2.d=delay_m0 $ Delay_m1 $ (Delay_m=0);CASE Data_SEL ISWHEN 0 =-01 coderData=Data01X0;WHEN 1 =-0011 coderData=Data

35、01X1;WHEN 2 =-m sequenceData=Delay_m2;WHEN 3 =Data=GND;END CASE;BPSK_Out=Data $ Main_CLK;Carrier_Ref=Main_CLK;JH5001 型通信原理实验系统二次开发实验参考程序第 21 页(共 54 页)%fellowing program cant be changed%m_test=Data;Error_Ind=BPSK_Out;Frame_Ind=Carrier_Ref;-not used pinMUX_DT=(FSX_PCM,BCLKT,DT_PCM,m_Sequence,SW70,Erro

36、r_SEL10,MUX_CLK)=0;END;JH5001 型通信原理实验系统二次开发实验参考程序第 22 页(共 54 页)课程设计九、 QPSK 相位调制实验TITLE “QPSK generating“;SUBDESIGN QPSK(%pcm input%FSX_PCM,BCLKT,DT_PCM :INPUT;%m sequence%m_Sequence :INPUT;%SW input%SW70 :INPUT;%control mode%Error_SEL10 :INPUT;%MUX output%MUX_DT :OUTPUT;MUX_CLK :INPUT;Error_ind :OUT

37、PUT;%Test m sequence%m_SEL10 :INPUT;m_test :OUTPUT;Frame_Ind :OUTPUT;)VARIABLE%=students pust defined variables at here=%Main_CLK,Data_SEL10 :LCELL;Delay_m20 :DFF;Data,CLKT_Data,QPSK_Out :LCELL;Data01X10 :DFF;Div_32K20 :DFF;Carrier0 :LCELL;Carrier31 :DFF;S_to_P10,QPSK_Data10 :DFF;Symbol_Clock :DFF;C

38、arrier_Ref :LCELL;JH5001 型通信原理实验系统二次开发实验参考程序第 23 页(共 54 页)BEGINMain_CLK=MUX_CLK;Data_SEL=M_SEL;%INPUT:Main_CLK: input 256KHz clock, and carrier is 128KHzData_SEL10: select output m sequence typeOUTPUT:QPSK_Out: QPSK signal outputCarrier_Ref: Carrier outputdescribing: Data rate is 32Kbpsfunction:Data

39、_SEL=0: 01 coder Data_SEL=1: 0011 coder Data_SEL=2: m1 sequence Data_SEL=3: m2 sequence%=student program put here=%-data clock generatingDiv_32K.clk=Main_CLK;Div_32K.d=Div_32K+1;CLKT_Data=Div_32K2;-test data generatingData01X.clk=!CLKT_Data;Data01X.d=Data01X+1;Delay_m.clk=!CLKT_Data;Delay_m10.d=Dela

40、y_m21;Delay_m2.d=delay_m0 $ Delay_m1 $ (Delay_m=0);CASE Data_SEL ISWHEN 0 =-01 coderData=Data01X0;WHEN 1 =-0011 coderData=Data01X1;WHEN 2 =-m sequenceData=Delay_m2;WHEN 3 =Data=GND;JH5001 型通信原理实验系统二次开发实验参考程序第 24 页(共 54 页)END CASE;-carrier generatingCarrier0=Div_32K0;Carrier1.d=Div_32K0;Carrier1.clk=

41、!Main_CLK;Carrier2.d=Carrier1;Carrier2.clk=Main_CLK;Carrier3.d=Carrier2;Carrier3.clk=!Main_CLK;Carrier_Ref=Carrier0;Symbol_Clock.d=!Symbol_Clock;Symbol_Clock.clk=!CLKT_Data;S_To_p1.d=S_to_P0;S_To_P0.d=Data;S_to_P.clk=CLKT_Data;QPSK_Data.d=S_to_P;QPSK_Data.clk=Symbol_Clock;CASE QPSK_Data ISWHEN 0 =QP

42、SK_Out=Carrier0;WHEN 1 =QPSK_Out=Carrier1;WHEN 2 =QPSK_Out=Carrier2;WHEN 3 =QPSK_Out=Carrier3;END CASE;%fellowing program cant be changed%m_test=Data;Error_ind=QPSK_Out;Frame_Ind=Carrier_Ref;-not used pinMUX_DT=(FSX_PCM,BCLKT,DT_PCM,m_Sequence,SW70,Error_SEL10,MUX_CLK)=0;END;JH5001 型通信原理实验系统二次开发实验参考

43、程序第 25 页(共 54 页)课程设计十、 CMI 编码实验TITLE “CMI encoder“;SUBDESIGN CMI_Encoder(%pcm input%FSX_PCM,BCLKT,DT_PCM :INPUT;%m sequence%m_Sequence :INPUT;%SW input%SW70 :INPUT;%control mode%Error_SEL10 :INPUT;%MUX output%MUX_DT :OUTPUT;MUX_CLK :INPUT;Error_ind :OUTPUT;%Test m sequence%m_SEL10 :INPUT;m_test :OUT

44、PUT;Frame_Ind :OUTPUT;)VARIABLEMain_CLK :LCELL;%students pust defined variables at here%m_Buff20 :DFF;Input_Buff,State1 :DFF;Data_CLKT,Coder_Buff :DFF;CMI_Out :LCELL;BEGINJH5001 型通信原理实验系统二次开发实验参考程序第 26 页(共 54 页)Main_CLK=MUX_CLK;%INPUT:Main_CLK: input 256KHz clock, which is CMI output clockData clock

45、 is 128KHz which is derived by studentOUTPUT:CMI_Out: CMI encoder outputDescribing:student generating data clock and test datathen encoder test data by CMI ruler%-students put his program inhere%Data clock generating%Data_CLKT.d=!Data_CLKT;Data_CLKT.clk=Main_CLK;%sequence generating%m_buff20.clk=!Da

46、ta_CLKT;m_Buff10.d=m_Buff21;m_Buff2.d=m_Buff0 $ m_Buff1 $ (m_Buff=0);%input buffer%input_buff.d=m_Buff0;input_buff.clk=Data_CLKT;%1 recoder%State1.d=State1 $ m_Buff0;State1.clk=Data_CLKT;%Coder%Coder_Buff.clk=!Main_CLK;CASE (input_Buff) ISWHEN 0 =Coder_Buff.d=!Data_CLKT;WHEN 1 =COder_Buff.d=State1;E

47、ND CASE;CMI_Out=Coder_Buff;-fellowing program cant be rewriteablem_test=m_Buff0;MUX_DT=CMI_Out;Frame_Ind=State1;JH5001 型通信原理实验系统二次开发实验参考程序第 27 页(共 54 页)-not used pinError_ind=(FSX_PCM,BCLKT,DT_PCM,m_Sequence,SW70,Error_SEL10,MUX_CLK,m_SEL10)=0;END;JH5001 型通信原理实验系统二次开发实验参考程序第 28 页(共 54 页)课程设计十一、 CMI 译码实验TITLE “CMI decoder“;SUBDESIGN CMIDecoder(%MUX input%MUX_DR,MUX_CLKR :INPUT;

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 大学课件

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报