12.07.2015 Views

"Linear Equation Solver using CMOS Technology" - Microelectronic ...

"Linear Equation Solver using CMOS Technology" - Microelectronic ...

"Linear Equation Solver using CMOS Technology" - Microelectronic ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

if(K==N) %if you cannot find a 1 in the whole columns, there aremultiple solutionserror('Do not use these values, there is no single uniquesolution!');end;end;for i = j+1:N %use gauss to remove all other 1s in the column to movetowards triangle shapeif (AAA(i,j)==1)AAA(i,:)=mod(AAA(j,:)+AAA(i,:),2);BBB(i)=mod(BBB(i)+BBB(j),2);end;end;end;%check if the last row is zero onlyif (sum(AAA(end,:))==0)error('Do not use these values, there is no single unique solution!');end;%go from triangular shape to diagonal elements only shapefor j=N:-1:2for i = j-1:-1:1if (AAA(i,j)==1)AAA(i,:)=mod(AAA(j,:)+AAA(i,:),2);BBB(i)=mod(BBB(i)+BBB(j),2);end;end;end;%BBB holds the solution for X here63

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!