多路波形发生器的设计说明

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

交通大学

电工电子教学基地

实验报告

实验课程: EDA技术

实验名称:多路波形发生器的设计

实验台:1号班级:四班学号:08291123 :游振南实验日期:2010年10月24日成绩:

一·实验容及其目的:

1.熟悉多路发生器的原理还有输出相位差和占空比的原理。2.熟练用QUARTERII进行电路的编程和仿真。

3.熟练使用IF语句。

二·实验设计思路

.1。多路发生器的原理用分频器而且是可调的因此先设div:integer range 1 to 4;。通过信号赋值(tmp,tmp1,tmp2)赋给输出信号A,B,C. 通过n改变输出频率。定义各个变量。

2.。当resetb=0时,countQ=0;

当resetb=1时。给脉冲时先定义分频比如果countQ < (6*div-1)时countQ <= countQ +1;否者countQ为0。

4.当cltr=01时即H:L=1:1时

①如果countQ < 3*div时tmp<=’0’;否者tmp<=’1’

②如果countQ < 2*div or countQ>(6*div-2))时tmp1<= '1';

否者 tmp1<='0';

③如果countQ < div or countQ>(4*div-1)时tmp2<= '0';

④否者 tmp2<='1';

⑤A等于tmp;B=tmp2;C=tmp3;

同理:当cltr=10时即H:L=1:2时

当cltr=11时即H:L=2:1时。

其中;公式推导如下:

当div=1,cltr=01时当div=2,cltr=01时countQ<6 countQ<12

A:0 0 0 1 1 1; A:0 0 0 0 0 0 1 1 1 1 1 1 B:1 1 0 0 0 1; B:1 1 1 1 0 0 0 0 0 0 1 1 C:0 1 1 1 0 0; C:0 0 1 1 1 1 1 1 0 0 0 0 A:countQ<3时tmp=0 A;countQ<6时tmp=0

Else tmp=1 Else tmp=1

B:countQ<2 or countQ>4时tmp=1 B:countQ<4or countQ>10 ,tmp=1 Else tmp=0 Else tmp=0

C:countQ<1 or countQ>3时tmp=0 C: countQ<2 or countQ>7时tmp=0 Else tmp=1 Else tmp=1

同理:cltr=10,cltr=11.

当cltr=01时

if(countQ < 3*div) then tmp<= '0';else tmp<='1';

if(countQ < 2*div or countQ>(6*div-2)) then tmp1<= '1';else tmp1<='0';

if(countQ < div or countQ>(4*div-1)) then tmp2<= '0';else tmp2<='1';

当cltr=10时

if(countQ < 4*div) then tmp<= '0';else tmp<='1';

if(countQ < 2*div ) then tmp1<= '1';else tmp1<='0';

if(countQ < 2*div or countQ>(4*div-1)) then tmp2<= '0'; else tmp2<='1';

当cltr=11时

if(countQ < 2*div) then tmp<= '0';else tmp<='1';

if(countQ < 2*div or countQ>(4*div-1)) then tmp1<= '1';else tmp1<='0';

if(countQ < 4*div ) then tmp2<= '1';else tmp2<='0';

将信号tmp 赋给A ; tmp1 赋给B ; tmp2 赋给 C ;

三·流程图:

四·程序及仿真波形:

library ieee;

use ieee.std_logic_1164.all;

use ieee.std_logic_arith.all;

use ieee.std_logic_unsigned.all;

entity boxing is

port(clk,resetb: in std_logic;

cltr:in std_logic_vector(1 downto 0); div:integer range 1 to 4;

A,B,C:out std_logic);

end boxing;

architecture a of boxing is

signal countQ: integer range 0 to 255; signal tmp:std_logic;

signal tmp1:std_logic;

signal tmp2:std_logic;

begin

process(clk,resetb)

begin

if clk'event and clk='1' then

if (resetb='0') then

countQ<=0;

else

if( countQ < (6*div-1)) then

countQ <= countQ +1;

else countQ <=0;

end if;

end if;

end if;

end process;

process(cltr,countQ)

begin

if(cltr=01) then

if(countQ < 3*div) then

tmp<= '0';

else tmp<='1';

end if;

if(countQ < 2*div or countQ>(6*div-2)) then tmp1<= '1';

else tmp1<='0';

相关文档
最新文档