Last active
April 2, 2023 15:20
-
-
Save smirnovich/c045e4afb71c21be44a559455f7adc36 to your computer and use it in GitHub Desktop.
VHDL process block example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library ieee; | |
use ieee.std_logic_1164.all; | |
entity simple_process is | |
port( | |
cmd : in std_logic; | |
d1 : in std_logic_vector(3 downto 0); | |
d2 : in std_logic_vector(3 downto 0); | |
o1 : out std_logic_vector(3 downto 0) | |
); | |
end entity; | |
architecture rtl of simple_process is | |
signal dd : std_logic_vector(3 downto 0); | |
begin | |
o1 <= not(dd); | |
process(d1,d2,cmd) | |
begin | |
if (cmd = '1') then | |
dd <= d1 and d2; | |
else | |
dd <= d1 or d2; | |
end if; | |
end process; | |
end rtl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment