- Digital Electronics Tutorial
- Digital Electronics - Home
- Digital Electronics Basics
- Types of Digital Systems
- Types of Signals
- Logic Levels And Pulse Waveforms
- Digital System Components
- Digital Logic Operations
- Digital Systems Advantages
- Number Systems
- Number Systems
- Base Conversions
- Binary Numbers Representation
- Binary Arithmetic
- Signed Binary Arithmetic
- Octal Arithmetic
- Hexadecimal Arithmetic
- Complement Arithmetic
- Binary Codes
- Binary Codes
- 8421 BCD Code
- Excess-3 Code
- Gray Code
- ASCII Codes
- EBCDIC Code
- Code Conversion
- Error Detection & Correction Codes
- Logic Gates
- Logic Gates
- AND Gate
- OR Gate
- NOT Gate
- Universal Gates
- XOR Gate
- XNOR Gate
- CMOS Logic Gate
- Two Level Logic Realization
- Threshold Logic
- Boolean Algebra
- Boolean Algebra
- Laws of Boolean Algebra
- Boolean Functions
- DeMorgan's Theorem
- SOP and POS Form
- Minimization Techniques
- K-Map Minimization
- Three Variable K-Map
- Four Variable K-Map
- Five Variable K-Map
- Six Variable K-Map
- Don't Care Condition
- Quine-McCluskey Method
- Min Terms and Max Terms
- Canonical and Standard Form
- Max Term Representation
- Simplification using Boolean Algebra
- Combinational Logic Circuits
- Digital Combinational Circuits
- Digital Arithmetic Circuits
- Multiplexers
- Parity Bit Generator and Checker
- Comparators
- Encoders
- Keyboard Encoders
- Priority Encoders
- Decoders
- Demultiplexers
- Arithmetic Logic Unit
- 7-Segment LED Display
- Code Converters
- Code Converters
- Binary to Decimal Converter
- Decimal to BCD Converter
- BCD to Decimal Converter
- Binary to Gray Code Converter
- Gray Code to Binary Converter
- BCD to Excess-3 Converter
- Excess-3 to BCD Converter
- Adders
- Half Adders
- Full Adders
- Serial Adders
- Parallel Adders
- Full Adder using Half Adder
- Half Adder vs Full Adder
- Binary Adder-Subtractor
- Subtractors
- Half Subtractors
- Full Subtractors
- Parallel Subtractors
- Full Subtractor using 2 Half Subtractors
- Half Subtractor using NAND Gates
- Sequential Logic Circuits
- Digital Sequential Circuits
- Clock Signal and Triggering
- Latches
- Flip-Flops
- Conversion of Flip-Flops
- Shift Registers
- Shift Register Applications
- Counters
- Finite State Machines
- Algorithmic State Machines
- A/D and D/A Converters
- Analog-to-Digital Converter
- Digital-to-Analog Converter
- DAC and ADC ICs
- Realization of Logic Gates
- NOT Gate from NAND Gate
- OR Gate from NAND Gate
- AND Gate from NAND Gate
- NOR Gate from NAND Gate
- XOR Gate from NAND Gate
- XNOR Gate from NAND Gate
- NOT Gate from NOR Gate
- OR Gate from NOR Gate
- AND Gate from NOR Gate
- NAND Gate from NOR Gate
- XOR Gate from NOR Gate
- XNOR Gate from NOR Gate
- NAND/NOR Gate using CMOS
- Memory Devices
- Memory Devices
- RAM and ROM
- Cache Memory Design
- Programmable Logic Devices
- Programmable Logic Devices
- Programmable Logic Array
- Programmable Array Logic
- Field Programmable Gate Arrays
- Digital Electronics Families
- Digital Electronics Families
- CPU Architecture
- CPU Architecture
Digital Electronics - Threshold Logic
In previous chapters, we have implemented various combinational circuits using logic gates. Except NOT gate, the remaining all logic gates have at least two inputs and single output. Similarly, the threshold gate also contains at least one input and only one output.
Additionally, it contains the respective weights to each input and a threshold value. The values of these weights and threshold could be of any finite real number.
Basics of Threshold gate
Let the inputs of threshold gate are X1, X2,X3,…, Xn. The corresponding weights of these inputs are W1, W2,W3, …, Wn. The symbol of Threshold gate is shown in the following figure.
Threshold gate is represented with a circle and it is having 'n' inputs, X1 to Xn and single output, Y. This circle is made into two parts. One part represents the weights corresponding to the inputs and other part represents Threshold value, T.
The sum of products of inputs with corresponding weights is known as weighted sum. If this weighted sum is greater than or equal to Threshold value, T then only the output, Y will be equal to one. Otherwise, the output, Y will be equal to zero.
Mathematically, we can write this relationship between inputs and output of Threshold gate as below.
$$\mathrm{Y \: = \: 1 \:\: if \: \: W_{1}X_{1} \: + \: W_{2}X_{2} \: + \: W_{3}X_{3} \: + \: \dotso \: + \: W_{n}X_{n} \: \geq \: T}$$
𝑌 = 0, otherwise.
Therefore, we can implement various logic gates and Boolean functions just by changing the values of weights and / or Threshold value, T.
Example
Let us find the simplified Boolean function for the following Threshold gate.
This Threshold gate is having three inputs X1, X2, X3 and one output Y.
The weights corresponding to the inputs X1, X2 & X3 are W1 = 2, W2 = 1 & W3 = -4 respectively.
The value of Threshold gate is T = -1.
The weighted sum of Threshold gate is
$$\mathrm{W \: = \: W_{1}X_{1} \: + \: W_{2}X_{2} \: + \: W_{3}X_{3}}$$
Substitute the given weights in the above equation.
$$\mathrm{\Rightarrow \: W \: = \: 2X_{1} \: + \: X_{2} \: − \: 4X_{3}}$$
Output of Threshold gate, Y will be '1' if W ≥ −1, otherwise it will be '0'.
The following table shows the relationship between the input and output for all possible combination of inputs.
Input | Weighted Sum | Output | ||
---|---|---|---|---|
X1 | X2 | X3 | W = 2X1 + X2 - 4X3 | Y |
0 | 0 | 0 | 0 | 1 |
0 | 0 | 1 | -4 | 0 |
0 | 1 | 0 | 1 | 1 |
0 | 1 | 1 | -3 | 0 |
1 | 0 | 0 | 2 | 1 |
1 | 0 | 1 | -2 | 0 |
1 | 1 | 0 | 3 | 1 |
1 | 1 | 1 | -1 | 1 |
From the above table, we can write the Boolean function for output, Y as
$$\mathrm{Y \: = \: \sum m( 0,2,4,6,7)}$$
The simplification of this Boolean function using 3 variable K-Map is shown in the following figure.
Therefore, the simplified Boolean function for given Threshold gate is Y = X3' + X1 X2.
Synthesis of Threshold Functions
Threshold gate is also called as universal gate because we can implement any Boolean function using Threshold gate(s). Some-times, it may not possible to implement few logic gates and Boolean functions by using single Threshold gate. In that case, we may require multiple Threshold gates.
Follow these steps for implementing a Boolean function using single Threshold gate.
Step 1 − Formulate a Truth table for given Boolean function.
Step 2 − In the above Truth table, add (include) one more column, which gives the relation between weighted sums and Threshold value.
Step 3 − Write the relation between weighted sums and threshold for each combination of inputs as mentioned below.
- If the output of Boolean function is 1, then the weighted sum will be greater than or equal to Threshold value for those combination of inputs.
- If the output of Boolean function is 0, then the weighted sum will be less than Threshold value for those combination of inputs.
Step 4 − Choose the values of weights & Threshold in such a way that they should satisfy all the relations present in last column of the above table.
Step 5 − Draw the symbol of Threshold gate with those weights and Threshold value.
Example
Let us implement the following Boolean function using single Threshold gate.
$$\mathrm{Y( X_{1},X_{2},X_{3})\:=\: \sum m ( 0,2,4,6,7)}$$
The given Boolean function is a three variable function, which is represented in sum of min terms form. The Truth table of this function is shown below.
Input | Output | ||
---|---|---|---|
X1 | X2 | X3 | Y |
0 | 0 | 0 | 1 |
0 | 0 | 1 | 0 |
0 | 1 | 0 | 1 |
0 | 1 | 1 | 0 |
1 | 0 | 0 | 1 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
1 | 1 | 1 | 1 |
Now, let us add (include) one more column to the above Truth table. This last column contains the relations between weighted sums (W) and Threshold value (T) for each combination of inputs.
Input | Output | Relations Between W & T | ||
---|---|---|---|---|
X1 | X2 | X3 | Y | |
0 | 0 | 0 | 1 | $\mathrm{0 \: \geq \: T}$ |
0 | 0 | 1 | 0 | $\mathrm{W_{3} \: \lt \: T}$ |
0 | 1 | 0 | 1 | $\mathrm{W_{2} \: \geq \: T}$ |
0 | 1 | 1 | 0 | $\mathrm{W_{2}+W_{3} \: \lt \: T}$ |
1 | 0 | 0 | 1 | $\mathrm{W_{1} \: \geq \: T}$ |
1 | 0 | 1 | 0 | $\mathrm{W_{1}+W_{3} \: \lt \: T}$ |
1 | 1 | 0 | 1 | $\mathrm{W_{1}+W_{2} \: \geq \: T}$ |
1 | 1 | 1 | 1 | $\mathrm{W_{1}+W_{2}+W_{3} \: \geq \: T}$ |
Following are the conclusions from the above table.
- The value of Threshold should be either zero or negative based on first relation.
- The value of W3 should be negative based on first and second relations.
- The values of W1 and W2 should be greater than or equal Threshold value based on fifth and third relations.
- W2 should be greater than W3 based on fourth relation.
We can choose the following values for weights and Threshold based on the above conclusions.
W1 = 2, W2 = 1, W3 = -4 & T = -1
The symbol of Threshold gate with the above values is shown below.
Therefore, this Threshold gate implements the given Boolean function, $\mathrm{Y( X_{1}, X_{2},X_{3}) \:=\: \sum m (0,2,4,6,7)}$.