blob: 74570bb3410db44b168a5e04c5d523cd404340e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
//chapter-5,Example5_1,pg 491
Vref=12//ref. voltage
n=4//no. of binary weighted resistors
n1=3//input-1
n2=1//input-2
Vo=-(Vref/2^n)*(2^n1+2^n2)
printf("output voltage\n")
printf("Vo=%.2f V",Vo)
|