Created
March 14, 2023 07:20
-
-
Save smirnovich/767f9f6a5f95feca95f29ae29ac86dee to your computer and use it in GitHub Desktop.
VHDL using signal in sequential logic
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; | |
use ieee.numeric_std.all; | |
entity sig_seq is | |
port( | |
clk : in std_logic; | |
a1 : in std_logic; | |
a2 : in std_logic; | |
o1 : out std_logic | |
); | |
end entity; | |
architecture rtl of sig_example is | |
signal my_sig : std_logic; -- initializing signal | |
begin | |
process(clk) | |
begin | |
if rising_edge(clk) then | |
my_sig <= a1 and a2; -- both operations are simultaneous for execution | |
o1 <= not(my_sig); -- but they executed only with positive edge of clk | |
end if; | |
end process; | |
end rtl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment