资源描述:
《pld应用程序举例.doc》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、PLD段码显示libraryieee;useieee.std_logic_1164.all;entityduanmaisport(fff:outbit_vector(1to5);aaa:outbit_vector(1to5));end;architecturekkofduanmaisbeginfff(1to5)<="11111";aaa(1to5)<="11111";end;PLD三个数加法编程libraryieee;useieee.std_logic_1164.all;entityjwisport(in1,in
2、2:inintegerrange0to15;a,b:outstd_logic_vector(1to7));end;architectureggofjwissignalhe:integerrange0to45;36/36beginhe<=in1+in2;withheselecta<="1111110"when0
3、10
4、20
5、30
6、40,"0110000"when1
7、11
8、21
9、31
10、41,"1101101"when2
11、12
12、22
13、32
14、42,"1111001"when3
15、13
16、23
17、33
18、43,"0110011"w
19、hen4
20、14
21、24
22、34
23、44,"1011011"when5
24、15
25、25
26、35
27、45,"1011111"when6
28、16
29、26
30、36,"1110000"when7
31、17
32、27
33、37,"1111111"when8
34、18
35、28
36、38,"1111011"when9
37、19
38、29
39、39,"0000000"whenothers;withheselectb<="0000000"when0<=heandhe<=9,else"0110000"when10<=heandhe<=19,else"1101101"when20<=hea
40、ndhe<=29,else"1111001"when30<=heandhe<=39,else36/36"0110011"when40<=heandhe<=39,else"0000000"whenothers;end;PLD八个按键两个灯libraryieee;useieee.std_logic_1164.all;entityguozi3isport(in1,in2:instd_logic_vector(1to4);a,b:outstd_logic_vector(1to8));end;architectureggo
41、fguozi3isbeginwithin1select"0110000"when"0001","1101101"when"0010","1111001"when"0011","0110011"when"0100","1011011"when"0101","1011111"when"0110","1110000"when"0111",36/36"1111111"when"1000","1111011"when"1001","0000000"whenothers;within2selectb<="0110000"wh
42、en"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"whenothers;end;PLD顺序语句编程(0加到9)libraryieee;useieee.std_logic_1164.all;entityjinche
43、nisport(in1:instd_logic;a:outstd_logic_vector(1to7));36/36end;architectureggofjinchenissignalss:integerrange0to9;beginprocessbeginwaituntilin1='1';ss<=ss+1;ifss=10thenss<=0;endif;endprocess;withssselecta<="1111110"when0,"0110000"when1,"1101101"when2,"1111001"
44、when3,"0110011"when4,"1011011"when5,"1011111"when6,"1110000"when7,"1111111"when8,36/36"1111011"when9,"0000000"whenothers;end;PLD矢量10个控制2个数码管libraryieee;useieee.std_logic_1164.all;entity k