Tuesday, January 30, 2018

How to calculate log base 2 ?

The calculator we use, we can find the logarithmic operations like log base e and log base 10. So, the question arises what shall we do if we want to calculate log base 2 or log to the base any number other than log base e and log base 10. The answer is within your calculator. You just need to recall a logarithmic formula read in mathematics. The formula is :                          ...

Friday, January 26, 2018

Is drag and drop the future of programming?

Drag and drop in programming means selecting an object from the given toolbox holding the mouse click, moving it (dragging) on the form given in the software and then finally placing (dropping) at the desired place on the form. This feature comes with GUI (Graphical User Interface) based programming. A form is given to the programmer, and a toolbox containing various...

Saturday, January 20, 2018

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 a:'); b=input('enter b:'); c=b; q=a; carry=0; for i=1:1:n     a(1,i)=0; end for i=n:-1:1     if(c(1,i)==1)         c(1,i)=0;          else  ...

Computer Organisation & Architecture

PROGRAM 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:'); b=input('enter b:'); c=b; q=a; carry=0; for i=1:1:n     a(1,i)=0; end for i=n:-1:1     if(c(1,i)==1)         c(1,i)=0;          else    ...

Computer Organisation & Architecture

PROGRAM 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     if(b(1,j)==0)         continue;     end     for i=4:-1:1     sum=xor(xor(r(1,i+j),a(1,i)),c);     carry=or(and(r(1,i+j),a(1,i)),and(xor(r(1,i+j),a(1,i)),c));  ...

Computer Organisation & Architecture

PROGRAM 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)         b(1,i)=0;       else         b(1,i)=1;     end end a=[0 0 0 1]; 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 a=temp; b=result; c=0; for...

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); en...