blob: f94436d4346641d6815985f377217140a76f0da3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
//Example11.8 // determine the feed back current If and analog output voltage
clc;
clear;
close;
Vref = 5 ;
BI = 101 ; BI = 011 ; BI = 100 ; BI = 001 ;
Rf = 25*10^3 ;
R = 0.2*Rf ;
// The output current of given R-2R ladder D/A converter is defined as
// If = -(Vref/2*R)*(2^0*b0+2^-1*b1+2^-2*b2) ;
// If = -(Vref/2*R)*(b0+2^-1*b1+2^-2*b2) ;
// for the given value Rf,R and Vref the output current
// If = (0.5*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
// for the binary input 101 the feedback current If is given by
b2 = 1 ;
b1 = 0 ;
b0 = 1 ;
If = (0.5*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
disp('for the binary input 101 analog output is = '+string(If)+ ' A ');
// An analog output voltage Vo is
Vo = -If*Rf ;
disp('An analog output voltage Vo is = '+string(Vo)+ ' V ');
// for the binary input 011 the feedback current If is given by
b2 = 0 ;
b1 = 1 ;
b0 = 1 ;
If = (0.5*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
disp('for the binary input 011 analog output is = '+string(If)+ ' A');
// the An analog output voltage Vo is
Vo = -If*Rf ;
disp('An analog output voltage Vo is = '+string(Vo)+ ' V ');
// for the binary input 100 the feedback current If is given by
b2 = 1 ;
b1 = 0 ;
b0 = 0 ;
If = (0.5*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
disp('for the binary input 100 analog output is = '+string(If)+ ' A ');
// the An analog output voltage Vo is
Vo = -If*Rf ;
disp('An analog output voltage Vo is = '+string(Vo)+ ' V ');
// for the binary input 001 the feedback current If is given by
b2 = 0 ;
b1 = 0 ;
b0 = 1 ;
If = (0.5*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
disp('for the binary input 001 analog output is = '+string(If)+ ' A ');
// the An analog output voltage Vo is
Vo = -If*Rf ;
disp('An analog output voltage Vo is = '+string(Vo)+ ' V ');
|