Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- begin
- pulsetimer : process(TRIGGER, CLK) --counts wave on-time from start of trigger
- begin
- if rising_edge(CLK) then
- if TRIGGER = '1' then --trigger must be high at least length of pulse
- if x = stopticks then
- enable <= '0';
- else
- enable <= '1';
- x <= x + 1;
- end if;
- else
- enable <= '0';
- x <= 0;
- end if;
- end if;
- end process;
- waveform : process(CLK)
- begin
- if rising_edge(CLK) then
- if enable = '1' then
- if pulse14 ='1' then
- if count14 = onticks then
- count14 <= 0;
- pulse14 <= '0';
- else
- count14 <= count14+1;
- end if;
- end if;
- if pulse14 ='0' then
- if count14 = (deadticks*2 + onticks) then
- count14 <= 0;
- pulse14 <= '1';
- else
- count14 <= count14+1;
- end if;
- end if;
- if y = (deadticks + onticks) then
- if pulse23 ='1' then
- if count23 = onticks then
- count23 <= 0;
- pulse23 <= '0';
- else
- count23 <= count23+1;
- end if;
- end if;
- if pulse23 ='0' then
- if count23 = (deadticks*2 + onticks) then
- count23 <= 0;
- pulse23 <= '1';
- else
- count23 <= count23+1;
- end if;
- end if;
- else
- y <= y + 1;
- end if;
- else
- pulse14 <= '0';
- pulse23 <= '0';
- y <= 0;
- end if;
- end if;
- end process;
- G14 <= pulse14;
- G23 <= pulse23;
- LED14 <= pulse14;
- LED23 <= pulse23;
- end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement