📄 evalboolff.m
字号:
function costFun = evalBoolFF( B, varargin )% evalBoolFF - evaluation of different combinations for activation% functions for J-K or R-S flip-flops%% Use: evalBoolFF (file_name, cost3) to initialize the function, where% file_name is a name of a function, that sets the corresponging bits of% the activation functions (see examples) and cost3 is 1 or -1, depending% whether the non-inverted or the inverted bits are to be penalized%% Use: cost = evalBoolFF ( B ) to evaluate particular bit combination% % evalBoolFF ver.1 Last update 24 Feb 2007% Copyright 2002-2007 Andrey Popov andrey.popov@gmx.netpersistent fill_name cost3if nargin == 2 fill_name = B; cost3 = varargin{1}; returnend% call the neccessary function to fill the J, K, R or S vectorFF = feval(fill_name, B);G = find(FF) - 1;% Perform boolean minimizationR = minBool(G, 2);R = R(2:end,:); % remove the heading rown = size(R,1);costFun(1) = n; % number of desjunctionscostFun(2) = sum(sum(R~=0)); % number of involved signalsif cost3 == 1 costFun(3) = sum(sum(R==1)); % number of non-inverted signalselse costFun(3) = sum(sum(R==-1)); % number of inverted signalsend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -