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

EDA1

来源:用户分享 时间:2025/7/30 7:23:56 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

戈强宝 王春雷 廖乃全 201201902201 1101902318 201201902213

3-4 给出全减器的VHDL描述。 描述半减器的VHDL的程序如下:

library ieee;

use ieee.std_logic_1164.all; entity halfsub is

port(x,y:in std_logic;

diff,s_out:out std_logic); end entity halfsub;

architecture gl of halfsub is begin

process(x,y) begin

diff<= x xor y ;

s_out <= (not x) and y ; end process; end architecture gl; 半减器的仿真波形:

1

描述或门的VHDL程序如下:

library ieee;

use ieee.std_logic_1164.all; entity or2a is

port(a,b:in std_logic;

sub_out:out std_logic); end entity or2a;

architecture gl of or2a is begin

sub_out <= a or b; end architecture gl;

描述全减器的VHDL的程序如下:

library ieee;

use ieee.std_logic_1164.all; entity fullsub is

port(x,y,sub_in:in std_logic;

diffr,sub_out:out std_logic); end entity fullsub;

architecture wgl of fullsub is signal net1,net2,net3:std_logic; component halfsub

port(x,y:in std_logic;

diff,s_out:out std_logic);

end component; component or2a

port(a,b:in std_logic;

sub_out:out std_logic);

end component; begin

u0:halfsub port map(x=>x,y=>y,diff=>net1,s_out=>net2);

u1:halfsub port map(x=>net1,y=>sub_in,diff=>diffr,s_out=>net3); u2:or2a port map(a=>net2,b=>net3,sub_out=>sub_out);

2

end architecture wgl;

全减器的仿真波形:

3-5用VHDL设计一个3-8译码器。

library ieee;

use ieee.std_logic_1164.all; entity decoder38 is

port(a2,a1,a0:in std_logic;

y:out std_logic_vector(7 downto 0)); end entity decoder38;

architecture gl of decoder38 is

signal s: std_logic_vector(2 downto 0); begin

s<=a2&a1&a0;

process(a2,a1,a0) begin case (s) is

when \ when \ when \ when \ when \ when \ when \ when \ end case; end process;

3

end architecture gl;

3-6 设计一个比较电路,当输入的8421BCD码大于5时输出1,否则

输出0

library ieee;

use ieee.std_logic_1164.all; entity comparator is

port(A,B,C,D:in std_logic; y:out std_logic); end entity comparator;

architecture gl of comparator is

signal s: std_logic_vector(3 downto 0); begin

s<=A&B&C&D;

process(A,B,C,D) begin case (s) is

when \ when \ when \ when \ when others=> y<= '0'; end case; end process;

4

end architecture gl;

5

搜索更多关于: EDA1 的文档
EDA1.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c546ml843z87zlrl1b2wk_1.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top