Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
538 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 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...