% CDMA simulation
%
% Randy Dimmett
% Almir Mutapcic
%
clear all;
close all;

% For PN code
FF1=0;
FF2=0;
FF3=0;
FF4=0;
FF5=0;
FF6=0;
FF7=1;
PN=[];
for k=1:2^7;
   PN = [PN FF1];
   FF1 = XOR(FF2,FF1);
   FF2 = FF3;
   FF3 = XOR(FF4,FF1);
   FF4 = FF5;
   FF5 = FF6;
   FF6 = XOR(FF7,FF1);
   FF7 = FF1;
end
PN=(PN-1)*2;
stem(PN);
title('Pn Code');