![]() 20
1
Threshold(Y) = 2
Contoh program jaringan sederhananya adalah
Jaringan sederhana OR
Tabel 2.2 Operasi OR
X1
X2
Y
1
1
1
1
0
1
0
1
1
0
0
0
Dari tabel diatas terdapat 2 input ( X1 dan X2) dan satu output (Y)
dengan bobot yang sesuai untuk w1 adalah 2 dan w2 adalah 2 sehingga
X2
#include<iostream.h>
Main()
{
Int w1, w2, x1, x2, O;
W1 = 1; w2 = 1;
Cout << X1= ;
Cin >> x1;
Cout << x2 = ;
Cin >> x2;
O = x1 *w1 + x2 *w2;
If(o >= 2)
Cout << output AND = 1 << endl;
Else
Cout << output AND = 0 << endl;
}
|