Advertisement
milanmetal

[VHDL] Modelovanje kombinacione logike odvojeno od seq

Oct 29th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.50 KB | None | 0 0
  1.  
  2.   ```
  3.     process (clk) is
  4.     begin
  5.         if rising_edge(clk) then
  6.             if rst = '1' then
  7.                 q_reg <= conv_std_logic_vector(0, WIDTH);
  8.             else
  9.                 q_reg <= q_next;
  10.             end if;
  11.         end if;
  12.     end process;
  13.    
  14.     pulse <= '1' when q_reg = conv_std_logic_vector(9, WIDTH) else
  15.              '0';
  16.              
  17.     q_next <= conv_std_logic_vector(0, WIDTH) when q_reg < conv_std_logic_vector(9, WIDTH) else
  18.               q_reg + 1;
  19.  
  20.   ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement