77范文网 - 专业文章范例文档资料分享平台

通信原理课程设计 基于FPGA的时分多路数字基带传输系统的设(5)

来源:网络收集 时间:2018-11-17 下载这篇文档 手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:或QQ: 处理(尽可能给您提供完整文档),感谢您的支持与谅解。点击这里给我发消息

when others=>D<=null; end case; end if; end process; clkout<=clkin; end behavior;

仿真图:

5.3 HDB3编码器程序与仿真图

--HDB3编码

--输入2.048Mb/s数据流,占空比为50%的2.048MHZ的去取样时钟

--输出为两路双极性2.048Mb/s数据流,占空比为50%的2.048MHZ的去取样时钟 library ieee;

use ieee.std_logic_1164.all; use ieee.numeric_std; use ieee.std_logic_arith; entity hdbnecode is port(clkin:in std_logic; datain:in std_logic; dataouthh:out std_logic; dataouthl:out std_logic; clkout:out std_logic); end hdbnecode;

architecture behavior of hdbnecode is

begin

process(clkin)

variable count0,count1:integer:=0 ; variable county:boolean;

20

variable temp:std_logic_vector(3 downto 0); begin

if clkin'event and clkin='0' then

if datain='1' then--输入为1时处理4位寄存器 count0:=0; temp(0):=datain; count1:=count1+1; if temp(3)='0' then--首位0 处理 输出 dataouthh<='0'; dataouthl<='0'; else if county then--首位1处理 输出 dataouthh<='1'; dataouthl<='0'; county:=not county; else dataouthh<='0'; dataouthl<='1'; 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:=\ dataouthh<='0'; dataouthl<='0'; county:=not county; else count1:=0; --两个四连零 间 1 的 偶 temp:=\ if county then dataouthh<='1'; dataouthl<='0'; else dataouthh<='0'; dataouthl<='1';

21

奇偶 end if; end if; else if temp(3)='0' then--未检测到0000 处理输出 dataouthh<='0'; dataouthl<='0'; else if county then dataouthh<='1'; dataouthl<='0'; county:=not county; else dataouthh<='0'; dataouthl<='1'; 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;

仿真图:

5.4 HDB3译码器程序与仿真图

--输入为两路双极性2.048Mb/s数据流,占空比为50%的2.048MHZ的去取样时钟 --输出为一路单极性2.048Mb/s数据流,占空比为50%的2.048MHZ的去取样时钟 library ieee;

use ieee.std_logic_1164.all; entity hdbdecode is port(

clkin:in std_logic;

22

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 clkin'event and clkin='0' then temphh(0):=datainhh; if temphh=\ temphh:=\

elsif (temphh=\ temphh:=\ 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 clkin'event and clkin='0' then temphl(0):=datainhl; if temphl=\ temphl:=\

elsif (temphl=\ temphl:=\ 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;

23

仿真图:

5.5 一次群复接器程序与仿真图

--时分复接器

--输入一个8位数据总线(即30路PCM话音并行数据共用总线), --输入一个一次群串行位同步时钟2.048MB/S信号

--输出一个一次群串行合路数据流2.048MB/S信号;一个一次群串行位同步时钟2.048MB/S信号

--一个5位时隙地址总线信号(即30路PCM话音并行地址总线) --(其说明当前输入的数据总线上是哪个时隙数据) --此程序要特别注意器件的选择,该程序选择cyclone系列EP1C6Q240C8时得到所期望的结果

--若选用其他器件譬如Stratix II系列的器件会丢失第一路信息

library ieee;--程序所调用的库是IEEE库

use ieee.std_logic_1164.all;--定义了std_logic,std_logic_vector类型

use ieee.std_logic_unsigned.all;--用到基于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 clkin'event and clkin='1' then if bitcount=\ bitcount:=\

24

百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库通信原理课程设计 基于FPGA的时分多路数字基带传输系统的设(5)在线全文阅读。

通信原理课程设计 基于FPGA的时分多路数字基带传输系统的设(5).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印 下载失败或者文档不完整,请联系客服人员解决!
本文链接:https://www.77cn.com.cn/wenku/zonghe/282507.html(转载请注明文章来源)
Copyright © 2008-2022 免费范文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ: 邮箱:tiandhx2@hotmail.com
苏ICP备16052595号-18
× 注册会员免费下载(下载后可以自由复制和排版)
注册会员下载
全站内容免费自由复制
注册会员下载
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: