// Calculating the weight of MSB and LSB clc; Ra=10; b=5; Wmsb=Ra/2; disp(Wmsb,'weight of MSB (V)=') Wlsb=Ra/2^b; disp(Wlsb,'weight of LSB (V)=')