Digital Technologies - Lecture 2: Logic Gates and Truth Tables
Combinational Logic
Dr. Lijuan Wang, Room 1.33, Jennison Building, Email: L.Wang@kent.ac.uk
Course Overview – Combinational Logic
- Lecture 1: Introduction to digital signals
- Lecture 2: Logic gates and truth tables
- Lecture 3: Introduction to minimisation
- Lecture 4: Minimisation using Karnaugh Maps
- Lecture 5: Boolean algebra, De Morgan’s theorem, Duality
- Lecture 6: Combinational logic circuits
Digital Operation
- Digital signals operate at two states:
- High / Low
- '1' / '0'
- 5V, 3.3 V / 0V
- Asserted / Not-asserted
- Activated / Not-activated
Basic Logic Gates
AND Gate
- Symbol: “ . ” is read as “AND”
- Y will only be activated if A AND B are activated.
- Boolean Expression/Logic Function:
AND Gate Example
- Lift will only move if the floor has been selected AND the door closed sensor has been activated.
- Move Lift in Selected Direction occurs when Floor Selected by Pressing Button (Returns '1' when button pressed) AND Door Closed Sensor Activated (returns '1' when the door is closed).
Multiple Input AND Gate
- Y will only be activated if A AND B AND C AND D are activated.
- Y will not be activated if any of the inputs are low.
- Logic Function:
OR Gate
- Symbol: “ + ” is read as “OR”
- Y will be activated if A OR B are activated.
- Logic Function:
OR Gate Example
- Fire alarm will be triggered if smoke/fire is detected in any room.
- Sound Alarm if Sensor in Lecture room (Set to '1' when smoke/fire detected) OR Sensor in Lab (Set to '1' when Smoke/fire detected).
Multiple Input OR Gate
- Y will be activated if A OR B OR C OR D is activated.
- Y will NOT be activated only if all inputs are low.
- Logic Function:
NOT Gate (Inverter)
- Note: read as “Y is NOT A”
- A single-input logic gate
NOT Gate Example
- The door will stop spinning if the stop sensor is activated.
- Rotating Door Control ('1' = rotate, '0' = stop) is the inverse of Door Stop Sensor ('1' = object detected, '0' = no object).
Truth Tables
- Two-variable Truth Table:
| A | B | Z |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
- Three-variable Truth Table:
| A | B | C | Z |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 |
Truth Tables of Basic Logic Gates
OR
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
AND
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
NOT
| A | Y |
|---|---|
| 0 | 1 |
| 1 | 0 |
Digital Circuit Analysis
- For logic gates, we define their operation by the truth table.
- Digital systems are made from interconnections of many gates.
- How do we analyze more complicated circuits?
A simple circuit
A simple circuit example with AND and NOT operations.
A simple circuit Truth Table
Create the truth table and populate it to understand circuit behavior.
| A | B | C | And_op | Not_op |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
Symbolic Notation
Examples of symbolic notation for logic gates in circuits.
Symbolic Notation - Examples
Illustration of symbolic notation with multiple examples.
Symbolic Notation - Non-Equivalence
Examples highlighting non-equivalence in symbolic notation.
Symbolic Notation - Precedence
- What does this mean?
- An alternative to using brackets is to adopt a convention for precedence of operations or binding order.
Other Logic Gates
Introduction to other logic gates like NAND, NOR, XOR, and NXOR (XNOR).
| Gate | A | B | Output Y |
| :---- | :-: | :-: | :------- |
| NAND | A | B | |
| NOR | A | B | |
| XOR | A | B | A⊕B |
| NXOR | A | B | |
Other Logic Gates
- NAND, NOR, and NXOR gates are equivalent to AND, OR, and XOR (respectively) with a NOT gate on the output.
Logic ICs
Examples of Logic ICs: 74HC08 Quad 2-Input AND Gate, 74HC00 Quad 2-Input NAND Gate
Logic ICs
Examples of Logic ICs:
- 74HC32 Quad 2-Input OR Gate
- 74HC20 Dual 4-Input NAND Gate
Exercise
- Complete the Truth Table to analyse the output
- What do you observe? Can this circuit be replaced with an alternative that will do exactly the same operation?
- If so, what are the advantages of the alterative circuit?
Exercise - Truth Table analysis
Truth Table analysis of a given circuit.
| a | b | c | n1 | n2 | n3 | n4 | op |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | |||||
| 0 | 0 | 1 | |||||
| 0 | 1 | 0 | |||||
| 0 | 1 | 1 | |||||
| 1 | 0 | 0 | |||||
| 1 | 0 | 1 | |||||
| 1 | 1 | 0 | |||||
| 1 | 1 | 1 |