Advertisement
Guest User

pulser_solo

a guest
Sep 4th, 2020
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.91 KB | None | 0 0
  1. LIBRARY ieee;
  2. use ieee.numeric_std.all;
  3. use IEEE.std_logic_1164.all;
  4.  
  5. ENTITY pulser_solo IS
  6.     generic (
  7.         max_step_value : integer
  8.     );
  9.     PORT(  
  10.             rst                     :   in  std_logic;
  11.             clk                     :   in  std_logic;
  12.            
  13.             clear                   :   in std_logic;
  14.            
  15.             current_step            :   in  integer range 0 to max_step_value;
  16.            
  17.             offset                  :   in  integer range 0 to max_step_value;
  18.             pulse_length            :   in  integer range 0 to max_step_value;
  19.  
  20.             output                  :   out std_logic
  21.         );
  22. END ENTITY pulser_solo;
  23.  
  24. ARCHITECTURE behavioural OF pulser_solo IS
  25.  
  26. begin
  27.    
  28.     pulse : process (rst, clk) is
  29.     begin
  30.         if rst = '1' then
  31.             output <= '0';
  32.         elsif rising_edge(clk) then
  33.             if clear = '1' then
  34.                 output <= '0';
  35.             elsif   current_step >= offset and
  36.                     current_step < pulse_length + offset then
  37.                
  38.                 output <= '1';
  39.             else
  40.                 output <= '0';
  41.                
  42.             end if;
  43.         end if;
  44.     end process pulse;
  45.  
  46.    
  47. end architecture behavioural;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement