【文章內(nèi)容簡介】
end if。 end if。 end if。 end process。 end block b。 c:blocktimer/counter 0,1 begin qa(15 downto 8)=counth0。 qa(7 downto 0)=countl0。 qb(15 downto 8)=counth1。 qb(7 downto 0)=countl1。 process(clk,reset) begin if reset=39。139。then countl0=conv_unsigned(0,8)。 counth0=conv_unsigned(0,8)。 countl1=conv_unsigned(0,8)。 counth1=conv_unsigned(0,8)。 tf0_o=39。039。 tf1_o=39。039。 else if clk39。event and clk=39。139。then case m is Timer/Counter 0 mode 0 when00= if tr00=39。139。then if(c0=39。039。)or(t0_v=39。139。and c0=39。139。)then if qa=conv_unsigned(8191,16)then tf0_o=39。139。 else tf0_o=39。039。 end if。 end if。 end if。 if ec=00and ec_ e=39。139。then countl0=unsigned(load_i)。 21 else if tr00=39。139。then if c0=39。039。then if qa=conv_unsigned(8191,16)then countl0=conv_unsigned(0,8)。 else countl0=countl0+conv_unsigned(1,1)。 end if。 else if t0_v=39。139。then if qa=conv_unsigned(8191,16)then countl0=conv_unsigned(0,8)。 else countl0=countl0+conv_unsigned(1,1)。 end if。 end if。 end if。 end if。 end if。 if ec=10and ec_e=39。139。then counth0=unsigned(load_i)。 else if tr00=39。139。then if c0=39。039。then if qa=conv_unsigned(8191,16)then counth0=conv_unsigned(0,8)。 else if countl0=conv_unsigned(255,8)then counth0=counth0+conv_unsigned(1,1)。 end if。 end if。 else if t0_v=39。139。then if qa=conv_unsigned(8191,16)then counth0=conv_unsigned(0,8)。 else if countl0=conv_unsigned(255,8)then counth0=counth0+conv_unsigned(1,1)。 end if。 end if。 end if。 end if。 end if。end if。 mode 1 when01= if tr00=39。139。then if(c0=39。039。)or(t0_v=39。139。and c0=39。139。)then if qa=conv_unsigned(65535,16)then tf0_o=39。139。 22 else tf0_o=39。039。 end if。 end if。 end if。 if ec=00and ec_e=39。139。then countl0=unsigned(load_i)。 else if tr00=39。139。then if c0=39。039。then if qa=conv_unsigned(65535,16)then countl0=conv_unsigned(0,8)。 else countl0=countl0+conv_unsigned(1,1)。 end if。 else if t0_v=39。139。then if qa=conv_unsigned(65535,16)then countl0=conv_unsigned(0,8)。 else countl0=countl0+conv_unsigned(1,1)。 end if。 end if。 end if。 end if。 end if。 if ec=10and ec_e=39。139。then counth0=unsigned(load_i)。 else if tr00=39。139。then if c0=39。039。then if qa=conv_unsigned(65535,16)then counth0=conv_unsigned(0,8)。 else if countl0=conv_unsigned(255,8)then counth0=counth0+conv_unsigned(1,1)。 end if。 end if。 else if t0_v=39。139。then if qa=conv_unsigned(65535,16)then counth0=conv_unsigned(0,8)。 else if countl0=conv_unsigned(255,8)then counth0=counth0+conv_unsigned(1,1)。 end if。 end if。 end if。 end if。 end if。 end if。 23 mode 2 when10= if tr00=39。139。then if(c0=39。039。)or(t0_v=39。139。and c0=39。139。)then if qa(7 downto 0)=conv_unsigned(255,8)then tf0_o=39。139。 else tf0_o=39。039。 end if。 end if。 end if。 if ec=00and ec_e=39。139。then countl0=unsigned(load_i)。 else if tr00=39。139。then if c0=39。039。then if countl0=conv_unsigned(255,8)then countl0=counth0。 else countl0=countl0+conv_unsigned(1,1)。 end if。 else if t0_v=39。139。then if countl0=conv_unsigned(255,8)then countl0=counth0。 else countl0=countl0+conv_unsigned(1,1)。 end if。 end if。 end if。 end if。 end if。 if ec=10and ec_e=39。139。then counth0=unsigned(load_i)。 end if。 mode 3 when11= 24 if tr00=39。139。then if(c0=39。039。)or(t0_v=39。139。and c0=39。139。)then if qa(7 downto 0)=conv_unsigned(255,8)then tf0_o=39。139。 else tf0_o=39。039。 end if。 end if。 end if。 if ec=00and ec_e=39。139。then countl0=unsigned(load_i)。 else if tr00=39。139。then if c0=39。039。then if countl0=conv_unsigned(255,8)then countl0=conv_unsigned(0,8)。 else countl0=countl0+conv_unsigned(1,1)。 end if。 else if t0_v=39。139。then if countl0=conv_unsigned(255,8)then countl0=conv_unsigned(0,8)。 else countl0=countl0+conv_unsigned(1,1)。 end if。 end if。 e nd if。 end if。 end if。 if tr1=39