西安邮电学院可编程逻辑实验报告
实验一:源代码 library ieee;
use ieee.std_logic_1164.all;
entity nand2 is
port(a,b:in std_logic; y:out std_logic ); end;
architecture re1_1 of nand2 is begin
y<=a nor b; end;
实验二:源代码
library ieee;
use ieee.std_logic_1164.all;
entity nand3 is port(a,b:in std_logic;
y:out std_logic); end;
architecture rel_2 of nand3 is signal co:std_logic_vector(1 downto 0); begin co<=a&b; process(a,b) begin case Co is
when\ when\ when\ when\ when others=>y<='X'; end case; end process; end;
西安邮电学院可编程逻辑实验报告
四:实验测量记录(数据、仿真波形图及分析、原程序分析、硬件测试实分析) 实验一仿真结果:
实验二仿真结果:
五:实验心得(实验中问题的解决方法等)
通过这几次实验对软件的使用更加熟悉,逐渐得心应手。
西安邮电学院可编程逻辑实验报告
系 别 学 号 成 绩
电院 05114093
班 级 光电1103班 姓 名 张娟娟 教师签字
实验名称 组合电路设计(一)
一:实验目的
1.掌握设计组合逻辑电路的方法。
2.通过开发cpld来实现组合逻辑电路的功能。
二:实验所用仪表及主要器材
PC,可编程逻辑电路板,下载线,USB电源线,双踪示波器,数字万用表,导线若干。 三:实验原理简述(原程序.真值表.原理图)
多数表决: library ieee;
use ieee.std_logic_1164.all;
entity duoshu is
port(a,b,c,d:in std_logic; y:out std_logic); end;
architecture rel_1 of duoshu is
signal co:std_logic_vector(3 downto 0); begin co<=a&b&c&d; process(a,b,c,d) begin case co is
when\ when\ when\ when\ when\ when\
西安邮电学院可编程逻辑实验报告
when\ when\ when\ when\ when\ when\ when\ when\ when\ when\ when others=>y<='X'; END CASE; end process; end; A 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
B 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 C 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 D 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 F 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 1
西安邮电学院可编程逻辑实验报告
代码转换
library ieee;
use ieee.std_logic_1164.all;
entity daima is
port(X0,X1,X2,X3:in std_logic;
y:out std_logic_vector(3 downto 0)); end;
architecture rel_1 of daima is
signal co:std_logic_vector(3 downto 0);
begin
co<=X0&X1&X2&X3; process(X0,X1,X2,X3) begin
case co is
when\ when\ when\ when\ when\ when\ when\ when\ when\ when\ when others=>y<=\ end case; end process; end;