summaryrefslogtreecommitdiff
path: root/3637/CH4/EX4.6/Ex4_6.sce
blob: 14f19bffd670212f36d57c963806f8a3552cf0b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//problem 6 pagenumber 4.40
//given
vref=10;//volt
is=1.875e-3;//A
z=['1111' '1100'];format(6);
//determine R I
n=4;
v0=vref/2^n*(1*2^(n-1)+1*2^(n-2)+1*2^(n-3)+1*2^(n-4));
r=v0/is;
disp('R = '+string(r/10^3)+' Kohm');
v0=vref/2^n*(1*2^(n-1)+1*2^(n-2))/r;
disp('I at 1100 = '+string(v0*10^3)+' mA');