Skip to content

Instantly share code, notes, and snippets.

@libertylocked
Created November 14, 2014 20:28
Show Gist options
  • Save libertylocked/1ea959cb6f959022ebd6 to your computer and use it in GitHub Desktop.
Save libertylocked/1ea959cb6f959022ebd6 to your computer and use it in GitHub Desktop.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity Latch4bit is
Port ( D : in STD_LOGIC_VECTOR(3 downto 0);
E : in STD_LOGIC;
Q : out STD_LOGIC_VECTOR(3 downto 0));
end Latch4bit;
architecture Behavioral of Latch4bit is
begin
process (E, D)
begin
if (E = '1') then
Q <= D;
end if;
end process;
end Behavioral;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment