Digital Circuits - 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 Xnand 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.

Y=1,ifW1X1+W2X2+W3X3+...WnXn≥TY=1,ifW1X1+W2X2+W3X3+...WnXn≥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

W=W1X1+W2X2+W3X3W=W1X1+W2X2+W3X3

Substitute the given weights in the above equation.

⇒W=2X1+X2−4X3⇒W=2X1+X2−4X3

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.

Inputs

Weighted sum

Output

X1X1

X2X2

X3X3

W=2X1+X2−4X3W=2X1+X2−4X3

YY

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

Y=∑m(0,2,4,6,7)Y=∑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=X′3+X1X2Y=X3′+X1X2.

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.

Y(X1,X2,X3)=∑m(0,2,4,6,7)Y(X1,X2,X3)=∑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.

Inputs

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.

Inputs

Output

Relations between W & T

X1

X2

X3

Y

0

0

0

1

0 ≥T

0

0

1

0

W3 < T

0

1

0

1

W2 ≥ T

0

1

1

0

W2 + W3 < T

1

0

0

1

W1 ≥ T

1

0

1

0

W1+ W3 < T

1

1

0

1

W1+ W2 ≥ T

1

1

1

1

W1+ W2+ W3 ≥ 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, Y(X1,X2,X3)=∑m(0,2,4,6,7)Y(X1,X2,X3)=∑m(0,2,4,6,7).