欢迎来到天天文库
浏览记录
ID:928653
大小:81.01 KB
页数:5页
时间:2017-09-25
《可编程逻辑实验报告_实验4_组合电路设计(二)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、西安邮电学院可编程逻辑实验报告系别通信系学号Xxxxxxxx成绩实验日期2009-12-6班级通工0702姓名高原教师签字实验名称四、组合电路设计(二)一:实验目的1.掌握设计组合逻辑电路的方法。2.通过开发CPLD来实现组合逻辑电路的功能。二:实验所用仪表及主要器材计算机,鼠标,键盘,显示器,MAX+PLUSII软件三:实验原理简述(源程序、真值表、原理图)(1)二个2位二进制数相乘源程序:Libraryieee;Useieee.std_logic_1164.all;Entitye4_1_xia
2、ngchen2isPort(a:instd_logic_vector(3downto0);y:outstd_logic_vector(3downto0));End;Architecturertlofe4_1_xiangchen2isBeginProcess(a)BeginCaseaisWhen"0000"=>y<="0000";When"0001"=>y<="0000";When"0010"=>y<="0000";When"0011"=>y<="0000";When"0100"=>y<="0000
3、";When"0101"=>y<="0001";When"0110"=>y<="0010";When"0111"=>y<="0011";When"1000"=>y<="0000";When"1001"=>y<="0010";When"1010"=>y<="0100";When"1011"=>y<="0110";When"1100"=>y<="0000";When"1101"=>y<="0011";When"1110"=>y<="0110";When"1111"=>y<="1001";Whenoth
4、ers=>y<="ZZZZ";Endcase;Endprocess;End;真值表:ay00000000000100000010000000110000010000000101000101100010011100111000000010010010101001001011011011000000110100111110011011111001(2)二进制全减器Libraryieee;Useieee.std_logic_1164.all;Useieee.std_logic_unsigned.all;
5、Entitye4_2_jian2isPort(a,b,ci:instd_logic;f,co:outstd_logic);End;Architecturerel_1ofe4_2_jian2isBeginProcess(a,b,ci)BeginIf(a='0'andb='0'andci='0')thenF<='0';co<='0';elsif(a='0'andb='0'andci='1')thenF<='1';co<='1';elsif(a='0'andb='1'andci='0')thenF<='
6、1';co<='1';elsif(a='0'andb='1'andci='1')thenF<='0';co<='1';elsif(a='1'andb='0'andci='0')thenF<='1';co<='0';elsif(a=’1’andb=’0’andci=’1’)thenF<=’0’;co<=’0’;elsif(a=’1’andb=’1’andci=’0’)thenF<=’0’;co<=’0’;elseF<=’1’;Co<=’1’;Endif;Endprocess;End;真值表:abci
7、fco0000000111010110110110010101001100011111(3)开关控制电路源程序:Libraryieee;Useieee.std_logic_1164.all;entitye4_3_switcherisport(a,b,c:instd_logic;f:outstd_logic);end;architecturebhvofe4_3_switcherisbeginprocess(a,b,c)beginif(a='0'andb='0'andc='0')thenf<='0';
8、elsif(a='0'andb='0'andc='1')thenf<='1';elsif(a='0'andb='1'andc='0')thenf<='1';elsif(a='0'andb='1'andc='1')thenf<='0';elsif(a='1'andb='0'andc='0')thenf<='1';elsif(a='1'andb='0'andc='1')thenf<='0';elsif(a='1'andb='1'andc='0')thenf<='0';elsif(a='
此文档下载收益归作者所有