Exploring Logical Operators in Electronic Circuits: A Refreshing Reminder

In summary, the conversation discussed logical operators in an electronic circuits lab and the speaker was fascinated by one that depended on the previous value. However, they could only vaguely remember the details and asked for a refresher. The other person suggested a flip-flop as a possible solution.
  • #1
Jamison Lahman
143
35
While at university, we went over logical operators for our electronic circuits lab. There was one that depended on the previous value which fascinated my deeply, but for some reason I can't remember it. I only vaguely remember it so I apologize if I mess up what actually happened. From what I remember, both A and B were false. We then made one true and depending whether that was true or false, after making both true, the next switch would be dependent on the result of when one was true. I can't think of any way this would be true. Anyone that remotely knows what I'm talking about please refresh me!
cheers
 
Physics news on Phys.org
  • #4
Jamison Lahman said:
YES. This is exactly it. Bless you, Jedi.
No problem. I use a lot of them in my electronics.
 

1. What are logical operators and how do they work?

Logical operators are symbols or words used to combine two or more conditions in a statement and produce a logical result. They include AND, OR, and NOT. AND returns true only if all conditions are true. OR returns true if at least one condition is true. NOT returns the opposite of the given condition.

2. How are logical operators used in programming?

Logical operators are used in programming to control the flow of a program based on certain conditions. They are commonly used in if-else statements and while/for loops to determine which block of code should be executed based on the value of the logical expression.

3. What is the order of precedence for logical operators?

The order of precedence for logical operators is NOT, followed by AND, and then OR. This means that NOT is evaluated first, followed by AND, and then OR. To override this order, parentheses can be used to specify the desired grouping of logical expressions.

4. Can logical operators be used with non-boolean values?

Yes, in some programming languages, logical operators can be used with non-boolean values. These values are first converted to boolean values and then evaluated. For example, in JavaScript, the string "hello" will be converted to true, while the empty string "" will be converted to false.

5. What is short-circuit evaluation in logical operators?

Short-circuit evaluation is a behavior of logical operators where the second operand is not evaluated if the result can be determined by the first operand alone. For example, in an AND operation, if the first operand is false, the second operand will not be evaluated because the result will always be false. This can improve the efficiency of a program by avoiding unnecessary evaluations.

Similar threads

  • Computing and Technology
Replies
14
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • STEM Academic Advising
Replies
16
Views
510
Replies
2
Views
336
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
4K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
5K
Back
Top