Skip to content
LearnTronics menu

LearnTronics

Logic Before Electronics

Tutorial Index

Logic before logic gates

Before we draw an AND gate or talk about ones and zeros, it helps to understand what logic is doing in ordinary language.

“The lamp is on.” Statement: can be True or False “Is the lamp on?” Question: not itself True or False “Switch S1 is closed.” Statement: can be True or False “Close switch S1.” Command: not itself True or False

Start with a statement

A statement (often called a proposition) is a sentence that makes a claim which can be considered true or false.

“The lamp is on.” is a statement. “Is the lamp on?” is a question. “Turn the lamp on.” is a command. Logic treats those differently.

Quantifier, subject, and predicate

When we begin building categorical statements for syllogisms, it is useful to separate a statement into three parts:

PartWhat it tells usExample
QuantifierHow much of the subject group is being discussedAll, No, Some
SubjectThe person, thing, or class we are talking aboutresistors
PredicateWhat we are saying about the subjectare electrical components
All resistors are electrical components.
Quantifier     Subject     Predicate

The quantifier is especially important when reasoning about classes of things. All makes a universal claim, no makes a universal negative claim, and some means at least one member of the group.

FormExample
All S are PAll LEDs are semiconductor devices.
No S are PNo open switches are closed switches.
Some S are PSome capacitors are polarized.
Some S are not PSome capacitors are not polarized.

Not every ordinary statement contains an explicit quantifier. “The lamp is on” and “Socrates is a person” are singular statements about one particular thing or person. But when we construct categorical syllogisms, recognizing the quantifier, subject, and predicate makes the logical form much easier to see.

Premises, conclusions, and the syllogism

An argument begins with one or more premises and asks what conclusion follows from them.

The familiar example below is a syllogism: a deductive argument in which two premises are arranged so that a conclusion follows from their relationship.

All people are mortal. ← premise
Socrates is a person. ← premise
Therefore, Socrates is mortal. ← conclusion

The important point is the form: if the premises are true and the form is valid, the conclusion must follow.

The three terms in a categorical syllogism

A traditional categorical syllogism uses exactly three terms. One appears only in the conclusion as its subject, one appears only in the conclusion as its predicate, and one links the two premises but disappears from the conclusion.

TermJobIn the example below
Minor termSubject of the conclusionGreeks
Major termPredicate of the conclusionmortal
Middle termConnects the premises; does not appear in the conclusionhumans
All humans are mortal.
All Greeks are humans.
Therefore, all Greeks are mortal.

Here, humans is the middle term. It provides the bridge between Greeks and mortal, then disappears from the conclusion.

Build a syllogism step by step

1. Decide what conclusion you want to test.
Write it as a subject and predicate: S is P, or in a categorical form such as All S are P.
2. Choose a middle term.
The middle term, M, must connect the subject of the conclusion to its predicate.
3. Write the major premise.
Connect the middle term to the predicate: All M are P.
4. Write the minor premise.
Connect the subject to the middle term: All S are M.
5. Remove the middle term in the conclusion.
If the form is valid, the bridge through M allows: Therefore, all S are P.
All M are P.
All S are M.
Therefore, all S are P.

An electronics example

All silicon diodes are semiconductor devices.
All 1N4148 diodes are silicon diodes.
Therefore, all 1N4148 diodes are semiconductor devices.

Do not merely make the sentences sound related

A valid syllogism depends on the relationship of the terms, not on the sentences sounding reasonable. For example:

All transistors are electronic components.
All resistors are electronic components.
Therefore, all resistors are transistors.

That conclusion does not follow. “Electronic components” appears in both premises, but it does not create the necessary bridge. Two different groups can both belong to a larger group without being the same group.

Quick check: A simple categorical syllogism should have two premises, one conclusion, and exactly three terms used consistently. The middle term must connect the other two terms strongly enough for the conclusion to follow.

Another way to think of this

An electrician troubleshoots this way all the time:

“If the supply is present, the fuse is good, the switch is closed, the wiring is intact, and the lamp is good, then the lamp should light.”

That is already a logical statement built from several conditions. Later we will turn those words into switches and then into logic gates.

Truth is not the same thing as validity

A premise can be wrong even when the form of an argument is valid. Logic tells us what follows if the premises are accepted. It does not magically guarantee that the premises describe the real world correctly.

As programmers often say: “Garbage in — garbage out.” Perfect reasoning applied to bad starting information can still produce a useless result.

A little history

People were reasoning, arguing, and trying to describe good reasoning long before Aristotle. Earlier Greek thinkers had already examined argument, proof, contradiction, and methods of debate.

Aristotle (384–322 BC), however, is generally credited with giving deductive reasoning its first systematic formal treatment. His study of the syllogism showed that an argument could be judged by its form: certain conclusions follow necessarily when the premises have the proper relationship. His logical works became the foundation for the formal study of logic for many centuries.

Try these yourself

Which of these is a statement that can be true or false? “The lamp is on.” Statement: can be True or False “Is the lamp on?” Question: not itself True or False “Switch S1 is closed.” Statement: can be True or False “Close switch S1.” Command: not itself True or False
“The motor is running” makes a claim that can be evaluated as true or false.
In an argument, a premise is:
Premises are the statements from which a conclusion is supposed to follow.
Can a logically valid argument begin with a false premise?
Validity asks whether the conclusion follows from the premises. A valid form can still begin with a premise that is false in the real world.
In this syllogism, which is the middle term?

All silicon diodes are semiconductor devices.
All 1N4148 diodes are silicon diodes.
Therefore, all 1N4148 diodes are semiconductor devices.
“Silicon diodes” appears in both premises and disappears from the conclusion, so it is the middle term.
Which conclusion follows from these premises?

All LEDs are diodes.
All diodes are electronic components.
LEDs are inside the class of diodes, and diodes are inside the class of electronic components. Therefore LEDs are also electronic components.

A little deeper

In modern symbolic logic, a simple statement is often represented by a letter such as A or B. Instead of repeatedly writing “the motor is running,” we can simply let A mean “the motor is running.” Then we can study how statements combine without being distracted by the subject matter.