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.

end;end;%% Generate txtfile% here a copy-paste template for VHDL is preparedAtxt='(';btxt='(';xtxt='(';for i=1:Nfor j=1:Nif (A(i,j)==1)Atxt=[Atxt '''1'','];elseAtxt=[Atxt '''0'','];end;end;if (b(i)==1)btxt=[btxt '''1'','];elsebtxt=[btxt '''0'','];end;if (X(i)==1)xtxt=[xtxt '''1'','];elsextxt=[xtxt '''0'','];end;if i~=NAtxt=[Atxt char(10)];end;end;Atxt(length(Atxt))=')';btxt(length(btxt))=')';xtxt(length(xtxt))=')';Atxtbtxtxtxt%% solve gaussian style% Here the equation system is solved once, to check if there are multiple% solutionsAAA=A;BBB=b;for j=1:N % for each rowif (AAA(j,j)==0) %if the first element of the row is not 1, swap rowsfor K=j+1:Nif (AAA(K,j)==1)Temp=AAA(K,:);AAA(K,:)=AAA(j,:);AAA(j,:)=TempTemp2=BBB(K);BBB(K)=BBB(j);BBB(j)=Temp2break;end;end;62

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

Saved successfully!

Ooh no, something went wrong!