Advertisement
Mikestriken

Program_Counter

Apr 7th, 2023 (edited)
1,946
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.73 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3. use IEEE.NUMERIC_STD.ALL;
  4.  
  5. entity program_counter is
  6.     port (
  7.         clk     : in  std_logic;
  8.         rst     : in  std_logic; -- reset
  9.         pc_in   : in  std_logic_vector(63 downto 0);
  10.         pc_out  : out std_logic_vector(63 downto 0)
  11.     );
  12. end entity program_counter;
  13.  
  14. architecture behavioral of program_counter is
  15.     signal pc_reg : std_logic_vector(63 downto 0);
  16. begin
  17.     -- Clock logic
  18.     process (clk)
  19.     begin
  20.         if rst = '1' then
  21.             pc_reg <= (others => '0');
  22.         elsif rising_edge(clk) then
  23.             pc_reg <= pc_in;
  24.         end if;
  25.     end process;
  26.    
  27.     -- Signal Assignment
  28.     pc_out <= pc_reg;
  29. end architecture behavioral;
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement