Space In HIndi

 


Pages

Popular

Implementation of Logic functions using Hebb Net Exp-2

 Implementation of Logic functions using Hebb Net Exp-2

clear;
clc;
disp('Hebb Net for Logic function with Bipolar Input and Target');
choice=input('1:OR gate 2: AND Gate 3:EX-OR Gate ==>');
w1=0;
w2=0;
b=0;
x1=[1 1 -1 -1];
x2=[1 -1 1 -1];
switch choice
case 1
t=[1 1 1 -1];
case 2
t=[1 -1 -1 -1];
case 3
t=[-1 1 1 -1];
otherwise
disp('Enter your choice');
end
for i=1:4
w1=w1+x1(i)*t(i);
w2=w2+x2(i)*t(i);
b=b+t(i);
disp('Weight Matrix');
disp(w1);
disp(w2);
disp('bias');
disp(b);
end

AND GATE
Initial weight &bias
W1=W2=b=0



No comments: