通信原理课程设计______基于fpga的时分多路数字基带传输系统的设计与开发(编辑修改稿)内容摘要:

county:=not county。 else dataouthh=39。 039。 dataouthl=39。 139。 county:=not county。 end if。 end if。 else temp(0):=datain。 输入为 0 时处理 4 位寄存器 count0:=count0+1。 if count0=4 then检测到 0000,处理 4 位寄存器 count0:=0。 count1:=(count1 rem 2)。 两个四连零 间 1 的 奇偶 if count1=1 then两个四连零 间 1 的 奇偶 count1:=0。 temp:=0001。 dataouthh=39。 039。 dataouthl=39。 039。 county:=not county。 else count1:=0。 两个四连零 间 1 的 偶 temp:=1001。 if county then dataouthh=39。 139。 dataouthl=39。 039。 else dataouthh=39。 039。 dataouthl=39。 139。 22 end if。 end if。 else if temp(3)=39。 039。 then未检测到 0000 处理输出 dataouthh=39。 039。 dataouthl=39。 039。 else if county then dataouthh=39。 139。 dataouthl=39。 039。 county:=not county。 else dataouthh=39。 039。 dataouthl=39。 139。 county:=not county。 end if。 end if。 end if。 end if。 end if。 temp(3 downto 1):= temp(2 downto 0)。 end process。 clkout=clkin。 end behavior。 仿真图: HDB3 译码器程序与仿真图 输入为两路双极性 ,占空比为 50%的 的去取样时钟 输出为一路单极性 ,占空比为 50%的 的去取样时钟 library ieee。 use。 entity hdbdecode is port( clkin:in std_logic。 23 datainhh:in std_logic。 datainhl:in std_logic。 dataout:out std_logic。 clkout:out std_logic)。 end hdbdecode。 architecture behavior of hdbdecode is signal hh,hl:std_logic_vector(4 downto 0)。 signal temp:std_logic。 begin AHH:process(clkin) variable temphh:std_logic_vector(4 downto 0)。 begin if clkin39。 event and clkin=39。 039。 then temphh(0):=datainhh。 if temphh=10001 then temphh:=10000。 elsif (temphh=10010 or temphh=10011) then temphh:=0000amp。 datainhh。 end if。 end if。 hh=temphh。 temphh(4 downto 1):=temphh(3 downto 0)。 end process。 AHL:process(clkin) variable temphl:std_logic_vector(4 downto 0)。 begin if clkin39。 event and clkin=39。 039。 then temphl(0):=datainhl。 if temphl=10001 then temphl:=10000。 elsif (temphl=10010 or temphl=10011) then temphl:=0000amp。 datainhl。 end if。 end if。 hl=temphl。 temphl(4 downto 1):=temphl(3 downto 0)。 end process。 emp=(hh(4)or hl(4))。 dataout=temp。 clkout=clkin。 end behavior。 24 仿真图: 一次群复接器程序与仿真图 时分复接器 输入一个 8 位数据总线 (即 30 路 PCM 话音并行数据共用总线 ), 输入一个一次群串行位同步时钟 输出一个一次群串行合路数据流 ;一个一次群串行位同步时钟 信号 一个 5 位时隙地址总线信号 (即 30 路 PCM 话音并行地址总线 ) (其说明当前输入的数据总线上是哪个时隙数据) 此程序要特别注意器件的选择,该程序选择 cyclone 系列 EP1C6Q240C8 时得到所期望的结果 若选用其他器件譬如 Stratix II 系列的器件会丢失第一路信息 library ieee。 程序所调用的库是 IEEE 库 use。 定义了 std_logic, std_logic_vector 类型 use。 用到基于 std_logic, std_logic_vector 类型的 无符号的算术运算 entity fujieqi is port (clkin: in std_logic。 datain: in std_logic_vector(7 downto 0)。 30 路语音信号输入 dataout:out std_logic。 输出串行数据流 ads:out std_logic_vector(4 downto 0)。 五位时隙总线信号 clkout:out std_logic)。 输出时钟 end fujieqi。 architecture behav of fujieqi is shared variable tscount:std_logic_vector(8 downto 0)。 时隙计数器 shared variable bitcount:std_logic_vector(2 downto 0)。 位计数器 begin p1:process(clkin)位时钟和时隙计数 begin if clkin39。 event and clkin=39。 139。 then if bitcount=111 then bitcount:=000。 25 tscount:=tscount+39。 139。 else bitcount:=bitcount+39。 139。 end if。 end if。 end process p1。 p2:process(clkin) variable regester:std_logic_vector(7 downto 0)。 定义一个内部的寄存器, 用于寄存输入的八位数据 variable temp:std_logic_vector(7 downto 0)。 定义一个中间变量,用于数据的串行输出 begin if clkin39。 event and clkin=39。 139。 then ads=tscount(4 downto 0)。 记录当前输出的是第几路信号 if bitcount=000 then if tscount(5 downto 0)=000000 then regester:=10011011。 双帧计数为 0 时传帧同码 elsif tscount(5 downto 0)=100000 then regester:=11111111。 双帧计数为 32 时传勤务信息 elsif tscount=000010000 then regester:=00001111。 复帧计数为 16 时传复帧同步码 elsif tscount(4 downto 0)=10000 then regester:=11111111。 除 F0 帧外,每帧的第 16 时隙都传信令信息 else regester:=datain。 不满足以上条件时传语音信号 end if。 temp:=regester。 并串转换 dataout=temp(7)。 时隙的第一个时钟上升沿输出最高位 else temp(7 downto 1):=temp(6 downto 0)。 右移 dataout=temp(7)。 接着发其他位 end if。 end if。 clkout=clkin。 输出时钟 end process p2。 end behav。 26 仿真图: 一次群分接器程序与仿真图 时分分接程序 同步码捕获三次后方确认同步完成,若失步三次后重新捕获 输入一个一次群串行合路数据流 ,一个一次群串行位同步时钟 信号 输出一个一次群串行合路数据流 ,一个 30 位逻辑矢量时隙脉冲信号 (每位对应一路时隙脉冲 ) 一个一次群串行位同步时钟 输出串行数据流分别于 A1„„ A31 相与即可得到各路话音信号 library ieee。 use。 use。 entity fenjieqi is port(datain,clkin:in std_logic。 输入 ,输入 串行位同步时钟 A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15,A17,A18, A19,A20,A21,A22,A23,A24,A25,A26,A27,A28,A29,A30,A31:out std_logic。 输出 30 位逻辑矢量时隙脉冲信号,与 dataout 相与的结果就是所选择的一路语音 输出 clkout,dataout:out std_logic)。 输出串行数据流和输出时钟 end fenjieqi。 architecture behave of fenjieqi is signal regester,singlecount:std_l。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。