LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY fenpinqi IS PORT(clk_in:INSTD_LOGIC; clkout_1:bufferSTD_LOGIC; clkout_2:bufferSTD_LOGIC); END fenpinqi; ARCHITECTURE behave OF fenpinqi IS SIGNAL cnt_1:integerrange0to25000000; SIGNAL cnt_2:integerrange0to12500000; BEGIN PROCESS(clk_in) BEGIN IF(clk_in'EVENTAND clk_in='1')THEN IF(cnt_1=25000000)THEN cnt_1<=0; clkout_1<=NOT clkout_1; ELSE cnt_1<=cnt_1+1; ENDIF; IF(cnt_2=12500000)THEN cnt_2<=0; clkout_2<=NOT clkout_2; ELSE cnt_2<=cnt_2+1; ENDIF; ENDIF; ENDPROCESS; ENDarchitecture ;
LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; ENTITY cnt10 IS PORT(clk_in:INSTD_LOGIC; clkout_2:bufferSTD_LOGIC; cnt_1: outstd_logic_vector(6downto0); cnt_2: outstd_logic_vector(6downto0)); END cnt10; ARCHITECTURE behave OF cnt10 IS SIGNAL cnt_2HZ:integerrange0to12500000; SIGNAL cnt2: integerrange0to9; SIGNAL cnt1: integerrange0to6; BEGIN PROCESS(clk_in) BEGIN IF(clk_in'EVENTAND clk_in='1')THEN IF(cnt_2HZ=12500000)THEN cnt_2HZ<=0; clkout_2<=NOT clkout_2; ELSE cnt_2HZ<=cnt_2HZ+1; ENDIF; ENDIF; IF(clkout_2'EVENTAND clkout_2='1')THEN if(cnt2=9and cnt1=5) THEN cnt2<=0; cnt1<=0; elsif(cnt2=9) THEN cnt2<=0; cnt1<=cnt1+1; else cnt2<=cnt2+1; endif; endif; case cnt2 is when0=>cnt_2<="1000000"; when1=>cnt_2<="1111001"; when2=>cnt_2<="0100100"; when3=>cnt_2<="0110000"; when4=>cnt_2<="0011001"; when5=>cnt_2<="0010010"; when6=>cnt_2<="0000010"; when7=>cnt_2<="1111000"; when8=>cnt_2<="0000000"; when9=>cnt_2<="0010000"; ENDCASE; case cnt1 is when0=>cnt_1<="1000000"; when1=>cnt_1<="1111001"; when2=>cnt_1<="0100100"; when3=>cnt_1<="0110000"; when4=>cnt_1<="0011001"; when5=>cnt_1<="0010010"; when6=>cnt_1<="0000010"; ENDCASE; ENDPROCESS; ENDarchitecture ;
library ieee; use ieee.std_logic_1164.all; entity barkker is port(clk_in:instd_logic; \out\:outstd_logic_vector(3downto0); tap:outstd_logic); endentity; architecture behave of barkker is signal clk:std_logic; signal count:integerrange0to6; begin process(clk_in) variable n:integerrange0to50000000; begin if(clk_in'eventand clk_in='1') then n:=n+1; if(n=50000000) then n:=0; clk<=not clk; endif; endif; endprocess; process(clk) begin tap<=clk; if(clk'eventand clk='1') thenif (count<6) then count<=count+1; else count<=0; endif; endif; endprocess; process(count) begin case count is when0=>\out\<="0001"; when1=>\out\<="0001"; when2=>\out\<="0001"; when3=>\out\<="0000"; when4=>\out\<="0000"; when5=>\out\<="0001"; when6=>\out\<="0000"; endcase; endprocess; end behave;