summaryrefslogtreecommitdiff
path: root/3637/CH4/EX4.3/Ex4_3.sce
blob: 7616dc469fe3e080c87bb94c7eea3d492e414a83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//problem 3 pagenumber 4.38
//given
n=4;format(6);
z=['0111','1111'];
vref=5;//volt
//determine v0
r=vref/(2^n-1);
i=1;
while i<3
    v0=r*base2dec(z(i),2);
    disp('Output voltage '+string(z(i))+' = '+string(v0)+' volt');
    i=i+1;
end