Professional Documents
Culture Documents
S 14
We have two nodes, vA and vB. We may ignore the vout, since it is only a
point of measurement and not an extraordinary node. Once we have
solved for vB, we can solve for vout using superposition, as is explained
later. On the other hand, we could add it as a third node and solve for its
voltage. We can always add nodes, even if they are not extraordinary
nodes. If we are solving with MATLAB®, there is no harm in adding vout
as a third node, since complexity is less of an issue. First, we will solve
the problem using only two nodes.
⎛ −1 ⎞ ⎛1 1 1 ⎞ v1 v0
vA ⎜ ⎟ + vB ⎜ + + = +
⎝ R⎠ ⎝ R 2R 3R ⎟⎠ 2R 3R
⎛ −1 ⎞ ⎛ 1 1 1⎞ 0 5
vA ⎜ ⎟ + vB ⎜ + + ⎟ = +
⎝ 1⎠ ⎝ 1 2 3⎠ 2 3
or
5
vA ( 2 ) + vB ( −1) =
2
⎛ 11 ⎞ 5
vA ( −1) + vB ⎜ ⎟ =
⎝ 6⎠ 3
In MATLAB:
>> A = [2,-1;-1,11/6]; % We can call it what we like.
>> b = [5/2; 5/3];
>> v = inv(A)*b % To solve for vA and vB.
v =
2.3440
2.1880
−1 ⎡ 11 3 ⎤
⎡ 2 −1 ⎤ ⎡ 11 ⎤ ⎡ 11 ⎤ ⎢ ⎥
⎢ ⎥ =
1 ⎢ 1 ⎥ 3⎢
=
1 ⎥ ⎢ 16
=
8 ⎥
⎢ −1 11 ⎥ 22 ⎢ 6 ⎥ 8⎢ 6 ⎥ ⎢ 3 3 ⎥
⎢⎣ 6 ⎥⎦ −1⎢ 1 2 ⎥ ⎢⎣ 1 2 ⎥⎦ ⎢
6 ⎣ ⎦ ⎥
⎣ 8 4 ⎦
⎡ 11 3 ⎤⎡ 5 ⎤ ⎡ 75 ⎤
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ 16 8 ⎥⎢ 2 ⎥=⎢ 32 ⎥ which is 2.344 and 2.188, so it works!
⎢ 3 3 ⎥⎢ 5 ⎥ ⎢ 35 ⎥
⎢ 8 4 ⎥⎢ 3 ⎥ ⎢ 16 ⎥
⎣ ⎦⎣ ⎦ ⎣ ⎦
⎡ 11 3 ⎤⎡ v2 ⎤ ⎡ 11 3 1 ⎤
⎢ ⎥⎢ ⎥ ⎢ v2 + v1 + v0 ⎥
⎢ 16 8 ⎥⎢ 2 ⎥ = ⎢ 32 16 8 ⎥.
⎢ 3 3 ⎥ ⎢ v1 v0 ⎥ ⎢ 3 3 1 ⎥
⎢ +
⎥ ⎢ 2 3 ⎥ ⎢ 16 v2 + v1 + v0 ⎥
⎣ 8 4 ⎦⎣ ⎦ ⎣ 8 4 ⎦
Now we use superposition to find vout. Knowing vB, we may treat that
node as though it is connected to ground by a voltage source of value vB.
We may then ignore all the other circuitry to the left and below that node.
This leaves us with two sources, vB and v0, and two resistances, R and 2R,
with vout in between.
2 1
vout = vB + v0
3 3
Using our general solution from earlier, we have an expression for vout
that turns binary number v0v1v2 into a corresponding binary weighted
voltage:
2⎛ 3 3 1 ⎞ 1 1 1 1
vout = ⎜ v2 + v1 + v0 ⎟ + v0 = v2 + v1 + v0
3 ⎝ 16 8 4 ⎠ 3 8 4 2
In MATLAB we use the formula for vout from the top of the page with
numbers:
>> vout = 2/3*2.188 + 1/3*5
vout =
3.1250
Note that v0 is actually the most significant digit in the binary number. v2
is the last digit, and it has the least impact on the value of vout.
Note also that R-2R ladders are the standard way of constructing Digital-
to-Analog (D/A) converters. While it is hard to control the value of R on a
chip, the ratio of R's can be controlled fairly well, and only the ratio
matters in the final answer.
⎛ 1 1 1⎞ ⎛ −1 ⎞ v
vA ⎜ + + ⎟ + vB ⎜ ⎟ + vout (0) = 2 Note how vout term appears.
⎝ 2R 2R R ⎠ ⎝ R⎠ 2R
⎛ −1 ⎞ ⎛ 1 1 1⎞ ⎛ −1 ⎞ v
vA ⎜ ⎟ + vB ⎜ + + ⎟ + vout ⎜ ⎟ = 1
⎝ R⎠ ⎝ R 2R R ⎠ ⎝ R ⎠ 2R
⎛ −1 ⎞ ⎛ 1 1 ⎞ v0
vA ( 0 ) + vB ⎜ ⎟ + vout ⎜ + =
⎝ R⎠ ⎝ R 2R ⎟⎠ 2R
⎛ −1 ⎞ ⎛ 1 1 1⎞ ⎛ −1 ⎞ 0
vA ⎜ ⎟ + vB ⎜ + + ⎟ + vout ⎜ ⎟ = A
⎝ 1⎠ ⎝ 1 2 1⎠ ⎝ 1⎠ 2
⎛ −1 ⎞ ⎛1 1⎞ 5
vA ( 0 ) + vB ⎜ ⎟ + vout ⎜ + ⎟ = A
⎝ 1⎠ ⎝1 2⎠ 2
or
5
vA ( 2 ) + vB ( −1) + vout (0) = V
2
⎛ 5⎞
vA ( −1) + vB ⎜ ⎟ + vout (−1) = 0 A
⎝ 2⎠
⎛ 3⎞ 5
vA ( 0 ) + vB ( −1) + vout ⎜ ⎟ = V
⎝ 2⎠ 2
⎡ 2 −1 0 ⎤⎡ vA ⎤ ⎡ 5 / 2 ⎤
⎢ ⎥⎢ ⎥
vB ⎥ = ⎢ 0 ⎥ V
⎢ −1 5 / 2 −1 ⎥⎢ ⎢ ⎥
⎢⎣ 0 −1 3 / 2 ⎥⎦ ⎢ vout ⎥ ⎢⎣ 5 / 2 ⎦⎥
⎣ ⎦
In MATLAB:
>> A = [2,-1,0;-1,5/2,-1;0,-1,3/2];
>> b = [5/2;0;5/2];
>> v = inv(A)*b % To solve for vA and vB.
v =
2.3438
2.1875
3.1250