【正文】
IN STD_LOGIC。 圖象顯示頂層程序 USE 。end one。 end if。t(31 downto 24)。 elsif((ht=xx)and(ht=xx + wide)) then qout_temp=qin。 else if((vt yy) or (vt yy+long)) then qout_temp=00000111。t(31 downto 24)。 elsif((htxx)and(htxx + long)) then qout_temp=qin。if((xuanzhuanjiaodu =1 ) or (xuanzhuanjiaodu =3 )) then if((vt yy) or (vt yy+wide)) then qout_temp=00000111。 count_tempv=yy。end process。 end if。 else romaddr_control = ((ht(6 downto 1)count_temph(6 downto 1))) 270 du amp。) then romaddr_control = ((ht(5 downto 0)count_temph(5 downto 0))) 270 du amp。 WHEN OTHERS = if(fangda_temp = 39。(256(ht(8 downto 1)count_temph(8 downto 1)))。(256(ht(7 downto 0)count_temph(7 downto 0)))。039。 end if。 else romaddr_control = (64(ht(6 downto 1)count_temph(6 downto 1)))90 du amp。) then romaddr_control = (64(ht(5 downto 0)count_temph(5 downto 0)))90 du amp。 WHEN 01 = if(fangda_temp = 39。(ht(8 downto 1)count_temph(8 downto 1))。(ht(7 downto 0)count_temph(7 downto 0))。039。end process。 long =128。 long =64。039。xuanzhuanjiaodu =mode。 vt = vtin。signal long : integer range 0 to 1024。signal count_tempv : std_logic_vector(9 downto 0)。 signal qout_temp : std_logic_vector(7 downto 0)。signal ht : std_logic_vector(10 downto 0)。 end mid。qout : out std_logic_vector(7 downto 0)。htin : in std_logic_vector(10 downto 0)。 xx: in std_logic_vector(9 downto 0)。mode : in std_logic_vector(1 downto 0)。 entity mid is port (clk : in std_logic。 use 。 end ONE。 end if。 b=00。 else r=000。 g(2 downto 0)=rgbin(4 downto 2)。 end process。139。039。 end process。 end if。 else hs = 39。 this is hs pulse process(clk) begin if (rising_edge(clk)) then if((ht=800+8+8)and (ht800+8+8+80 )) then hs = 39。 end if。 end if。039。 this is Vertical counter process(clk) begin if (rising_edge(clk)) then if (ht = 800+8 ) then if(vt 625) then vt = vt + 1。 end if。)。 else ht = (others = 39。 vtout = vt。 signal vt : std_logic_vector(9 downto 0)。 end vga800600。 htout : out std_logic_vector(10 downto 0)。 b : out STD_LOGIC_VECTOR(1 downto 0)。 r : out STD_LOGIC_VECTOR(2 downto 0)。 hs : out STD_LOGIc。 use 。5. 參考文獻【1】【2】【3】【4】【5】【6】【7】【8】【9】【10】6. 附錄(程序和元件清單)(1)800*600VGA時序控制模塊代碼:library IEEE。4. 體會和感受 經過本次課程設計,學到了很多VHDL的知識,比純粹的理論教學課堂上學到的知識更多,更加深刻。經過查閱資料,發(fā)現(xiàn)VHDL中沒有能表示負數(shù)的數(shù)據(jù)類型,而在程序的運算過程中,有會出現(xiàn)負數(shù)的可能性,即在對圖片初始坐標的減運算過程中,可能會將圖片的起始坐標減成負數(shù),使圖片初始坐標變量進入未知狀態(tài),致使圖片在屏幕上立即消失的。本設計存儲的是一幅256*64的圖片,所以定義了一256*64=16384 byte的rom內存。旋轉按鈕;。 按鍵掃描控制模塊 按鍵掃描控制采用的電平觸發(fā)機制,5Hz左右的掃描頻率,適合于人們的使用習慣。這個比較容易實現(xiàn),也比較容易想到,將原來的算法改為:romaddr_control = (ht(6 downto 1)count_temph(6 downto 1)) amp。狀態(tài)的地址控制表達式。 同理可以計算出“10”、“11”狀態(tài)下的地址控制表達式,即旋轉到180176。romaddr_control = (64(ht(5 downto 0)count_temph(5 downto 0))) amp。狀態(tài)下romaddr_control的算法獲得90176。旋轉圖片在屏幕上顯示所對應的內存地址矩陣圖:0度顯示對應內存地址矩陣:0*256+00*256+1………0*256+2540*256+2551*256+01*256+1………1*256+2541*256+255.......62*256+062*256+1………