EDA实验试题16.6(附答案)

2020-06-03 11:58

1.用原理图输入法设计一位全加器,进行功能仿真, 做出仿真波形。

参考实验一

2.用原理图输入法设计一位半加器,进行功能仿真, 做出仿真波形。

参考课本61页图3-5

3.用原理图输入法设计一位全加器,进行下载测试,

参考实验一

4.用原理图输入法设计一位半加器,进行下载测试,

参考课本61页图3-5

5.用文本输入法设计一个分频电路,并进行功能测试。

以25M为信号源,得到一周期为1秒的方波脉冲。

library ieee; --调用库 use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all;

entity fp is -----实体说明(实体名需与文件名一致) port(inclk:in std_logic; ------端口说明 outputa:out std_logic); end fp;

architecture arch_fp of fp is ------构造体说明

signal fp:std_logic_vector(24 downto 0); ------信号定义 signal f:std_logic; begin

process(inclk) ------进程语句描述

begin

if (inclk'event and inclk='1') then ------将时钟分频至1Hz

if fp=24999999 then

fp<=\ f<=not f; else fp<=fp+1; end if; end if; end process; outputa<=f;

end arch_fp; -------构造体结束

6.用文本输入法设计一个分频电路,并进行功能测试。

以25M为信号源,得到一周期为2秒的方波脉冲。

library ieee; --调用库 use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all;

entity fp is -----实体说明(实体名需与文件名一致) port(inclk:in std_logic; ------端口说明 outputa:out std_logic); end fp;

architecture arch_fp of fp is ------构造体说明

signal fp:std_logic_vector(24 downto 0); ------信号定义 signal f:std_logic; begin

process(inclk) ------进程语句描述 begin

if (inclk'event and inclk='1') then ------将时钟分频至1Hz

if fp=124999999 then

fp<=\ f<=not f; else fp<=fp+1; end if; end if; end process; outputa<=f;

end arch_fp; -------构造体结束

7.用文本输入法设计一个50倍分频电路,进行功能仿真。

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity div is

generic(n:integer :=50); port (clk:in std_logic; q:out std_logic);

end div;

architecture behave of div is

signal count :integer range n-1 downto 0:=n-1; begin

process(clk) begin

if (clk'event and clk='1' and clk'last_value ='0') then count<=count-1; if count>=n/2 then q<='0'; else q<='1'; end if;

if count<=0 then count<=n-1; end if; end if; end process; end behave;

8.用文本输入法设计一个60倍分频电路,进行功能仿真。

library ieee;

use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity div is

generic(n:integer :=60); port (clk:in std_logic; q:out std_logic); end div;

architecture behave of div is

signal count :integer range n-1 downto 0:=n-1; begin

process(clk) begin

if (clk'event and clk='1' and clk'last_value ='0') then count<=count-1; if count>=n/2 then q<='0'; else q<='1'; end if;

if count<=0 then count<=n-1; end if;

end if; end process; end behave;

9.用文本输入法设计一个分频电路,并进行功能测试。

以25M为信号源,得到一周期为4秒的方波脉冲。

library ieee; --调用库 use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all;

entity fp is -----实体说明(实体名需与文件名一致) port(inclk:in std_logic; ------端口说明 outputa:out std_logic); end fp;

architecture arch_fp of fp is ------构造体说明

signal fp:std_logic_vector(24 downto 0); ------信号定义 signal f:std_logic; begin

process(inclk) ------进程语句描述 begin

if (inclk'event and inclk='1') then ------将时钟分频至1Hz

if fp=6249999 then

fp<=\ f<=not f; else fp<=fp+1; end if; end if; end process; outputa<=f;

end arch_fp; -------构造体结束

10.用文本输入法设计一个分频电路,并进行功能测试。

以25M为信号源,得到一周期为0.5秒的方波脉冲。

library ieee; --调用库 use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all;

entity fp is -----实体说明(实体名需与文件名一致) port(inclk:in std_logic; ------端口说明 outputa:out std_logic); end fp;

architecture arch_fp of fp is ------构造体说明

signal fp:std_logic_vector(24 downto 0); ------信号定义 signal f:std_logic; begin

process(inclk) ------进程语句描述

begin

if (inclk'event and inclk='1') then ------将时钟分频至1Hz if fp=49999999 then

fp<=\ f<=not f; else fp<=fp+1; end if; end if; end process; outputa<=f;

end arch_fp; -------构造体结束

11.用文本输入法设计一个12归1电路,进行功能测试。

采用25MHz时钟源,静态数码管显示。 (必须与分频模块一同使用)

library ieee; -------调用库 use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity twelveto1 is -------实体描述 port(finclk: in std_logic; --------端口说明 outputa:out std_logic_vector(6 downto 0); outputb:out std_logic_vector(6 downto 0)); end twelveto1;

architecture arch_twelveto1 of twelveto1 is --------结构体描述 signal sa:std_logic_vector(3 downto 0); signal sb:std_logic_vector(3 downto 0); signal f: std_logic;

component fp --------调用分频模块(分频模块需与此程序在同一文件夹下) port (inclk : in std_logic; outputa: out std_logic); end component; begin

u1: fp port map(inclk=>finclk,outputa=>f);

process(f) --------进程语句描述 begin

if (rising_edge(f)) then --------十二归一条件语句模块 if (sa=2 and sb=1) then sa<=\ sb<=\ else if sa=9 then sa<=\ sb<=sb+1;


EDA实验试题16.6(附答案).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:黔东水陆空区位城市

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: