%% Progrma to calculte the gain and input resistance of a common-gate %% amplifier. Executing this program requires Symbolic Analysis toolbox. %% The program makes use of node analysis. clear all clc syms gm ro gmb Rs Rd Vin M=[1/ro+1/Rd,-gm-gmb-1/ro;-1/ro,gm+gmb+1/ro+1/Rs]; % Matrix N=[0;1/Rs]; % Vector X=inv(M)*N; fprintf('Amplifier Gain: \n') Gain=simplify(X(1)); pretty(Gain) Gin=simplify((1-X(2))/Rs); Rin=1/Gin; Rin=subs(Rin,Rs,0); fprintf('Input Resistance: \n') pretty(Rin)