找回密码
 注册

QQ登录

只需一步,快速开始

查看: 697|回复: 0

《电子设计自动化模拟试题2》山东大学20春测试答案

[复制链接]
发表于 2020-2-5 10:45:20 | 显示全部楼层 |阅读模式
电子设计自动化模拟试卷2
一、填空题
1、 EDA是________________的缩写,EDA的发展经历了三个发展阶段,分别是:________________、________________、________________。
2、FPGA和CPLD的区别                                               
                                                                     
                          。
3、PLD中输入电路的作用                                             
                                                       。
4、下列标识符中,__________是不合法的标识符。
A. State0                B. 9moon        C. Not_Ack_0                D. signall
5、请指出下列两种可编程逻辑基于的可编程结构:
FPGA 基于 ___________
CPLD 基于 ___________
6、在一个VHDL设计中idata是一个信号,数据类型为std_logic_vector,试指出下面_______赋值语句是错误的。
A.  idata <= "00001111";  B.  idata <= B"0000_1111";
C.  idata <= X"AB";       D.  idata <= 16"01";
7、INOUT和BUFFER两种端口模式,相同点是_________________________________,不同点是_______________________________________________________;下面程序中a的端口模式为______。
【程序】
process
begin
a<=a+1;
end process;
二、名词解释
1、LUT
2、JTAG
3、GAL
4、EAB
5、HDL三、分析题
1、分析下面程序,要求画出电路原理图,写出原理图的表达式或真值表,说明其功能。其中and_2、or_2、xor_2分别为已编译好的两输入与门、或门和异或门。
LIBRARY IEEEE;
USE IEEE.STD_LOGIC_1164.ALL;
ENTITY cell IS
  PORT (a,b,c: IN STD_LOGIC;
        p,q:OUT STD_LOGIC);
END cell;
ARCHITECTURE struc OF cell IS
  COMPONENT and_2
      PORT (x,y: in  bit; z: out  bit);
  END COMPONENT;
  COMPONENT or_2
      PORT (x,y: in  bit; z: out  bit);
  END COMPONENT;
  COMPONENT xor_2
      PORT (x,y: in bit; z: out  bit);
  END COMPONENT;
SIGNAL s1, s2, s3: BIT;
BEGIN
  u1: xor_2 PORT MAP (x => a, y => b, z => s1);
  u2: xor_2 PORT MAP (x => s1, y => c, z => p);
u3: or_2  PORT MAP (x =>s2, y => s3, z => q);
u4: and_2 PORT MAP (x => s1, y => c, z => s3);
u5: and_2 PORT MAP (x => a, y => b, z => s2);
END struc; 四、设计题
1、利用VHDL语言实现以下的控制电路: 有4 盏灯,有四种不同的工作模式(即灯的亮与不亮有四种情况), 用输入信号sw0和sw1控制不同的工作模式,如下。00表示第一个灯亮,其余的灯都不亮;01表示第二个灯亮,其余的灯都不亮;10表示第三个灯亮,其余的灯都不亮;11表示第四个灯亮,其余的灯都不亮。2、综合题

已知状态机状态图如图(a)所示;完成下列各题:
试判断该状态机类型,并说明理由。
根据状态图(a),写出对应于结构图(b)的由主控组合进程和主控时序进程组成的VHDL有限状态机描述。
若已知输入信号如下图所示,分析状态机的工作时序,画出该状态机的状态转换值(current_state)和输出控制信号(outa)。
4、若状态机仿真过程中出现毛刺现象,应如何消除;简单说明其原理。四、设计题参考答案
1、
参考答案:
library ieee;
use ieee.std_logic_1164.all;entity control is
   port(sw0,sw1:in std_logic;
light?ut std_logic_vector(3 downto 0));
end entity control;architecture behav of control is
signal con_sig: std_logic_vector(1 downto 0);
begin
con_sig <= sw0 & sw1;
process(con_sig)
  begin
  case con_sig is
when “00” => light<=“0001”;
when “01” => light<=“0010”;
when “10” => light<=“0100”;
when others => light<=“1000”;
  end case;
end process;
end behav;2、参考答案:
(1) moore型有限状态机
   理由:其输出信号仅与当前状态有关。
(2)
library ieee;
use ieee.std_logic_1164.all;entity state_machine is
port  (  reset,clk   :  in   std_logic;
ina       :  in   std_logic_vector(1 downto 0);
            outa      :  out  std_logic);
end  state_machine;architecture  behav of state_machine is
     type state_type is  (s0,s1,s2,s3);
     signal present_state,next_state : state_type;
   begin
process1:
  process (present_state,ready,read_write)
  begin
   case present_state is
     when s0 =>outa<=”0000”;
               if(ina=”00”)  then   next_state<=s1;
               else next_state<=s0;
                    end if;
     when s1 =>outa<=”0001”;
               next_state<=s2;
     when s2 =>outa<=”1100”;
               if(ina=”11”)  then   next_state<=s3;
               else next_state<=s2;
                    end if;
     when s3 =>outa<=”1111”;
               if(ina=”00”)  then   next_state<=s0;
               else next_state<=s3;
                    end if;
     when others => outa <= “0000”;
                  next_state<=s0;
   end case;
  end process;process2:
   process  (reset,clk)
   begin
        if  reset=`1`  then  present_state<=s0;
        elsif (clk’event and clk=’1’) then   present_state<=next_state;
        end  if;
   end process; end state_machine;
(3)

(4)
同步信号输出方式;原理:输出逻辑后端加一个寄存器,消除由于组合逻辑电路输出而引起的毛刺。
状态直接输出的方式;原理:直接把状态作为输出信号,这样输出信号就直接来自于寄存器,从而避免了“毛刺”现象的产生;
并行译码的信号输出方式;原理:通过对此态进行译码并在后面加寄存器,输出来自寄存器,避免毛刺的产生。www.ap5u.com

QQ|手机版|小黑屋|网站地图|无忧答案网 ( 冀ICP备18010495号-1 )

GMT+8, 2024-5-3 13:57

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表