//calculating no of bits// //example 15// clc //clears the command window//; clear //clears// disp('resolution=voltage corresponding to LSB') //weight of LSB=1/2^n,where n=no. of bits// disp('Voltage corresponding to LSB=1/2^n*10;which should be equal to resolution which is 10mv') disp('therefore 2^n=1000') disp('n=10');//nearest value of n which satisfies the equation is 10// //result is displayed//