Saturday, January 20, 2018

Computer Organisation & Architecture

PROGRAM IN MATLAB FOR  ADDITION OF TWO UNSIGNED INTEGER BINARY NUMBER (4-BITS NUMBERS)




function lab0_coa
a=input('enter a:');
b=input('enter b:');
c=input('enter c:');
for i=4:-1:1
sum=xor(xor(a(1,i),b(1,i)),c);
carry=or(and(a(1,i),b(1,i)),and(xor(a(1,i),b(1,i)),c));
c=carry;
result(1,i)=sum;
end
disp(result);
disp(c);
end

Related Posts:

  • Computer Organisation & ArchitecturePROGRAM IN MATLAB FOR SUBTRACTION OF TWO UNSIGNED INTEGER BINARY NUMBER (4BITS NUMBERS) function lab3_coa a=input('enter a:'); b=input('enter b:'); c=0; temp=a; for i=4:-1:1     if(b(1,i)==1)     &n… Read More
  • Computer Organisation & ArchitecturePROGRAM IN MATLAB FOR DIVISION OF TWO UNSIGNED INTEGER BINARY NUMBERS (N-BIT NUMBERS) . To implement restoring division algorithm in digital computer   function div n=input('enter n:'); a=input('enter a:… Read More
  • Computer Organisation & Architecture PROGRAM IN MATLAB FOR DIVISION OF TWO UNSIGNED INTEGER BINARY NUMBERS (N-BIT NUMBERS) . To implement non-restoring division algorithm in digital computer function lab5_coa n=input('enter n:'); a=input('enter… Read More
  • Computer Organisation & ArchitecturePROGRAM IN MATLAB FOR MULTIPLICATION OF TWO UNSIGNED INTEGER BINARY NUMBERS BY PARTIAL-PRODUCT METHOD (4BITS NUMBERS) function lab2_coa a=input('enter a:'); b=input('enter b:'); r=[0 0 0 0 0 0 0 0]; c=0; for j=4:-1:1 &… Read More
  • Computer Organisation & ArchitecturePROGRAM IN MATLAB FOR  ADDITION OF TWO UNSIGNED INTEGER BINARY NUMBER (4-BITS NUMBERS) function lab0_coa a=input('enter a:'); b=input('enter b:'); c=input('enter c:'); for i=4:-1:1 sum=xor(xor(a(1,i),b(1,i))… Read More

0 comments:

Post a Comment