【正文】
。i_mid : mid PORT MAP(clk = clk50MHz,fangda_temp=fangda,mode=key_mode, xx = txx, yy= tyy ,qin = rgb, htin = hpos, vtin = vpos, qout =rgb1,romaddr_control = romaddr)。 i_vga800600 : vga800600 PORT MAP(clk = clk50MHz, rgbin = rgb1, hs = hs, vs = vs, r = r, g = g, b = b, htout = hpos, vtout = vpos)。 end if。139。process(clk50MHz) begin if clk50MHz39。 tyy=ttyy。 end if。039。 end if。039。一下為防出邊界檢驗(yàn)及相應(yīng)矯正操作,因?yàn)楫?dāng)ttxx和ttyy因?yàn)橐恍╇S 機(jī)的按鍵操作讓其做自減操作時(shí)可能會(huì)出現(xiàn)為負(fù)數(shù)的情況。 end if。 end case。139。 end if。 when 11 = if(ttxx=672) then yidong_x=39。139。 end if。 when 01 = if(ttxx=672) then yidong_x=39。139。 end if。 when 10 = if(ttxx=288) then yidong_x=39。139。 end if。 else case key_mode is when 00 = if(ttxx=288) then yidong_x=39。 end if。 if(ttyy=334) then yidong_y=39。139。 end if。 if(ttyy=334) then yidong_y=39。139。 end if。 if(ttyy=536) then yidong_y=39。139。 end if。 if(ttyy=536) then yidong_y=39。139。039。 end if。 if(ttyy=7) then yidong_y=39。039。 end if。039。) then ttyy:=ttyy+8。 if(yidong_y=39。圖片的首坐標(biāo)做自增運(yùn)算,否則做自減運(yùn)算 else ttxx:=ttxx12。yidong_X等于39。039。139。 end if。039。 end if。 else ttxx :=ttxx128。) then ttxx :=ttxx+128。 s2 if(fangda=39。039。 end if。end if。else yidong_y=39。 else ttxx:=ttxx+192。039。if((ttxx192)=0)then ttxx:=ttxx192。end if。else yidong_y=39。 elsif(key_mode=2) then ttxx:=ttxx+192。039。if((ttxx192)=0)then ttxx:=ttxx192。 end if。end if。else yidong_y=39。 else ttxx:=ttxx+96。039。if((ttxx96)=0)then ttxx:=ttxx96。end if。else yidong_y=39。 elsif(key_mode=2) then ttxx:=ttxx+96。039。if((ttxx96)=0)then ttxx:=ttxx96。039。 end if。)then key if( key_mode =3)then key_mode = 00。 elsif ( key1 =39。)then if(( ttxx10)9)then ttxx := ttxx10。key3 elsif ( key4 =39。039。end if。039。)then ttyy := ttyy+10。)then if( key =39。event and clkm=39。 192variable ttyy : std_logic_vector(9 downto 0) :=0011010000。 end process。 end if。 clkm = 39。039。) then if(clk_count 0011110111111110011000000)then clk_count = clk_count + 1。event and clk50MHz=39。signal yidong_y,yidong_x :std_logic。signal fangda ,yidong : std_logic 。signal clkm: std_logic。signal txx,tyy : std_logic_vector(9 downto 0)。 signal hpos: std_logic_vector(10 downto 0)。 signal clk1Hz : std_logic。 signal rgb1 : STD_LOGIC_VECTOR(7 downto 0)。 end ponent。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)。ponent midport ( clk : in std_logic。 q : OUT STD_LOGIC_VECTOR(7 downto 0) )。 ponent imgrom 圖象數(shù)據(jù)ROM,數(shù)據(jù)線8位;地址線12位 PORT(clock : IN STD_LOGIC。vtout : OUT STD_LOGIC_VECTOR(9 downto 0) )。b : OUT STD_LOGIC_VECTOR(1 downto 0)。 hs, vs : OUT STD_LOGIC。 ARCHITECTURE modelstru OF img IS ponent vga800600 VGA顯示控制模塊 PORT(clk : IN STD_LOGIC。b : out STD_LOGIC_VECTOR(1 downto 0))。hs, vs : OUT STD_LOGIC。ENTITY img IS port ( clk50MHz :