下载此文档

eda习题答案.doc


文档分类:通信/电子 | 页数:约6页 举报非法文档有奖
1/6
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/6 下载此文档
文档列表 文档介绍
21 mux
2
(1)使用 if... .then 语句
process(sO
/ si
,a, begin
if sO
=
•of
and si = * 01 then
y
<=
a;
elsif
sO
=
119 and si = 101 then
y
<=
b;
elsif
sO
=
• 01 and si = * 11 then
y
<=
c;
:*T";
:士:
else
y
<=
d;
end if;
end process;
(2)、使用case语句
architecture hdlarch of mux41 is
signal stmp : std_logic_vector(1 downto 0); hegin
stmp <= si
& sO;
:..卜:

process(s0#
S1 / a./ D /
c,
d) begin
case strno is
:.干.: 吐.:
when
•»oon =>
y
<=a;
when
H01n =>
y
<=b;
when
•»10n =>
y
<=c;
when
others
=>
y <= d;
end case;
end process;
architecture hdlarch of MUXK is
signal tmp : sta^logic; cegin
process(sO# m3) begin
if sO = 101 then
tmp <= a2;
else
tmp <= a3;
:干:
.- 吐•:
end if;
end process;
process(si,al,tmp) begin
if si = 10 * then
outy <= al;
else
outy <= tmp;
end if;
end process;
end hdlarch;
4、 (1)
先设计一个半减器:
x y
00
01
10
11
diff
0
1
1
0
s_out
0
1
0
0
library ieee;
use ieee ・ std_logic_ll64 ・ all;
entity h_suber is
port (
x#y : in std^logic;
diff,s_out : out std^logic
);
end entity ;
architecture hdlarch of h^suber is cegin process(xf y) begin
diff <= x xor y; s_out <= (not x) and y;
end process;
end hdlarch;
(2) 1位全减器的VHDL
LIBRARY ieee;
USE ieee ・ sta_logic_1164 ・ all;
ENTITY suber IS
port (
xzy : IN STD_LOGIC; sub_in : IN STD_LOGIC; diffr

eda习题答案 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数6
  • 收藏数0 收藏
  • 顶次数0
  • 上传人小健
  • 文件大小69 KB
  • 时间2021-07-23
最近更新