Question

In: Computer Science

Neurons: Please construct a Neural Network for the following logic, NAND Truth table for NAND function...

  1. Neurons: Please construct a Neural Network for the following logic, NAND

Truth table for NAND function

i1

i2

output

0

0

1

0

1

1

1

0

1

1

1

0

Solutions

Expert Solution

First, we need to know that the Perceptron algorithm states that:

Prediction (y`) = 1 if Wx+b > 0 and 0 if Wx+b ≤ 0

Also, the steps in this method are very similar to how Neural Networks learn, which is as follows;

  • Initialize weight values and bias
  • Forward Propagate
  • Check the error
  • Backpropagate and Adjust weights and bias
  • Repeat for all training examples

Now that we know the steps, let’s get up and running:

NAND Gate

From the diagram, the NAND gate is 0 only if both inputs are 1.

Row 1

  • From w1x1+w2x2+b, initializing w1 and w2 as 1, and b as -1, we get;

x1(1)+x2(1)-1

  • Passing the first row of the NAND logic table (x1=0, x2=0), we get;

0+0-1 = -1

  • From the Perceptron rule, if Wx+b≤0, then y`=0. This row is incorrect, as the output is 1 for the NAND gate.
  • So we want values that will make input x1=0 and x2 = 0 to give y` a value of 1. If we change b to 1, we have;

0+0+1 = 1

  • From the Perceptron rule, this works.

Row 2

  • Passing (x1=0, x2=1), we get;

0+1+1 = 2

  • From the Perceptron rule, if Wx+b > 0, then y`=1. This row is also correct (for both row 2 and row 3).

Row 4

  • Passing (x1=1, x2=1), we get;

1+1+1 = 3

  • This is not the expected output, as the output is 0 for a NAND combination of x1=1 and x2=1.
  • Changing values of w1 and w2 to -1, and value of b to 2, we get;

-1-1+2 = 0

  • It works for all rows.

Therefore, we can conclude that neural network  to achieve a NAND gate, using the Perceptron algorithm is;

-x1-x2+2


Related Solutions

Q2) (a) construct a truth table for the following function: ?(?, ?, ?) = (?? +...
Q2) (a) construct a truth table for the following function: ?(?, ?, ?) = (?? + ?̅?) ̅̅̅ + ?? (b) Use the truth table of (a) to write the function F in sum of minterms form. (c) Expand the function ?(?, ?, ?) = ? + ?̅? to product of Maxterms form. (d) Simplify the following function using K-Map. ?(?, , ?, ?, ?) = ?̅? + ?? + ?̅? + ??̅?
Use Python: Develop neurons and print truth table of the following 2-input logic gates: AND, OR,...
Use Python: Develop neurons and print truth table of the following 2-input logic gates: AND, OR, NAND, NOR, XOR, XNOR and 1-input NOT gate (Notice: use Markdown to explain how you developed a neuron, and to insert images showing the truth table of logic gates before coding)
Use Python: # Problem Set 01: - Develop neurons and print truth table of the following...
Use Python: # Problem Set 01: - Develop neurons and print truth table of the following 2-input logic gates: AND, OR, NAND, NOR, XOR, XNOR and 1-input NOT gate (Notice: use Markdown to explain how you developed a neuron, and to insert images showing the truth table of logic gates before coding) # Problem Set 02: - Develop neuron and print truth table of XOR gate using only NAND gates - Develop neuron and print truth table of XOR gate...
what does resent50 function do in neural network ?
what does resent50 function do in neural network ?
1. For each of the following propositions construct a truth table and indicate whether it is...
1. For each of the following propositions construct a truth table and indicate whether it is a tautology (i.e., it’s always true), a contradiction (it’s never true), or a contingency (its truth depends on the truth of the variables). Also specify whether it is a logical equivalence or not. Note: There should be a column for every operator. There should be three columns to show work for a biconditional. a) (P Λ ¬Q) ⇔ ¬(P ⇒ Q) b) (¬? V¬?)...
Construct a truth table for the statement [q∨(~r∧p)]→~p. Complete the truth table below by filling in...
Construct a truth table for the statement [q∨(~r∧p)]→~p. Complete the truth table below by filling in the blanks. (T or F) p q r ~r ~r∧p q∨(~r∧p) ~p [q∨(~r∧p)]→~p T T T T T F T F T T F F
Construct the truth-table for the following propositional formulas. In each case, explain whether the formula is...
Construct the truth-table for the following propositional formulas. In each case, explain whether the formula is a tautology, a contradiction, or neither. (Explain how you arrive at this conclusion.) (a) ¬((p → ¬p) → ¬p) (b) (p → (q ∧ r)) → (¬r → ¬p) (c) (p → ¬q) → ¬(¬p → q)
Design an 8-bit adder. Show the truth table, logic circuit, and Verilog code.
Design an 8-bit adder. Show the truth table, logic circuit, and Verilog code.
Design an 8-bit adder. Show the truth table, logic circuit, and Verilog code.
Design an 8-bit adder. Show the truth table, logic circuit, and Verilog code.
short essay describe how a neural network function. include the " use it or lose it"...
short essay describe how a neural network function. include the " use it or lose it" concept and the description of how individual cells work to transmit information. 2) you are driving a car. describe the functions of the various parts of your nervous system, including brain structures, are performing. include at least ten parts of the nervous system in your description.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT