function lo=logic_mf(x,y);
%LOGIC_MF generates code for the combinatorial logic block.
%	LO = LOGIC_MF(X,Y) generates logic operation vector LO,
%	depending on the information provided in X
%	('AND', 'NAND', 'OR', 'NOR', 'EQ', 'NEQ') and input Y.

%	Wes Wang 1/20/93
%       Copyright (c) 1990-93 by The MathWorks, Inc.
%       $Revision: 1.4 $  $Date: 1993/06/09 22:09:40 $
z=2^y;
lo=zeros(z,1);
if strcmp(x,'AND')
  lo(z)=1;
elseif strcmp(x,'NOR')
  lo(1)=1;
elseif strcmp(x,'EQ')
  lo(1)=1;lo(z)=1;
else 
  lo=1-lo;
  if strcmp(x,'NAND')
    lo(z)=0;
  elseif strcmp(x,'OR')
    lo(1) = 0;
  elseif strcmp(x,'NEQ')
    lo(1)=0;lo(z)=0;
  end;
end;

%-end of logic_mf.m
