EE16B HW 1 Solutions
EE16B HW 1 Solutions
R R
Vout
2R 2R 2R 2R
+ V0 + V1 + V2
− − −
LSB MSB
Let b0 , b1 , b2 = {0, 1} (that is, either 1 or 0), and let the voltage sources V0 = b0VDD , V1 = b1VDD , V2 = b2VDD ,
where VDD is the supply voltage.
As you may have noticed, (b2 , b1 , b0 ) represents a 3-bit binary (unsigned) number where each of bi is a
binary bit. We will now analyze how this converter functions.
2R 2R 2R 2R
(e) Finally, solve for Vout in terms of VDD and the binary bits b2 , b1 , b0 .
Solution:
From part (a),
b2VDD b1VDD b0VDD
+ + = Vout .
2 4 8
(f) Explain how your results above show that the resistive DAC converts the 3-bit binary number (b2 , b1 , b0 )
to the output analog voltage Vout .
Solution:
Every increment of 18 VDD on VDD represents an increment of 1 to the 3-bit binary number (b2 b1 b0 ).
For example, if Vout = 85 VDD , the input was 5 in binary (1 0 1)→ (b2 = 1 b1 = 0 b0 = 1).
(a) Let’s first implement a one-bit comparator. Give a logical expression for the > operator. To be more
specific, create a logical function such that f (a0 , b0 ) will be true if a0 > b0 and false otherwise.
Solution:
The only way f (a0 , b0 ) can be true is if a0 = 1, b0 = 0. Thus, we can say f (a0 , b0 ) = a0 · b0 .
(b) Now, let’s extend this function to implement a two-bit comparator. More specifically, make a function
g(a, b) such that g(a, b) is true if a > b and false otherwise. Recall that a, b can be decomposed to two
digits each. You may optionally use f (a0 , b0 ) to implement g(a, b).
Solution:
a > b only if a1 > b1 or a1 = b1 and a0 > b0 . This in itself is almost a complete logical function, except
we need to express equality. Fortunately, the exclusive or function does the exact opposite, so we can
simply negate it to get an equality function. Thus, g(a, b) = (a1 > b1 ) + (a1 b1 · (a0 > b0 )).
L
a1 a0 b1 b0 g(a, b)
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 1
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 1
1 0 0 1 1
1 0 1 0 0
1 0 1 1 0
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 0
Now we can choose the rows which make g(a, b) true, and string them together with OR’s, hence
g(a, b) = a1 · a0 · b1 · b0 + a1 · a0 · b1 · b0 + a1 · a0 · b1 · b0 + a1 · a0 · b1 · b0 + a1 · a0 · b1 · b0 + a1 · a0 · b1 · b0
VDD
pMOS pull-up network
A Y
In general, a Boolean-formula circuit has an nMOS pull-down network to connect the output to 0 (GND)
and a pMOS pull-up network to connect the output to 1 (VDD ). The pull-up and pull-down networks in the
inverter example each consist of a single transistor.
In this problem, you will design pull-up networks given the pull-down networks.
(a) The pull-down network of the Boolean formula (a 2-input NAND gate), Y = (A · B), is given below.
Design the pull-up network (the dashed box) with 2 pMOS transistors.
Solution:
From De Morgan’s laws, we have Y = A + B, which means that when A = 0 or B = 0, Y should be
pulled up to 1. Therefore, we connect two pMOS transistors in parallel in the pull-up network.
(b) The pull-down network of the Boolean formula (a 2-input NOR gate), Y = (A + B), is given below.
Design the pull-up network (the dashed box) with 2 pMOS transistors.
A B
Solution:
From De Morgan’s laws, we have Y = A · B, which means that when A = 0 and B = 0, Y should be
pulled up to 1. Therefore, we connect two pMOS transistors in series in the pull-up network.
A B
(c) The pull-down network of the Boolean formula, Y = (A · B) +C , is given below. Design the pull-up
network (the dashed box) with 3 pMOS transistors.
A
C
B
Solution:
Let Z be Z = A + B. From De Morgan’s laws, we have Y = A + B · C = Z · C, which means that
when Z = 1 and C = 0, Y should be pulled up to 1. For Z, we connect 2 pMOS transistors in parallel
as in part (a). Then, we connect the two pMOS transistors of Z and the one pMOS transistor of C in
series in the pull-up network.
A
C
B
(d) The pull-down network of the Boolean formula, Y = (A + B) ·C , is given below. Design the pull-up
network (the dashed box) with 3 pMOS transistors.
A B
Solution:
Let Z be Z = A · B. From De Morgan’s laws, we have Y = A · B + C = Z + C, which means that
when Z = 1 or C = 0, Y should be pulled up to 1. For Z, we connect 2 pMOS transistors in series as in
part (b). Then, we connect the two pMOS transistors of Z and the one pMOS transistor of C in parallel
in the pull-up network.
B C
A B
(e) For the circuit below, write the truth table for inputs A and B with output Y. What boolean operation
is this?
Note some of the gate voltages are A and B.
A B
A B
A A
B B
Solution:
In CMOS, if the gate of an nMOS is 1, the switch is closed and acts as a resistor. If the gate voltage is
0, then it acts as an open. The opposite is true for pMOS.
To get the truth table, draw the circuit for each input case and see whether the output is connected to
ground or VDD
A B Y
0 0 0
0 1 1
1 0 1
1 1 0
This circuit is an XOR gate (A ⊕ B).
Mechanical:
4. First-Order Differential Equation Practice
We know that the coefficient of the exponential eλt and the constant must be zero, which means that
3Aλ + 6A = 0 and 6B = 0. Solving these yield λ = −2, B = 0. If we use our initial condition alongside
the parameters we just found, we get 7 = f (0) = Ae−2(0) + 0 = A, implying that A = 7. Therefore,
f (t) = 7e−2t .
(b) Solve the equation 3 f (t) − 6 f 0 (t) = 4 given that f (2) = 1
3
Solution:
f (t) = Aeλt + B
5. RC Circuit
C
IC (t)
+ −
+ IR (t)
VC (t)
+ Vs V VR (t) R
−
C
u1 IC (t) u2
+ −
+ IR (t)
VC (t)
+ Vs V VR (t) R
−
Vc (t) = u1 − u2
u1 = Vs
u2 = VR (t)
Vc (t) = Vs −VR (t) (1)
Using KCL at u2
IR (t) = IC (t)
VR (t) = RIC (t)
dVC (t)
IC (t) = C
dt
dVC (t)
VR (t) = RC
dt
Plugging back into (1):
dVC (t)
Vc (t) = Vs − RC
dt
Rearranging, we get our differential equation:
dVC (t) VC (t) Vs
+ =
dt RC RC
x = VC (t) −Vs
VC (t) = x +Vs
dVC (t) dx
=
dt dt
substituting VC (t) in our differential equation, we get:
dx x +Vs Vs
+ =
dt RC RC
dx x
+ =0
dt RC
dx 1
=− x
dt RC
dx
The general solution to the differential equation dt = λ x is:
x = Aeλt
1
Where A is a constant determined by initial conditions. In this case, λ = − RC , giving us the solution:
t
x = Ae− RC
VC (0) = 1 = A + 2
A = −1
The overall answer is then: t
−
VC (t) = 2 − e 10−11 [V]
(b) Instead of having an initial condition of Vc (0) = 1V, we now have an initial condition of IR (0) = 150µA
(1µA = 10−6 A). Find the new expression for VC (t) for t ≥ 0. Use the same component values listed in
part (a)
Solution:
We can use the same general solution as in part (a), but we need to plug in our new initial condition to
solve for A. To do that, we need to determine what VC (0) is using our current’s initial condition.
Using Ohm’s law:
VR (0) = IR (0) ∗ R = 150 ∗ 10−6 ∗ 104 = 1.5 V
0.5 = A + 2
A = −1.5
This gives us the answer:
t
−
VC (t) = 2 − 1.5e 10−11 [V]
Contributors:
• Edward Wang.
• Jaymo Kang.
• Yen-Sheng Ho.
• Kyle Tanghe.