EDA课后作业

上传人:油条 文档编号:1508819 上传时间:2017-06-23 格式:PPT 页数:31 大小:305.50KB
返回 下载 相关 举报
EDA课后作业_第1页
第1页 / 共31页
EDA课后作业_第2页
第2页 / 共31页
EDA课后作业_第3页
第3页 / 共31页
EDA课后作业_第4页
第4页 / 共31页
EDA课后作业_第5页
第5页 / 共31页
点击查看更多>>
资源描述

《EDA课后作业》由会员分享,可在线阅读,更多相关《EDA课后作业(31页珍藏版)》请在金锄头文库上搜索。

1、4-1画出与下例实体描述对应的原理图符号元件:ENTITY buf3s IS - 实体1: 三态缓冲器 PORT (input : IN STD_LOGIC ; - 输入端 enable : IN STD_LOGIC ; - 使能端 output : OUT STD_LOGIC ) ; - 输出端END buf3x ;ENTITY mux21 IS -实体2: 2选1多路选择器 PORT (in0, in1, sel : IN STD_LOGIC; output : OUT STD_LOGIC);,4-2. 图4-17所示的是4选1多路选择器,试分别用IF_THEN语句和CASE语句的表达方式

2、写出此电路的VHDL程序。选择控制的信号s1和s0的数据类型为STD_LOGIC_VECTOR;当s1=0,s0=0;s1=0,s0=1;s1=1,s0=0和s1=1,s0=1分别执行y=a、y=b、y=c、y=d。,图4-17 4选1多路选择器,使用IFTHEN语句:Library ieee; use ieee.std_logic_1164.alll;Entity mux41 isPort(s0,s1,a,b,c,d:in std_logic; y:out std_logic);End mux41;Architecture one of mux41 isSignal s10:std_logi

3、c_vector(1 downto 0);Begin s10=s1 &s0;process(s10,a,b,c,d) begin if s10=“00” then y=a; elsif s10=“01 then y=b; elsif s10=“10” then y=c; else y=d; end if ; end process;End one;,使用CASE语句:Library ieee; use ieee.std_logic_1164.alll; Entity mux41 isPort(s0,s1,a,b,c,d:in std_logic; y:out std_logic);End mu

4、x41;Architecture one of mux41 isSignal s10:std_logic_vector(1 downto 0);Begin s10yyyy=a; end case; end process;End one;,KX康芯科技,4-3. 图4-18所示的是双2选1多路选择器构成的电路MUXK,对于其中MUX21A,当s=0和1时,分别有y=a和ytmptmpoutyouty=tmp; end case; end process;End one;,Library ieee; use ieee.std_logic_1164.alll; Entity mux21 is po

5、rt(s,a,b:in std_logic; y:out std_logic);End mux21;Architecture one of mux21 is Begin ya2,b=a3,s=s0,y=tmp); U2:mux21 port map(a=a1,b=tmp,s=s1,y=outy);End beh;,4-4. 图4-19是一个含有上升沿触发的D触发器的时序电路,试写出此电路的VHDL设计文件。,图4-19 时序电路图,tmp,Library ieee; use ieee.std_logic_1164.alll; Entity exen isPort(cl,clk0:in std_

6、logic; out1:out std_logic);End exen;Architecture one of exen isSignal tmp:std_logic;Begin process(clk0) begin if rising_edge(clk0) then tmp=not(tmp or cl); end if; end process;Out1=not tmp;End one;,4-5. 给出1位全减器的VHDL描述。要求:(1) 首先设计1位半减器,然后用例化语句将它们连接起来,图4-20中h_suber是半减器,diff是输出差,s_out是借位输出,sub_in是借位输入。

7、(2) 以1位全减器为基本硬件,构成串行借位的8位减法器,要求用例化语句来完成此项设计(减法运算是 x y - sun_in = diffr)。,图4-19 时序电路图,t0,t1,t2,(1)先设计一个半减器Library ieee; use ieee.std_logic_1164.alll;Entity h_suber isPort(x,y:in std_logic; diff,s_out:out std_logic); end h_suber;Architecture behav of h_suber isBegin process(x,y) begin diff=x xor y; s_

8、outx,y=y,diff=t0,s_out=t1);u2:h_suber port map(x=t0,y=sub_in,diff=diffr,s_out=t2);Sub_out=t1 or t2;End behav;,(2)8位全减器(生成语句第九章)Library ieee; use ieee.std_logic_1164.alll;Entity suber8 isPort(a,b:in std_logic_vector(7 downto 0); Sin:in std_logic;sout:out std_logic; C:out std_logic_vector(7 doento 0);

9、End sub8; Architecture behav of suber8 isComponent suberPort(x,y,sub_in:in std_logic; diffr,sub_out:out std_logic); End component;Signal stmp:std_logic_vector(8 downto 0);Begin stmp(0=sin; Souta(i),y=b(i),diffr=c(i),sub_out=stmp(i+1);End generate; end;,4-6. 根据图4-21,写出顶层文件MX3256.VHD的VHDL设计文件。,图4-21 题

10、4-6电路图,t1,t2,t3,t4,Library ieee; use ieee.std_logic_1164.alll;Entity mx3256 isPort(ina,inb,inck,inc:in std_logic; e,out1:out std_logic);End mx3256; Architecture behav of mx3256 isComponent lk35Port(a1,a2,clk:in std_logic; q1,q2:out std_logic); End component;Signal t1,t2,t3,t4:std_logic;Begin u1:lk35 port map(a1=ina,a2=inb,clk=inck,q1=t3,q2=t2); U2: lk35 port map(a1=t2,a2=t1,clk=inck,q1=t4,q2=out1);Process(inck,inc)Begin if(inc=0)then t1=0; elsif(rising_edge(inck) then t1=t2;End if; end process;E=t4 when t2=0 else t3; end;,

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

当前位置:首页 > 电子/通信 > 综合/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号