Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
509 views
in Technique[技术] by (71.8m points)

vhdl - Using std_logic_vector with logical operators

I'm trying to use logical operators on an std_logic_vector signal and an std_logic signal, and get an output of either logic 1 (high) or logic 0 (low) and place it in room1 signal

entity sample is
   port(
       source: in std_logic_vector(2 downto 0);
       sw1: in std_logic;
       sw2: in std_logic;
       room1: out std_logic;
       room2: out std_logic
  );
end entity;

architecture behv of sample is
begin
  process (source, sw1, sw2)
  begin
    room1 <= (source="01" and sw1);
  wait for 10 ns;

end behv;

However, I'm getting errors. I'm new to vhdl, how is this done? Thank you!

question from:https://stackoverflow.com/questions/65929565/using-std-logic-vector-with-logical-operators

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...