Skip to content

Instantly share code, notes, and snippets.

@smirnovich
Created March 14, 2023 07:18
Show Gist options
  • Save smirnovich/5e490ebd65f234710abef27a116d8794 to your computer and use it in GitHub Desktop.
Save smirnovich/5e490ebd65f234710abef27a116d8794 to your computer and use it in GitHub Desktop.
Basic usage of a signal in VHDL
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity sig_example is
port(
a1 : in std_logic;
a2 : in std_logic;
o1 : out std_logic;
o2 : out std_logic
);
end entity;
architecture rtl of sig_example is
signal my_sig : std_logic; -- creating a signal
begin
o1 <= a1 or a2;
my_sig <= a1 and a2; -- using it as a connection between operation with input ports
o2 <= not(my_sig); -- and output port
end rtl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment