数字电路实验报告.docVIP

  • 16
  • 0
  • 约8.25千字
  • 约 14页
  • 2023-10-11 发布于未知
  • 举报
实验一、半加器与全加器的电路图实现 半加器 1、半加器的电路图——见图1 图1——半加器的电路图 2、半加器仿真波形图——见图2 图2——半加器仿真波形图 3、仿真图简析:如图2,为半加器仿真波形图。对应a,b输入波形,得到的c为进位,s为和。如a=1,b=0,c=0,s=1. 4、半加器的VHDL语言为: library ieee; use ieee.std_logic_1164.all; entity tx23p31 is port (a,b:in std_logic; co,so:out std_logic); end entity tx23p31; architecture a of tx23p31 is begin so= a xor b; co= a and b; end; 全加器 1、全加器的电路图——见图3 图3——全加器的电路图 2、全加器的VHDL语言 library ieee; use ieee.std_logic_1164.all; entity tx23p3 is port (ain,bin,cin:in std_logic; cout,sum:out std_logic); end entity tx23p3; architecture a of tx23p3 is component tx23p31 port(a,b:in std_logic; co,so: out std_logic); end component; signal d,e,f:std_logic; begin u1:tx23p31 port map (a=ain,b=bin,co=d,so=e); u2:tx23p31 port map (a=e,b=cin,co=f,so=sum); cout=d or f; end; 3、全加器的RTL viewer:见图4 图4——全加器的RTL viewer 实验二、函数发生器 1、电路图——见图5 图5——函数发生器的实验电路图 2、函数发生器的仿真波形图——见图6 图6——函数发生器的仿真波形图 3、波形图仿真分析:如上图,当a,b,c的取值为0,4,6,7时,f=1;其他时刻,f=0。如第一列波形,a=0,b=0,c=0,此时f=1. 实验三、四选一数据选择器 library ieee; use ieee.std_logic_1164.all; entity tx23w1 is port(a:in std_logic_vector(1 downto 0); d:in std_logic_vector(3 downto 0); y:out std_logic); end tx23w1; architecture mux4 of tx23w1 is begin process(a,d) begin case a is when 00 = y=d(0); when 01 = y=d(1); when 10 = y=d(2); when 11 = y=d(3); when others=y=0; end case; end process; end mux4; 图7——四选一数据选择器波形图 实验四、裁判器 library ieee; use ieee.std_logic_1164.all; entity tx23w2 is port(a:in std_logic_vector(2 downto 0); y:out std_logic_vector(1 downto 0)); end tx23w2; architecture mux8 of tx23w2 is begin process(a) begin case a is when 000 = y= 00; when 001 = y= 00; when 010 = y= 00; when 011 = y= 10; when 100 = y= 10; when 101 = y= 11; when 110 = y= 11; when 111 = y= 11; when others= y=00; end case; end process; end mux8; 图8——裁判表决器 实验五、50M分频器 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity tx23w3 is port (

文档评论(0)

1亿VIP精品文档

相关文档