www.pudn.com > matlab.rar > nxt_stat.m, change:2015-04-16,size:323b


function [next_state,memory_contents]=nxt_stat(current_state,input,L,k) 
binary_state=deci2bin(current_state,k*(L-1));%k*(L - 1)为寄存器的总个数 
binary_input=deci2bin(input,k); 
next_state_binary=[binary_input,binary_state(1:(L-2)*k)]; 
next_state=bin2deci(next_state_binary); 
memory_contents=[binary_input,binary_state];