【正文】
dd, a : out std_logic_vector(7 downto 0))。 end mine4。 architecture behav of mine4 is subtype word is std_logic_vector(7 downto 0)。 type unit is array(63 downto 0) of word。 signal ram :unit。 signal qqq : integer range 0 to 250000000。 signal qq : integer range 0 to 78125000。 signal tmp : integer range 0 to 9999。 signal coun : integer range 0 to 78125000。 signal coun0 : integer range 0 to 250000000。 signal b : integer range 0 to 78125000。 signal c : integer range 0 to 500000000。 signal z, con : integer range 0 to 63。 signal f : std_logic_vector (7 downto 0)。 signal amp, amp0, d : std_logic_vector(7 downto 0)。 signal bcd0,bcd1,bcd2,bcd3 : integer range 0 to 9。 signal bcd01,bcd11,bcd21,bcd31 : integer range 0 to 9。 signal bcd00,bcd10,bcd20,bcd3o : integer range 0 to 9。 signal y:integer range 0 to 9。 signal addr :integer range 0 to 63。 begin qq=781250 when ss=1000else 7812500 when ss=0100else 78125000 when ss=0010else 78125。 qqq= 500000 when ss=1000else 5000000 when ss=0100else 本科畢業(yè)設(shè)計(jì)說(shuō)明書(論文) 第 24 頁(yè) 共 29 頁(yè) 50000000 when ss=0010else 50000。 process(clk) variable count4 : integer range 0 to 6250000。 variable count : integer range 0 to 78125000。 variable count3 : integer range 0 to 250000000。 variable count1 : integer range 0 to 12500000。 variable count0 : integer range 0 to 3249999。 variable ddd : std_logic_vector( 9 downto 0 )。 variable dd0,dd1,dd2,dd3,dd4 : integer range 0 to 255。 variable adr : integer range 0 to 63。 begin if rising_edge(clk) then if posting=39。139。 then if count4=6249999 then count4:=0。 adr:=conv_integer(Data3)*10+conv_integer(Data2)。 if adr64 then if set=39。139。 then ram(adr)=conv_std_logic_vector((conv_integer(Data1)*10 +conv_integer(Data0))*2,8)。 elsif clr = 39。139。 then adr:=0。 for i in 0 to 63 loop ram(i)=(others=39。039。)。 end loop。 end if。 end if。 else count4:=count4+1。 end if。 else if set=39。139。 then coun=0。 b=0。 coun0=0。c=0。z=31。amp0=01111111。 addr=0。 tmp=conv_integer(Data3)*1000+conv_integer(Data2)*100+conv_integer (Data1)*10+conv_integer(Data0)。 amp=01111111。 else if tmp0 then if sw=39。039。 then if counqq then coun=coun+tmp。b=b+1。 else if count=b then count:=1。 if f =63 then f=0000000。 else f=f+1。 end if。 if sss=00010 then if con=z then dd=amp0。 con=con+1。 本科畢業(yè)設(shè)計(jì)說(shuō)明書(論文) 第 25 頁(yè) 共 29 頁(yè) elsif con=63 then con=0。dd=00000000。 else con=con+1。dd=00000000。 end if。 elsif sss= 10000then dd=d。 elsif sss=00100 then dd=f(5 downto 0)amp。00。 elsif sss=01000 then if f31 then dd=(111111f(5 downto 0))amp。00。 else dd=f(5 downto 0)amp。00。 end if。 elsif sss=00001 then if addr63 then dd=ram(addr) 。addr=addr +1。 elsif addr = 63 then dd = ram(63)。 addr = 0。 end if。 else if sss(1) =39。139。 then if con z then con = con+1。 dd0 :=conv_integer(amp0)。 else con = con+1。 dd0:= 0。 end if。 end if。 if sss(4) =39。139。 then dd1 :=conv_integer(d)。 end if。 if sss(2)=39。139。 then dd2:= conv_integer(f(5 downto 0)amp。00)。 end if。 if sss(3) =39。139。 then if f31 then dd3:=conv_integer((111111f(5 downto 0))amp。00)。 else dd3:=conv_integer(f(5 downto 0)amp。00)。 end if。 end if。 if sss(0)= 39。139。 then if addr63 then dd4:=conv_integer(ram(addr))。 addr=addr+1。 elsif addr=63 then dd4:=conv_integer(ram(63))。 addr=0。 end if。 end if。 ddd:= conv_std_logic_vector((dd0+dd1+dd2+dd3+dd4),10)。 dd=ddd(9 downto 2)。 end if。 else count:=count + 1。 end if。 end if。 else if coun0qqq then coun0=coun0+tmp。c=c+1。 else if count3=c/2 then count3:=count3+1。dd=amp0。 elsif count3=c then count3:=1。dd=00000000。 本科畢業(yè)設(shè)計(jì)說(shuō)明書(論文) 第 26 頁(yè) 共 29 頁(yè) else count3:=count3+1。 dd=00000000。 end if。 end if。 end if。 if count1 =12499999 then count1:=0。 if zu=39。139。 then if z63 then z=z+1。 else z=63。 end if。 elsif zd=39。139。 then if z0 then z=z1。 else z=0。 end if。 end if。 else count1:=count1+1。 end if。 if count0=3249999 then count0:=0。 if u0=39。139。 then if amp011111111 then amp0=amp0+1 。 else amp0=11111111。 end if。 elsif d0=39。139。 then if amp000000000 then amp0=amp01 。 else amp0=00000000。 end if。 elsif up=39。139。 then if amp011111111 then amp0=amp+1 。 else amp