u3 do aa 8 q u2 sel 8 nse ab u1 二选一数据选择器的电路原理图
26 二选一数据选择器的电路原理图 & & ≥1 1 d0 d1 sel q aa nsel ab u1 u2 u3
试分析下述VHDL语言描述的电路功能: LIBRARY EEE USE EEE.std logic 1164.all ENTITY exercise s PORT(A, B,Carry. in: IN std logic AB, Carry_ out: OUT std logic); END exercise, ARCHITECTURE Structure oF exercise s Signal Temp sum, Temp carry1, Temp carry 2: std logic coMPonenT half adder PORTX,Y:N std logic, sum, Carry: OUT std logic) END COMPONENT. 27
27 LIBRARY IEEE; USE IEEE.std_logic_1164.all; ENTITY exercise IS PORT(A,B,Carry_in:IN std_logic; AB,Carry_out:OUT std_logic); END exercise; ARCHITECTURE structure OF exercise IS Signal Temp_sum,Temp_carry1,Temp_carry2:std_logic; COMPONENT half_adder PORT(X,Y:IN std_logic; sum,Carry:OUT std_logic); END COMPONENT; 试分析下述VHDL语言描述的电路功能:
COMPONENT or adder PORT(IN1, IN2:N std logic, OUT1: OUT std logic); END COMPONENT BEGIN Uo. half adder Port map (A, B,Temp sum, Temp carry1); U. half adder POrT maP (Temp sum, Carry in, AB, Temp carry 2); U2: or gate PORT MAP (Temp carry1,Temp carry2, Carry out) END Structure:
28 COMPONENT or_adder PORT(IN1,IN2:IN std_logic; OUT1:OUT std_logic); END COMPONENT; BEGIN U0 :half_adder PORT MAP (A,B,Temp_sum,Temp_carry1); U1 :half_adder PORT MAP (Temp_sum,Carry_in,AB,Temp_carry2); U2 :or_gate PORT MAP (Temp_carry1,Temp_carry2,Carry_out); END structure;
3配置( Configuration) 作用:一个实体可以有多个构造体,当对某实体 进行仿真或综合时,需将该实体与它的一个构 造体连接起来;当某实体被其他实体引用时, 需指定所生成的例元与该实体的哪个构造体相 对应。 CONFIGURATION配置名OF实体名|sA 语句说明 END配置名; 29
29 3.配置(Configuration) 作用:一个实体可以有多个构造体,当对某实体 进行仿真或综合时,需将该实体与它的一个构 造体连接起来;当某实体被其他实体 引用时, 需指定所生成的例元与该实体的哪个构造体相 对应。 CONFIGURATION 配置名 OF 实体名 IS 语句说明 END 配置名;
例11.63关于RS触发器的实例。 ENTITY rsff Is PORT (set, reset: IN BIT; a, qb: BUFFER BT) END rsff ARCHITECTURE netlist oF rsff Is COMPONENT nand2 PORT(a, b: IN BIT; C: OUT BIT END COMPONENT BEGIN U1: nand2 PORT MAP(a=>set, b=>gb, c=>q: U1: nand2 PORT MAP(a=>reset, b=>g, c=>qb); END netlist: 30
30 ENTITY rsff IS PORT (set,reset: IN BIT;q,qb:BUFFER BIT); END rsff ; ARCHITECTURE netlist OF rsff IS COMPONENT nand2 PORT ( a,b:IN BIT;c:OUT BIT) END COMPONENT; BEGIN U1: nand2 PORT MAP(a=>set,b=>qb,c=>q); U1: nand2 PORT MAP(a=>reset,b=>q,c=>qb); END netlist; 例11.6.3 关于RS触发器的实例