Advertisement
CyKlop3345

VHDL. Reg

May 20th, 2023
2,058
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.53 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3. use ieee.numeric_std.all;
  4.  
  5. entity Test is
  6.     generic(
  7.         constant init : std_logic
  8.     );
  9.     port (
  10.         x : in std_logic;
  11.         reset : in std_logic;
  12.         clk : in std_logic;
  13.         y : out std_logic := init -- Задание значния по умолчанию
  14.     );
  15. end entity Test;
  16.  
  17. architecture dataflow of Test is
  18. begin
  19.    
  20.     proc : process (clk, reset)
  21.     begin
  22.         if reset = '1' then
  23.             y <= init;
  24.         elsif rising_edge(clk) then
  25.             y <= x;
  26.         end if;
  27.     end process;
  28.  
  29. end architecture dataflow;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement