久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 5025|回復: 0
打印 上一主題 下一主題
收起左側

vhdl驅動lcd解決了ISE聯合modelsim仿真看不見波形的問題

[復制鏈接]
跳轉到指定樓層
樓主
本帖最后由 liuqq 于 2015-5-19 23:07 編輯

搞一個月解決了ISE聯合modelsim仿真看不見波形的問題,寫了一整天代碼,最后結果還是有點問題,明天找老師幫忙吧~
  1. ----------------------------------------------------------------------------------
  2. library IEEE;
  3. use IEEE.STD_LOGIC_1164.ALL;
  4. use IEEE.STD_LOGIC_ARITH.ALL;
  5. use IEEE.STD_LOGIC_UNSIGNED.ALL;
  6. ---- Uncomment the following library
  7. declaration if instantiating
  8. ---- any Xilinx primitives in this code.
  9. --library UNISIM;
  10. --use UNISIM.VComponents.all;
  11. entity LCDb is
  12. Port ( clk : in STD_LOGIC;--48MHZ
  13. reset : in STD_LOGIC;
  14. display : in STD_LOGIC;
  15. xck : out STD_LOGIC;--6MHz
  16. din : in STD_LOGIC_VECTOR(2 downto 0);
  17. dout : out STD_LOGIC_VECTOR(7
  18. downto 0));
  19. end LCDb;
  20. architecture LCDb_arch of LCDb is
  21. signal sram1 :std_LOGIC_VECTOR(8 downto 0)
  22. :="000000000";--數據寄存器
  23. signal sram2 :std_LOGIC_VECTOR(8 downto 0)
  24. :="000000000";
  25. signal sram3 :std_LOGIC_VECTOR(8 downto 0)
  26. :="000000000";
  27. signal sram4 :std_LOGIC_VECTOR(8 downto 0)
  28. :="000000000";
  29. signal sram5 :std_LOGIC_VECTOR(8 downto 0)
  30. :="000000000";
  31. signal sram6 :std_LOGIC_VECTOR(8 downto 0)
  32. :="000000000";
  33. signal sram7 :std_LOGIC_VECTOR(8 downto 0)
  34. :="000000000";
  35. signal sram8 :std_LOGIC_VECTOR(8 downto 0)
  36. :="000000000";
  37. signal a : STD_LOGIC :='0';--系??分頻用
  38. signal b : integer range 0 to 3;--系統分頻用clk八分頻得到xck
  39. signal c : integer range 0 to 72;--寄存器數據寫入計數
  40. signal d : integer range 0 to 9;--寄存器數據讀出計數
  41. begin
  42. xck<=a;
  43. process(clk)
  44. variable a_a :integer range 0 to 3;
  45. begin
  46. if(reset='1') then
  47. if(clk'event and clk='0') then
  48. if(a_a=3) then
  49. a_a:=0;
  50. a<=not a;
  51. else
  52. a_a:=a_a+1;
  53. end
  54. if;
  55. end if;
  56. end if;
  57. end process;
  58. process(clk)
  59. begin
  60. if(display='1') then
  61. if(clk'event and clk='0') then
  62. if(c=72) then
  63. c<=0;
  64. c<=c+1;
  65. else
  66. if(c=2) then
  67. sram1(8 downto 6)<=din;
  68. c<=c+1;
  69. elsif(c=5) then
  70. c<=c+1;
  71. sram1(5 downto 3)<=din;
  72. elsif(c=8) then
  73. sram1(2 downto 0)<=din;
  74. c<=c+1;
  75. elsif(c=11) then
  76. sram2(8 downto 6)<=din;
  77. c<=c+1;
  78. elsif(c=14) then
  79. sram2(5 downto 3)<=din;
  80. c<=c+1;
  81. elsif(c=17) then
  82. sram2(2 downto 0)<=din;
  83. c<=c+1;
  84. elsif(c=20) then
  85. sram3(8 downto 6)<=din;
  86. c<=c+1;
  87. elsif(c=23) then
  88. sram3(5 downto 3)<=din;
  89. c<=c+1;
  90. elsif(c=26) then
  91. sram3(2 downto 0)<=din;
  92. c<=c+1;
  93. elsif(c=29) then
  94. sram4(8 downto 6)<=din;
  95. c<=c+1;
  96. elsif(c=32) then
  97. sram4(5 downto 3)<=din;
  98. c<=c+1;
  99. elsif(c=35) then
  100. sram4(2 downto 0)<=din;
  101. c<=c+1;
  102. elsif(c=38) then
  103. sram5(8 downto 6)<=din;
  104. c<=c+1;
  105. elsif(c=41) then
  106. sram5(5 downto 3)<=din;
  107. c<=c+1;
  108. elsif(c=44) then
  109. sram5(2 downto 0)<=din;
  110. c<=c+1;
  111. elsif(c=47) then
  112. sram6(8 downto 6)<=din;
  113. c<=c+1;
  114. elsif(c=50) then
  115. sram6(5 downto 3)<=din;
  116. c<=c+1;
  117. elsif(c=53) then
  118. sram6(2 downto 0)<=din;
  119. c<=c+1;
  120. elsif(c=56) then
  121. sram7(8 downto 6)<=din;
  122. c<=c+1;
  123. elsif(c=59) then
  124. sram7(5 downto 3)<=din;
  125. c<=c+1;
  126. elsif(c=62) then
  127. sram7(2 downto 0)<=din;
  128. c<=c+1;
  129. elsif(c=65) then
  130. sram8(8 downto 6)<=din;
  131. c<=c+1;
  132. elsif(c=68) then
  133. sram8(5 downto 3)<=din;
  134. c<=c+1;
  135. elsif(c=71) then
  136. sram8(2 downto 0)<=din;
  137. c<=c+1;
  138. else
  139. c<=c+1;
  140. end if;
  141. end
  142. if;
  143. end if;
  144. end if;
  145. end process;
  146. process(a)
  147. begin
  148. if(display='1') then
  149. if(a'event and a='0') then
  150. if(d=9) then
  151. dout<=sram1(8 downto 1);
  152. d<=0;
  153. d<=d+1;
  154. else
  155. if(d=0) then
  156. dout<=sram1(8 downto 1);
  157. elsif(d=1) then
  158. dout(7)<=sram1(0);
  159. dout(6 downto 0)<=sram2(8 downto 2);
  160. elsif(d=2) then
  161. dout(7 downto 6)<=sram2(1 downto 0);
  162. dout(5 downto 0)<=sram3(8 downto 3);
  163. elsif(d=3) then
  164. dout(7 downto 5)<=sram3(2 downto 0);
  165. dout(4 downto 0)<=sram4(8 downto 4);
  166. elsif(d=4) then
  167. dout(7 downto 4)<=sram4(3 downto 0);
  168. dout(3 downto 0)<=sram5(8 downto 5);
  169. elsif(d=5) then
  170. dout(7 downto 3)<=sram5(4 downto 0);
  171. dout(2 downto 0)<=sram6(8 downto 6);
  172. elsif(d=6) then
  173. dout(7 downto 2)<=sram6(5 downto 0);
  174. dout(1 downto 0)<=sram7(8 downto 7);
  175. elsif(d=7) then
  176. dout(7 downto 1)<=sram7(6 downto 0);
  177. dout(0)<=sram8(8);
  178. else
  179. dout<=sram8(7 downto 0);
  180. end if;
  181. d<=d+1;
  182. end
  183. if;
  184. end if;
  185. end if;
  186. end process;
  187. end LCDb_arch;
復制代碼



psb1.jpeg (113.48 KB, 下載次數: 232)

psb1.jpeg

psb.jpeg (96.88 KB, 下載次數: 249)

psb.jpeg
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 久久久久国产一区二区 | 国产成人在线视频 | 亚洲国产成人av好男人在线观看 | 99精品观看 | 在线免费观看黄a | 久久免费观看一级毛片 | 国产一区二区在线播放 | 久久久久国产一区二区三区 | 99久久精品国产一区二区三区 | 国产精品性做久久久久久 | 99综合在线 | 中文字幕一区二区不卡 | 91麻豆精品国产91久久久资源速度 | 一区二区三区在线播放 | 成人h视频在线观看 | 91免费电影 | 国产精品久久久久久久久久东京 | 婷婷激情五月网 | 91色在线| 精品视频网 | 国产露脸国语对白在线 | 成人欧美在线 | 国产精品片| 九九av | 日韩中文字幕 | 91电影院| 亚洲成人免费 | 久久精品国产a三级三级三级 | 91精品久久久久久久久久 | 亚洲69p | 欧美成人a∨高清免费观看 色999日韩 | 日韩国产高清在线观看 | 久色视频在线观看 | 国产激情在线观看 | 色播久久久 | 日韩无 | 本道综合精品 | 天天操天天天 | 日韩精品在线看 | 狠狠的干狠狠的操 | 色婷婷综合久久久久中文一区二区 |