Understanding logic gates and truth tables.
In our previous articles, we discussed the binary number system in relation to digital electronics. Now we’ll focus on logic gates and truth tables.
As we mentioned before, binary represents the on-off state. Boolean functions (true or false) can be implemented using electronic gates. There are a couple of points we need to be aware of:
- Electronic gates need a power supply
- Gate inputs are driven by voltages having two nominal values, e.g. 0V and 5V, representing logic 0 and logic 1, respectively.
- The gate output provides two nominal values of voltage only, e.g. 0V and 5V, representing logic 0 and logic 1, respectively. In general, there is only one output to a logic gate, except in some special cases.
- There’s always a time delay between an input being applied and the output responding.
Logic gates
Digital systems are constructed using logic gates. These gates are AND, OR, NOT, NAND, and NOR. We use truth tables to describe their operations.
AND gate
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/O4zadiT3CcDJGOkKzQLPbu4-yK5GUbubaeao4z-qgWM7OYTlz0RtBfobzhhBmD8HdCuE9-YJRGH_KeLHad1pk13_FuefqMuP65fh_0ZSA59C_WF2Vst5pShqgL5sZPuuXbZ7RBmPMoYK7AP2Fp5m0ns.png)
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/f_MY1IfxMcrt7NQ3PARm_HZ4Cs8KR0sylEzpdwUOH_I728Zys2oKqThpqvhQ1DAKguueHdcziVhIkDlr89SKggN4qv1_z42LRwRk1I4PGOGALw4rRpjJYB9rWOekNX6BWvxu7oqLUkkiHnY6d0oO14w.png)
With an AND gate, an electronic circuit gives a high output only if all of the inputs are high. The output can be written as A.B or as AB.
OR gate
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/lYb_m-T6bUeuudw11eeTrO3n1-DoL6ETzFNXRAos4UoUpAwrLMUS_tw3fJXP1eBTDw9X-6CfyjN9sbCN4sQaRgVFwUi86GE4ltVFVB9bWtAbJiP9z7o_H-WHtH0Mpv-Mpm9-z7GssIXxBZLgHyH3JmE.png)
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/z0Kx_XTb2jRIxt-0v4EZ1zjsXohwk91om9-ItR4K6KO2qXLX7vSP1q__4Upht0Ppe2HMPY5vlpS31Obl8pX4bQpl9sZh76m2T3j91BB1YegD5jRqfPBzNyLMsLZUq6Zw8XOzezENoDQV2kxBcKzbuH8.png)
With an OR gate, the electronic circuit gives a high output if one or more of the inputs are high. A plus sign is used to show the OR operation.
NOT gate
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/8-AGYgXRAaVxIh3i1p6pih7BAGZEcwIWsKyrxC4GyA1R5Qode8WNiK84yl37UL4DXp6Qg6nmZJUlZPIvgdy1snU5WsymgQ5_KbAbyw1RqzoLmHcT3HlNfqjXJtFfGzBB59zuZVH8kq2RF7zHDnh9nR0.png)
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/YydA6GupeKeE-qFfQw7q4xG4PN00fdZEt7iAOpLK58ljKjvvIkoxJjLVsfD4MjL1qXEbf3XoUlg-hUiB9TLAQgYk-5JoG9XRg8qHFvcrE685NmR7XlOiTf8kDcNZ8fkZISEUECJvUZhSO8rD58joUs.png)
The NOT gate produces an inverted version of the input at its output. It’s also known as an inverter.
If the input variable is A, the inverted output is known as NOT A. This is also shown as A’, or A with a bar over the top, as shown at the outputs. The diagrams below show two ways that the NAND logic gate can be configured to produce a NOT gate.
It can also be done using NOR logic gates in the same way.
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/ubHZ2EHEjeOtZXsdAdq0IHnzHLB0EnYypVzdY6YUZXfpg81OLEerY-GEo4X-TDRbI9rmMgM1kZFwftOm54-xFJytB610lTHGGv856kE1x85dmuPDoI7ARNk0OcpTLWhUHF-GmSXY2HT2v5GbkLKkW2U.png)
NAND gate
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/vfSqtNRTteTH3Pn5_VL9z3d2UGhhb6G3el9Dn2DxcAsNxoIUllAWrJTvwcGtpT4BxBPqUhDgbkW-TSxdHfSVbd1hFUb8aRyhbIn3ArGKdsie8iBWLc7u14wZiEhxpyiYDseCyuMxBYt9HwsY23jqaSw.png)
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/zFo9zHJAR8h4uLBOAx2L80D3qKFeZNEw1rrDm7BOIQR91u5-_nsaWpAdHUXRjxyqaJQsd7mdQLqDpXKnlwXu8KK6-zs1qofO6vRNrPZOiVEZTGVhXjP7nuEG7djsLgkLhjSr_dR6cQFSQS5SSbioYiU.png)
This is a NOT-AND gate which is equal to an AND gate followed by a NOT gate.
The outputs of all NAND gates are high if any of the inputs are low. The symbol is an AND gate with a small circle on the output. The small circle represents inversion.
NOR gate
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/r6nfmlLJADcJHNmvOEBy9G9AFhu68IY8gTa_h2MmrJaGuUBCCstQpkEQ0jfy84ae0eokp8TrEhg_oFWP191W8rzRV4Ch5mlzGBN_XuKkK4xuvWNEVY3EfQ3ICP00XzhkKNSRCKrjYIZjIyTILKaOZUA.png)
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/Av-On3DwXR2CotG37C6IF3HR9nFeGhtjbkAX9alTJyx3f_Qdy693ZS4c18sDSTl4d6f8Z3uQ8tINfKc2KWEiTXOhb6s7JCsczubHeNwzCz0T0JGME0HOAwipeTL762gB1cfoX6NgJFQPuRAaoiN6adA.png)
This is a NOT-OR gate which is equal to an OR gate followed by a NOT gate. The outputs of all NOR gates are low if any of the inputs are high.
The symbol is an OR gate with a small circle on the output. The small circle represents inversion. The NAND and NOR gates are called universal functions since with either one the AND and OR functions and NOT can be generated.
Combinational Logic Circuits
These are memoryless digital logic circuits whose output only depends on the combination of its inputs. The outputs of Combinational Logic Circuits are only determined by the logical function of their current input state, logic “0” or logic “1”, at any given instant in time.
So if one of its input conditions changes state, from 0-1 or 1-0, so too will the resulting output as by default combinational logic circuits have “no memory”, “timing” or “feedback loops” within their design.
Combinational Logic
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/uplli1TKwpTutGarlJ1gmNj6EqB56eLRNCSLiW719VdDVqRH4DK6Fklui7rtcXivI59U0jwyj0ki564nge4UVhvTCWSSIHVzdbYkrMIRJh4dnhh-n92sKdQuxEERj7BF-_ht40H8Z6Z1UJj3Ead4H8g.png)
Combinational Logic Circuits are made up from basic logic NAND, NOR or NOT gates that are “combined” or connected together to produce more complicated switching circuits. These logic gates are the building blocks of combinational logic circuits. An example of a combinational circuit is a decoder, which converts the binary code data present at its input into a number of different output lines, one at a time producing an equivalent decimal code at its output.
Combinational logic circuits can be very simple or very complicated, and any combinational circuit can be implemented with only NAND and NOR gates, as these are classified as “universal” gates. The three main ways of specifying the function of a combinational logic circuit are:
- Boolean Algebra – This forms the algebraic expression showing the operation of the logic circuit for each input variable either True or False that results in a logic “1” output.
- Truth Table – A truth table defines the function of a logic gate by providing a concise list that shows all the output states in tabular form for each possible combination of input variables that the gate could encounter.
- Logic Diagram – This is a graphical representation of a logic circuit that shows the wiring and connections of each individual logic gate, represented by a specific graphical symbol, that implements the logic circuit.
and all three of these logic circuit representations are shown below.
![, Understanding logic gates and truth tables.](https://ilearnengineering.com/wp-content/uploads/2024/05/HTyZ0XUHr-_DbI8p7L6tz8WviS74-4eaVJELRVSdFwbXrZ2mc7qUJhSokhPcd7JP9Rc_YBHBNA78xGvBCGLSvmGU217DVO76NJ99b7PBysufrSsRGUcajiUVO6TocHJAWqnWJhS1Ezc_8GY1RHOEoWs.png)
As combinational logic circuits are made up from individual logic gates only, they can also be considered as “decision making circuits” and combinational logic is about combining logic gates together to process two or more signals in order to produce at least one output signal according to the logical function of each logic gate.
Keep an eye out for our next articles where we dive even further into analogue and digital electronics.
Interested in our courses?
You can read more about our selection of accredited online electrical and electronic engineering courses here.
Check out individual courses pages below:
Diploma in Electrical and Electronic Engineering
Higher International Certificate in Electrical and Electronic Engineering
Diploma in Electrical Technology
Diploma in Renewable Energy (Electrical)
Higher International Diploma in Electrical and Electronic Engineering
Alternatively, you can view all our online engineering courses here.
Recent Posts
Kirchhoff’s current and voltage laws
Kirchhoff’s current and voltage laws In our last article, we looked at the principles and operation of a d.c motor. In this article, we’re going to investigate Kirchoff’s current and voltage laws, as well as how to apply them to engineering problems. Kirchoff’s law of current Kirchoff’s law of current states that the algebraic sum […]
What are the principles of operation of a DC electric motor?
What are the principles of operation of a DC electric motor? In our last article, we looked at the electrical parameters in series and parallel electrical circuits. In this article, we’re going to dive into the principles of operation of a DC electric motor. The motor effect When a current-carrying conductor is placed on a […]
What are the electrical parameters in series and parallel electrical networks?
What are the electrical parameters in series and parallel electrical networks? In our last article, we looked at the principles of operation of electrical cells. In this article we’re going to move on to the electrical parameters in both series and parallel electrical networks. When we have circuits with more than one resistor, we need […]