ImageVerifierCode 换一换
格式:DOC , 页数:18 ,大小:147.53KB ,
资源ID:4335605      下载积分:8 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/4335605.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(VHDL程序设计题.doc)为本站上传会员【天****】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

VHDL程序设计题.doc

1、VHDL程序设计题 四、 编程题(共50分) 1、请补全以下二选一VHDL程序(本题10分) Entity mux is port(d0,d1,sel:in bit; q:out BIT ); (2) end mux; architecture connect of MUX is (4) signal tmp1, TMP2 ,tmp3:bit; (6) begin cale: blo

2、ck begin tmp1<=d0 and sel; tmp2<=d1 and (not sel) tmp3<= tmp1 and tmp2; q <= tmp3; (8) end block cale; end CONNECT ; (10) 2、编写一个2输入与门的VHDL程序,请写出库、程序包、实体、构造体相关语句,将端口定义为标准逻辑型数据结构(本题10分) & a b y

3、 LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; (2) ENTITY nand2 IS PORT (a,b:IN STD_LOGIC; (4) y:OUT STD_LOGIC); (6) END nand2; ARCHITECTURE nand2_1 OF nand2 IS (8) BEGIN y <= a NAND b; --与y <=NOT( a AND b);等价

4、 (10) END nand2_1; 3、根据下表填写完成一个3-8线译码器的VHDL程序(16分)。 LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; ENTITY decoder_3_to_8 IS PORT (a,b,c,g1,g2a,g2b:IN STD_LOGIC; y:OUT STD_LOGIC_VECTOR(7 DOWNTO 0)); (2) END decoder_3_to_8; ARCHITECTURE rtl OF decoder_

5、3_to_8 IS SIGNAL indata:STD_LOGIC_VECTOR (2 DOWNTO 0); (4) BEGIN indata <= c & b & a; (6) PROCESS (indata,g1,g2a,g2b) BEGIN IF (g1 = '1' AND g2a = '0' AND g2b = '0' ) THEN (8) CASE indata IS WHEN "000"=> y <= "11111

6、110"; WHEN "001" => y <= "11111101"; WHEN "010" => y <= "11111011"; (10) WHEN "011" => y <= "11110111"; WHEN "100" => y <= "11101111"; WHEN "101" => y <= "11011111"; WHEN "110" =>

7、 y <= "10111111"; (12) WHEN "111" => y <= "01111111"; WHEN OTHERS=> y <= "XXXXXXXX"; END CASE; ELSE y <= "11111111"; (14) END IF; END PROCESS; (16) END rtl; 4、三态门电原理图如

8、右图所示,真值表如左图所示,请完成其VHDL程序构造体部分。 (本题14分) LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; ENTITY tri_gate IS PORT(din,en:IN STD_LOGIC; dout : OUT STD_LOGIC); END tri_gate ; ARCHITECTURE zas OF tri_gate IS BEGIN PROCESS (din,en) BEGIN IF (en=‘1') THEN dout <= din; ELSE

9、 dout <= ‘Z’; END IF; END PROCESS ; END zas ; 四、 编程题(共50分) 1、根据一下四选一程序的结构体部分,完成实体程序部分(本题8分) entity MUX4 is port( (2) s: in std_logic_vector(1 downto 0); (4) d: in std_logic_vector(3 downto 0); (6) y: out std_logic

10、 (8) ); end MUX4; architecture behave of MUX4 is begin process(s) begin if (s="00") then y<=d(0); elsif (s="01") then y<=d(1); elsif (s="10") then y<=d(2); elsif (s="11") then y<=d(3); else null; end if

11、 end process; end behave; 2、编写一个数值比较器VHDL程序的进程(不必写整个结构框架),要求使能信号g低电平时比较器开始工作,输入信号p = q,输出equ为‘0’,否则为‘1’。(本题10分) process(p,q) (2) begin if g='0' then (4) if p = q then equ <= '0'; (6) else equ <= '1'; (8) end if; else equ <= '

12、1'; (10) end if; end process; 3、填写完成一个8-3线编码器的VHDL程序(16分)。 Library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity eight_tri is port( b: in std_logic_vector(7 downto 0); (2) en: in std_logi

13、c; y: out std_logic_vector(2 downto 0) (4) ); end eight_tri; architecture a of eight_tri is (6) signal sel: std_logic_vector(8 downto 0); begin sel<=en & b; (8) y<= “000” when (s

14、el=”100000001”)else “001” when (sel=”100000010”)else (10) “010” when (sel=”100000100”)else “011” when (sel=”100001000”)else “100” when (sel=”100010000”)else (12) “101” when (sel=”100100000”)else “110” when (sel=”101000000”)else (14) “111” when (sel

15、110000000”)else (16) “zzz”; end a; 4、图中给出了4位逐位进位全加器,请完成其VHDL程序。(本题16分) library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; entity full_add is port ( a,b: in std_logic_vector (3 downto 0);

16、 (2) carr: inout std_logic_vector (4 downto 0); sum: out std_logic_vector (3 downto 0) ); end full_add; architecture full_add_arch of full_add is component adder (4) port ( a,b,c: in std_logic; carr: inout std_logic; sum: out

17、std_logic (6) ); end component; begin carr(0)<='0'; u0:adder port map(a(0),b(0),carr(0),carr(1),sum(0)); u1:adder port map(a(1),b(1),carr(1),carr(2),sum(1)); (8)(10) u2:adder port map(a(2),b(2),carr(2),carr(3),sum(2)); (1

18、2) u3:adder port map(a(3),b(3),carr(3),carr(4),sum(3)); (14)(16) end full_add_arch; 四、 编程(共50分) 1、完成下图所示的触发器。(本题10分) CLR CLK D Q QN library IEEE; use IEEE.std_logic_1164.all; entity VposDff is port (CLK, CLR, D: in STD_LOGIC; ----------

19、2分 Q, QN: out STD_LOGIC ); ----------4分 end VposDff; architecture VposDff_arch of VposDff is begin process ( CLK, CLR ) ----------6分 begin if CLR='1' then Q <= '0'; QN <='1'; elsif CLK'event and CLK='1' then

20、 Q <= D; QN <= not D; ----------8分 end if; end process; ----------10分 end VposDff_arch; 2、完成以下4位全加器代码(本题10分) library IEEE; use IEEE.std_logic_1164.all; entity full_add is port ( a,b: in std_logic_vector (3 downt

21、o 0); cin: in std_logic; cout: out std_logic; sum: out std_logic_vector (3 downto 0) ); end full_add; architecture full_add_arch of full_add is component adder port ( a,b,c: in std_logic; carr: out std_logic; sum: out std_logic ); end component; si

22、gnal c1,c2,c3: std_logic; 2分 begin u0:adder port map(a(0),b(0),cin,c1,sum(0)); 4分 u1:adder port map(a(1),b(1),c1,c2,sum(1)); 5分 u2:adder port map(a(2),b(2),c2,c3,sum(2)); 6分 u3:adder port map(a(3),b(3),c3,cout,sum(3));

23、 10分 end full_add_arch; 3、补充完整如下代码,使之完成4状态不断循环。(本题10分) ARCHITECTURE arc OF ss IS type states is ( st0,st1,st2,st3 ); 2分 signal outc: states; 4分 BEGIN PROCESS(clk) BEGIN IF reset='1' then

24、 outc <=st0 ; 6分 elsif clk'event and clk='1' then CASE outc IS WHEN st0 => outc <= st1; 7分 WHEN st1 => outc <= st2; 8分 WHEN st2 => outc <= st3;

25、 9分 WHEN st3 => outc <= st0; 10分 WHEN OTHERS => outc <=st0; END CASE; end if; END PROCESS; END arc; 4、设计异或门逻辑:(本题20分) 如下异或门,填写右边的真值表。(此项5分) A B Y 0 0 0 0 1 1 1 0 1 1 1 0 其表达

26、式可以表示为:(此项5分) 这一关系图示如下: 试编写完整的VHDL代码实现以上逻辑。可以采用任何描述法。(此项10分) library ieee; use ieee.std_logic_1164.all; 1分 entity yihuo1 is port( a,b :in std_logic; y :out std_logic ); end yihuo1; 4分 arc

27、hitecture yihuo1_behavior of yihuo1 is begin 7分 process(a,b) y<=a xor b; begin (第2种写法) if a=b then y<='0'; else y<='1'; end if; end process; end yihuo1_behavior;

28、 10分 四、 编程(共50分,除特殊声明,实体可只写出PORT语句,结构体要写完整) 1、用IF语句编写一个二选一电路,要求输入a、b, sel为选择端,输出q。(本题10分) Entity sel2 is Port ( a,b : in std_logic; sel : in std_logic; q : out std_logic ); End sel2; (3) Architecture a of sel2 is begin if sel = ‘0’ then q

29、 <= a; (6) else q <= b; (9) end if; end a; (10) 2、编写一个4位加法计数器VHDL程序的进程(不必写整个结构框架),要求复位信号reset低电平时计数器清零,变高后,在上升沿开始工作;输入时钟信号为clk,输出为q。(本题10分) Process(reset,clk) (2) begin if reset = ‘0’ then q <= “0000”; (4) elsif clk’event and clk = ‘1’ then (6)

30、 q <= q + 1; (9) end if; end process; (10) 3、填写完成一个8-3线编码器的真值表(5分),并写出其VHDL程序(10分)。 8 -3线编码器真值表 en b y0y1y2 1 00000000 000 1 00000010 001 1 00000100 010 1 00001000 011 1 00010000 100 1 00100000 101 1 01000000 110 1 10000000 111 0 xxxxxxxx 高阻态

31、entity eight_tri is port( b: in std_logic_vector(7 downto 0); en: in std_logic; y: out std_logic_vector(2 downto 0) ); end eight_tri; (3) architecture a of eight_tri is signal sel: std_logic_vector(8 downto 0); (4) begin sel<=en & b; y<= “000” when (sel=”1

32、00000001”)else “001” when (sel=”100000010”)else “010” when (sel=”100000100”)else “011” when (sel=”100001000”)else “100” when (sel=”100010000”)else “101” when (sel=”100100000”)else “110” when (sel=”101000000”)else “111” when (sel=”110000000”)else (9) “zzz”; (10) end

33、 a; 4、根据已给出的全加器的VHDL程序,试写出一个4位逐位进位全加器的VHDL程序。(本题15分) library IEEE; use IEEE.std_logic_1164.all; use IEEE.std_logic_arith.all; use IEEE.std_logic_unsigned.all; entity adder is port ( a,b,c: in std_logic; carr: inout std_logic; sum: out std_logic ); end

34、 adder; architecture adder_arch of adder is begin sum <= a xor b xor c; carr <= (a and b) or (b and c) or (a and c); end adder_arch; entity full_add is port ( a,b: in std_logic_vector (3 downto 0); carr: inout std_logic_vector (4 downto 0); sum: out std_logic_vecto

35、r (3 downto 0) ); end full_add; (5) architecture full_add_arch of full_add is component adder port ( a,b,c: in std_logic; carr: inout std_logic; sum: out std_logic ); end component; (10) begin carr(0)<='0'; u0:adder port map(a(0),b(0),carr(0),c

36、arr(1),sum(0)); u1:adder port map(a(1),b(1),carr(1),carr(2),sum(1)); u2:adder port map(a(2),b(2),carr(2),carr(3),sum(2)); u3:adder port map(a(3),b(3),carr(3),carr(4),sum(3)); end full_add_arch; (15) 四、 编程(共50分,除特殊声明,实体可只写出PORT语句,结构体要写完整) 1、用IF语句编写一个四选一电路,要求输入d0~d3, s为选择端

37、输出y。(本题10分) entity MUX4 is port( s: in std_logic_vector(1 downto 0); d: in std_logic_vector(3 downto 0); y: out std_logic ); end MUX4; (3) architecture behave of MUX4 is begin process(s) begin if (s="00") then y<=d(0); (4) elsif (s="0

38、1") then y<=d(1); (5) elsif (s="10") then y<=d(2); (6) elsif (s="11") then y<=d(3); (7) else null; (9) end if; end process; end behave; (10) 2、编写一个数值比较器VHDL程序的进程(不必写整个结构框架),要求使能信号g低电平时比较器开始工作,输入信号p = q,输出equ为‘0’,否则为‘1’。(本题10分) process(p,q)

39、 (2) begin if g='0' then (4) if p = q then equ_tmp <= '0'; (6) else equ_tmp <= '1'; (8) end if; else equ_tmp <= '1'; (10) end if; end process; 3、填写完成一个3-8线译码器的真值表(5分),并写出其VHDL程序(10分)。 3-8译码器的真值表 en a2a1a0 y 1 000 00000001 1 001 0

40、0000010 1 010 00000100 1 011 00001000 1 100 00010000 1 101 00100000 1 110 01000000 1 111 10000000 0 xxx 00000000 entity tri_eight is port( a: in std_logic_vector (2 downto 0); en: in std_logic; y: out std_logic_vector (7 downto 0) ); end tri_eight;

41、 (2) architecture a of tri_eight is signal sel: std_logic_vector (3 downto 0); (4) begin sel(0) <= a(0); sel(1) <= a(1); sel(2) <= a(2); sel(3) <= en; (5) with sel select y <= "00000001" when "1000", "00000010" when "1001", "00000100" when "1010", "00001000" when "10

42、11", "00010000" when "1100", "00100000" when "1101", "01000000" when "1110", "10000000" when "1111", "00000000" when others; (9) end a; (10) 4、根据已给出的二-十(BCD)进制优先权编码器功能表,试写出其VHDL程序。(本题15分) 二-十(BCD)进制优先权编码器功能表 输入 输出 I1 I2 I3 I4 I5 I6

43、 I7 I8 I9 Y3 Y2 Y1 Y0 1 1 1 1 1 1 1 1 1 1 1 1 1 X X X X X X X X 0 0 1 1 0 X X X X X X X 0 1 0 1 1 1 X X X X X X 0 1 1 1 0 0 0 X X X X X 0 1 1 1 1 0 0 1 X X X X 0 1 1 1 1 1 0 1 0 X X X 0 1 1 1 1 1 1 0 1

44、1 X X 0 1 1 1 1 1 1 1 1 0 0 X 0 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 0 entity prior is port( d : in std_logic_vector(9 downto 1); q : out std_logic_vector(3 downto 0) ); end prior; (2) architecture behavior of prior is begin

45、 process(d) (4) 1 begin if d = "111111111" then q <= "1111"; elsif d(9) = '0' then q <= "0110"; elsif d(8) = '0' then q <= "0111"; elsif d(7) = '0' then q <= "1000"; elsif d(6) = '0' then q <= "1001"; elsif d(5) = '0' then q <= "1010"; elsif d(4) = '0' then q <= "1011"; elsif d(3) = '0' then q <= "1100"; elsif d(2) = '0' then q <= "1101"; elsif d(1) = '0' then q <= "1110"; end if; (9) end process; end behavior;

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服