(PLD可编程逻辑器件)pld应用程序举例

上传人:精****库 文档编号:137641121 上传时间:2020-07-10 格式:DOCX 页数:36 大小:14.59KB
返回 下载 相关 举报
(PLD可编程逻辑器件)pld应用程序举例_第1页
第1页 / 共36页
(PLD可编程逻辑器件)pld应用程序举例_第2页
第2页 / 共36页
(PLD可编程逻辑器件)pld应用程序举例_第3页
第3页 / 共36页
(PLD可编程逻辑器件)pld应用程序举例_第4页
第4页 / 共36页
(PLD可编程逻辑器件)pld应用程序举例_第5页
第5页 / 共36页
点击查看更多>>
资源描述

《(PLD可编程逻辑器件)pld应用程序举例》由会员分享,可在线阅读,更多相关《(PLD可编程逻辑器件)pld应用程序举例(36页珍藏版)》请在金锄头文库上搜索。

1、PLD段码显示library ieee;use ieee.std_logic_1164.all;entity duanma isport(fff:out bit_vector(1 to 5);aaa:out bit_vector(1 to 5);end;architecture kk of duanma isbegin fff(1 to 5)=11111;aaa(1 to 5)=11111;end;PLD三个数加法编程library ieee;use ieee.std_logic_1164.all;entity jw isport(in1,in2:in integer range 0 to 1

2、5;a,b:out std_logic_vector(1 to 7);end;architecture gg of jw issignal he:integer range 0 to 45;beginhe=in1+in2;with he selecta=1111110 when 0|10|20|30|40, 0110000 when 1|11|21|31|41, 1101101 when 2|12|22|32|42, 1111001 when 3|13|23|33|43, 0110011 when 4|14|24|34|44, 1011011 when 5|15|25|35|45, 10111

3、11 when 6|16|26|36, 1110000 when 7|17|27|37, 1111111 when 8|18|28|38, 1111011 when 9|19|29|39, 0000000 when others;with he selectb=0000000 when 0=he and he=9,else 0110000 when 10=he and he=19,else 1101101 when 20=he and he=29,else 1111001 when 30=he and he=39,else 0110011 when 40=he and he=39,else 0

4、000000 when others;end;PLD八个按键两个灯library ieee;use ieee.std_logic_1164.all;entity guozi3 isport(in1,in2:in std_logic_vector(1 to 4);a,b:out std_logic_vector(1 to 8);end;architecture gg of guozi3 isbeginwith in1 select0110000 when 0001,1101101 when 0010,1111001 when 0011,0110011 when 0100,1011011 when

5、 0101,1011111 when 0110,1110000 when 0111,1111111 when 1000,1111011 when 1001,0000000 when others;with in2 selectb=0110000when 0001,1101101 when 0010,1111001 when 0011,0110011 when 0100,1011011 when 0101,1011111 when 0110,1110000 when 0111,1111111 when 1000,1111011 when 1001,0000000 when others;end;

6、PLD顺序语句编程(0加到9)library ieee;use ieee.std_logic_1164.all;entity jinchen isport(in1:in std_logic;a:out std_logic_vector(1 to 7); end;architecture gg of jinchen issignal ss:integer range 0 to 9;beginprocess beginwait until in1=1;ss=ss+1;if ss=10 then ss=0;end if;end process;with ss selecta=1111110 when

7、 0, 0110000 when 1, 1101101 when 2, 1111001 when 3, 0110011 when 4, 1011011 when 5, 1011111 when 6, 1110000 when 7, 1111111 when 8, 1111011 when 9, 0000000 when others;end;PLD矢量 10个控制2个数码管library ieee;use ieee.std_logic_1164.all;entitykongzhi2 isport (a:out bit_vector(1 to 7);b:in bit_vector(1 to 10

8、);end;architecture ff of kongzhi2 isbegina=1111110 whenb=1000000000else 0110000 when b=0100000000else 1101101 whenb=0010000000else 1111001 whenb=1001000000else 0110011 whenb=1000100000else 1011011 whenb=1000010000else 1011111 whenb=1000001000else 1110000 whenb=1000000100else 1111111 whenb=1000000010

9、else 1110011 whenb=1000000001else 0000000;end;PLD晶振50M控制数码管library ieee;use ieee.std_logic_1164.all;entity jinzheng isport(in50m:in std_logic;a:out std_logic_vector(1 to 7); end;architecture gg of jinzheng issignal in1:std_logic; signal ss:integer range 0 to 9;signal count:integer range 0 to 2500000

10、0;beginprocess beginwait until in50m=1;count=count+1;if count=25000000 thencount=0;in1=not in1;end if;end process;processbeginwait until in1=1;ss=ss+1;if ss=10 then ss=0;end if;end process;with ss selecta=1111110 when 0, 0110000 when 1, 1101101 when 2, 1111001 when 3, 0110011 when 4, 1011011 when 5,

11、 1011111 when 6, 1110000 when 7, 1111111 when 8, 1111011 when 9, 0000000 when others;end;PLD晶振50M自动跳变程序(0到59)library ieee;use ieee.std_logic_1164.all;entity jiadxx isport(in50m:in std_logic;a,b:out std_logic_vector(1 to 7);end;architecture gg of jiadxx issignal in1:std_logic; signal t,g:integer rang

12、e 0 to 9;signal count:integer range 0 to 59 25000000;beginprocess beginwait until in50m=1;count=count+1;if count=25000000 thencount=0;in1=not in1;end if;end process;processbeginwait until in1=1;g=g+1;if g=9 then if g=5 then 改变变量 g=0; t=t+1;if t=5 then t=0; end if; end if;end process;with g selecta=1

13、111110 when 0, 0110000 when 1, 1101101 when 2, 1111001 when 3, 0110011 when 4, 1011011 when 5, 1011111 when 6, 1110000 when 7, 1111111 when 8, 1111011 when 9, 0000000 when others;with t selectb=1111110 when 0, 0110000 when 1, 1101101 when 2, 1111001 when 3, 0110011 when 4, 1011011 when 5, 1011111 when 6, 1110000 when 7, 1111111 when 8, 1111011 when 9, 0000000 when others; end;PLD(1-8数码管显示)第六个显示0library ieee;use ieee.std_logic_1164.all;entity jiadxx isport(a:out std_

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 商业/管理/HR > 企业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号