- 1、本文档共9页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
EDA技术与应用
实验报告
实验目的
1、学习包集和元件例化语句的使用。(五号+宋体,段前缩进2字符,固定值18磅行距)
2、学习FAU(全加器单元)电路的设计。
3、学习并行乘法器电路的设计。
实验内容
1、用VHDL代码描述FAU、与门电路,要求其操作数有a、b两个,每个操作数都是4位宽度。
2、利用元件例化语句构成所需要的基本元件,利用包集声明该元件,在主代码中调用该元件完成设计。
实验原理
1、并行乘法器的原理图:
2、TOP单元:
(格式同上)
3、mid单元
4、lower单元
实验代码
library ieee;
use ieee.std_logic_1164.all;
entity adder is
port (a,b,cin:in std_logic;
s,cout:out std_logic);
end adder;
architecture adder of adder is
begin
s=a xor b xor cin;
cout=(a and b)or(a and cin)or(b and cin);
end adder;
library ieee;
use ieee.std_logic_1164.all;
entity and_2 is
port (a,b:in std_logic;
y:out std_logic);
end and_2;
architecture and_2 of and_2 is
begin
y=a and b;
end and_2;
library ieee;
use ieee.std_logic_1164.all;
use work.my_components.all;
entity top is
port (a:in std_logic;
b:in std_logic_vector(3 downto 0);
s,c:out std_logic_vector(2 downto 0);
p:out std_logic);
end top;
architecture reg of top is
begin
u1:component and_2 port map(a,b(3),s(2));
u2:component and_2 port map(a,b(2),s(1));
u3:component and_2 port map(a,b(1),s(0));
u4:component and_2 port map(a,b(0),p);
c(2)=0;c(1)=0;c(0)=0;
end reg;
library ieee;
use ieee.std_logic_1164.all;
use work.my_components.all;
entity mid is
port (a:in std_logic;
b:in std_logic_vector(3 downto 0);
si,ci:in std_logic_vector(2 downto 0);
s,c:out std_logic_vector(2 downto 0);
p:out std_logic);
end mid;
architecture reg of mid is
signal d:std_logic_vector(2 downto 0);
begin
u1:component and_2 port map(a,b(3),s(2));
u2:component and_2 port map(a,b(2),d(2));
u3:component and_2 port map(a,b(1),d(1));
u4:component and_2 port map(a,b(0),d(0));
u5:component adder port map(si(2),ci(2),d(2),s(1),c(2));
u6:component adder port map(si(1),ci(1),d(1),s(0),c(1));
u7:component adder port map(si(0),ci(0),d(0),p,c(0));
end reg;
library ieee;
use ieee.std_logic_1164.all;
use work.my_components.all;
entity lower is
port (
si,ci:in std_logic_vector(2 downto 0);
p:out std_logic_vector(3 downto 0)
);
end lower;
architecture reg of lower is
signal d:std_logic_vector(2 down
文档评论(0)