数字逻辑课后答案第五章.docx

上传人:h**** 文档编号:1377927 上传时间:2019-02-23 格式:DOCX 页数:13 大小:82.75KB
下载 相关 举报
数字逻辑课后答案第五章.docx_第1页
第1页 / 共13页
数字逻辑课后答案第五章.docx_第2页
第2页 / 共13页
数字逻辑课后答案第五章.docx_第3页
第3页 / 共13页
数字逻辑课后答案第五章.docx_第4页
第4页 / 共13页
数字逻辑课后答案第五章.docx_第5页
第5页 / 共13页
点击查看更多>>
资源描述

1、第五章 习题答案1. 画出与阵列编程点解:BA A-B-C-C3333X2. 画出或阵列编程点 解: BA A-B-C-C4444DD-X 1X 2X 3X 43. 与、或阵列均可编程,画出编程点。解;AF1A-CBC-B-F3F24. 4 变量 LUT 编程解:A 0A 1A 2A 3012301230123012301230010100100100100S O P 输出5. 用 VHDL 写出 4 输入与门解: 源代码:LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY and4 ISPORT (a,b,c ,d:IN STD_LOGIC;x:O

2、UT STD_LOGIC) ;END and4;ARCHITECTURE and4_arc OF and4 ISBEGINxa AND b AND c AND d;END and4_arc; 6. 用 VHDL 写出 4 输入或门解: 源代码:LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY or4 ISPORT (a,b,c ,d:IN STD_LOGIC;x:OUT STD_LOGIC) ;END or4;ARCHITECTURE or4_arc OF or4 ISBEGINxa OR b OR c OR d;END or4_arc;7. 用

3、VHDL 写出 SOP 表达式解: 源代码:LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY sop ISPORT (a,b,c ,d,e,f:IN STD_LOGIC;x:OUT STD_LOGIC) ;END sop;ARCHITECTURE sop_arc OF sop ISBEGINx(a AND b) OR (c AND d) OR (e AND f);END sop_arc;8. 用 VHDL 写出布尔表达式解: 源代码:LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY boolean IS

4、PORT (a,b,c :IN STD_LOGIC;f:OUT STD_LOGIC) ;END boolean ;ARCHITECTURE boolean_arc OF boolean ISBEGINf(a OR (NOT b) OR c) AND (a OR b OR (NOT c) AND (NOT a) OR (NOT b) OR (NOT c);END boolean_arc;9. 用 VHDL 结构法写出 SOP 表达式解: 源代码:三输入与非门的逻辑描述LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY nand3 ISPORT (a,b

5、,c :IN STD_LOGIC;x:OUT STD_LOGIC) ;END nand3;ARCHITECTURE nand3_arc OF nand3 ISBEGINxNOT (a AND b AND c) ;END nand3_arc;顶层结构描述文件LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY sop ISPORT (in1,in2,in3,in4,in5,in6 ,in7 ,in8,in9:IN STD_LOGIC;out4:OUT STD_LOGIC) ;END sop;ARCHITECTURE sop_arc OF sop ISCO

6、MPONENT nand3PORT (a,b,c :IN STD_LOGIC;x:OUT STD_LOGIC) ;END COMPONENT;SIGNAL out1,out2,out3:STD_LOGIC ;BEGINu1:nand3 PORT MAP (in1,in2,in3 ,out1);u2:nand3 PORT MAP (in4,in5,in6 ,out2);u3:nand3 PORT MAP (in7,in8,in9 ,out3);u4:nand3 PORT MAP (out1,out2,out3 ,out4);END sop;10. 用 VHDL 数据流法写出 SOP 表达式解:

7、源代码:LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY sop ISPORT (in1,in2,in3,in4,in5,in6 ,in7 ,in8,in9:IN STD_LOGIC;out4:OUT STD_LOGIC) ;END sop;ARCHITECTURE sop_arc OF sop ISBEGINout4(in1 AND in2 AND in3) OR (in4 AND in5 AND in6 ) OR (in7 AND in8 AND in9);END sop_arc;13. 用 VHDL 设计 38 译码器 解: 源代码:LIBR

8、ARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY decoder_3_to_8 ISPORT (a,b,c ,g1,g2a,g2b:IN STD_LOGIC;y:OUT STD_LOGIC _VECTOR(7 downto 0) ) ;END decoder_3_to_8;ARCHITECTURE rt1 OF decoder_3_to_8 ISSIGNAL indata:STD_LOGIC _VECTOR (2 downto 0) ;BEGINindatac use ieee.std_logic_1164.all;entity bcdtobi ispor

9、t(bcdcode : IN STD_LOGIC_VECTOR(7 DOWNTO 0);start: in std_logic;qbit : OUT STD_LOGIC_VECTOR(3 DOWNTO 0) );end;architecture behavioral of bcdtobi isbeginprocess(start)beginif start=0 thencase bcdcode(7 downto 0) iswhen “00000000“=qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3

10、downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)qbit(3 downto 0)=“0000“;end case;elseqbit(3 downto 0)=“0000“;end if;end process;end behavioral;17. 用 VHDL 设计 4 位寄存器

11、解: 异步复位源代码:LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY register_4 ISPORT (clk,r:IN STD_LOGIC;din:IN S TD_LOGIC _VECTOR(3 downto 0) ;qout:OUT STD_LOGIC _VECTOR (3 downto 0) ) ;END register_4;ARCHITECTURE rge_arc OF register_4 ISSIGNAL q_temp:S TD_LOGIC _VECTOR(3 downto 0) ;BEGINPROCESS(clk,r)BEGI

12、NIF(r1)THENq_temp“0000“;ELSIF (clkevent AND clk1 ) THENq_tempdin;END IF;qoutq_temp;END PROCESS;END rge_arc;18. 用 VHDL 设计 4 位双向移位寄存器解: s1、s0 控制工作方式,dsl 为左移数据输入,dsr 为右移数据输入。源代码:LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;ENTITY shiftreg ISPORT (clk,r ,dsr,dsl:IN STD_LOGIC;s1,s0:IN STD_LOGIC;-function sel

13、ectdin:IN S TD_LOGIC _VECTOR(3 downto 0) ;-data inqout:OUT STD_LOGIC _VECTOR (3 downto 0) ) ;-data outEND shiftreg;ARCHITECTURE ls74194 OF shiftreg ISSIGNAL iq: STD_LOGIC _VECTOR(3 downto 0) ;SIGNAL s:STD_LOGIC _VECTOR(1 downto 0) ;BEGINss1 & s0;PROCESS(clk ,r)BEGINIF(r0)THENiq“0000“;ELSIF (clkevent

14、 AND clk1 ) THENCASE s ISWHEN “00“null;WHEN “01“iqdsr & din(3 downto 1) ;-rightWHEN “10“iqdin(2 downto 0)& dsl;-leftWHEN “11“iqdin;-loadWHEN othersnull; END CASE;END IF;qoutiq;END PROCESS;END ls74194;19. 用 VHDL 设计 8421 码十进制加法计数器解: 异步清零,同步置数源代码:LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_ARITH.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;ENTITY count10 ISPORT (clk,clr,load:IN STD_LOGIC;din:IN S TD_LOGIC _VECTOR(3 downto 0) ;co:OUT STD_LOGIC;qout:OUT STD_LOGIC _VECTOR (3 downto 0) ) ;END count10;

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育教学资料库 > 试题真题

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。