Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
ENGG 1203 Tutorial Sequential Logic (II) and Electrical Circuit (I) 22 Feb Learning Objectives Analysis circuits through circuit laws (Ohm’s Law, KCL and KVL) News Design a finite state machine HW1 (Feb 22, 2013, 11:55pm) Ack.: ISU CprE 281x, HKU ELEC1008, MIT 6.111, MIT 6.01 1 Quick Checking NOT Always always True true R2 If R4 R3 , then i6 0 R5 i2 i3 i4 i5 i2 i6 i3 e1 R4 R2 R4 V0 If i6 0, then R2 R2 R4 R3 R3 R5 2 A FSM design for a Vending machine (Revisited) Vending Machine Collect money, deliver product and change Vending machine may get three inputs Inputs are nickel (5c), dime (10c), and quarter (25c) Only one coin input at a time Product cost is 40c Does not accept more than 50c Returns 5c or 10c back Exact change appreciated 3 Solution We are designing a state machine which output depends on both current state and inputs. Suppose we ask the machine to directly return the coin if it cannot accept an input coin. Input specification: I1 I2 Represent the coin inserted 00 - no coin (0 cent), 01 – nickel (5 cents), 10 – dime (10 cents), 11 – quarter (25 cents) Output specification: C1C2P C1C2 represent the coin returned – 00, 01, 10, 11 P indicates whether to deliver product – 0, 1 4 Solution States: S1S2S3 Represent the money inside the machine now 3 bits are enough to encode the states S00 (0 cents) – 000 S05 (5 cents) – 001 S10 – 010 S15 – 011 S20 – 100 S25 – 101 S30 – 110 S35 – 111 5 Solution 6 Solution Next state Input Output 11/110 11/000 01/000 10/000 S35 11/110 S35 10/011 S00 01/001 S00 00/000 S35 S35: Currently the machine has 35 cents e.g. 11/110 : If we insert a quarter (11), then the machine should return one quarter and zero product (110) 35c (35 cents inside the machine now) + 25c (insert 25 cents) = 35c (35 cents inside the machine in the next state) + 25c (return 25 cents) + 0c (return no product) 7 Solution 11/110 11/000 01/000 10/000 S35 11/110 S35 10/011 S00 01/001 S00 00/000 S35 e.g. 10/011: If we insert a dime (10), then the machine should return one nickel and one product (011) 35c (35 cents inside the machine now) + 10c (insert 10 cents) = 0c (zero cent inside the machine in the next state) + 5c (return 5 cents) + 40c (return one product) e.g. 01/001: If we insert a nickel (01), then the machine should return zero coin and one product (001) 35c (35 cents inside the machine now) + 5c (insert 5 cents) = 0c (zero cent inside the machine in the next state) + 0c (return zero cent) + 40c (return one product) 8 A Parking Ticket FSM At Back Bay garage, Don and Larry are thinking of using an automated parking ticket machine to control the number of guest cars that a member can bring. The card reader tells the controller whether the car is a member or a guest car. Only one guest car is allowed per member at a discount rate only when s/he follows out the member at the exit (within the allotted time). The second guest must pay the regular parking fees. You have been hired to implement the control system for the machine which is located at the exit. Using your expertise on FSMs, design a FSM for the control system. 9 Solution Specifications Signals from the card reader: MEMBER and GUEST Signals from the toll booth: TOKEN (meaning one toke received), EXP (time for discounted guest payment has expired). Signal to the gate: OPEN. Fee: Members are free, Guest with a Member is 1 Token, Regular Guest is 2 Tokens. 10 11 Solution The truth table that corresponds to the FSM The state labels can be mapped to a three bit state variable. All entries not entered below are illegal. 12 Solution 13 Rules Governing Currents and Voltages Rule 1: Currents flow in loops Rule 2: Like the flow of water, the flow of electrical current (charged particles) is incompressible The same amount of current flows into the bulb (top path) and out of the bulb (bottom path) Kirchoff’s Current Law (KCL): the sum of the currents into a node is zero Rule 3: Voltages accumulate in loops Kirchoff’s Voltage Law (KVL): the sum of the voltages around a closed loop is zero 14 Parallel/Series Combinations of Resistance To simplify the circuit for analysis v R1i R2i v Rs i Series Rs R1 R2 Rp 1 1 R1 R1 // R2 1 R2 R1 R2 R1 R2 Parallel 15 Voltage/Current Divider Voltage Divider I V R1 R2 V1 R1 I R1 V R1 R2 V2 R2 I R2 V R1 R2 Current Divider V R1 // R2 I I1 R2 V R1 // R2 I I R1 R1 R1 R2 R1 I2 I R1 R2 16 Question: Potential Difference Assume all resistors have the same resistance, R. Determine the voltage vAB. 17 Solution Determine VAB We assign VG=0 R2 VA 5 2.5V R1 R2 R4 VB 3 1.5V R3 R4 VAB VA VB 2.5 1.5 4V 18 Question: Current Calculation using Parallel/Series Combinations For the circuit in the figure, determine i1 to i5. 19 Solution We apply: (i) 3Ω 4Ω 40V 1Ω V = IR Series / Parallel Combinations Current Divider 2Ω (ii) 2 1 // 2 3 (iii) 3Ω 40V 3Ω 4Ω 40V 2/3Ω 2 4 4 // 3 7 4/7Ω (iv) 40V 25/7Ω 4 25 3 // 7 7 20 Solution (vi) 40V (vii) 3Ω (v) 25/7Ω 4Ω 40V 2/3Ω 3Ω 4Ω 40V V IR 40 i1 1Ω 2Ω i1 i2 i3 25 i1 11.2 A 7 i2 2 3 i 1 11.2 1.6 A 1 4 2 7 3 i3 i4 i5 i3 11.2 1.6 9.6 A i4 2 9.6 6.4 A 3 i5 1 9.6 3.2 A 3 21 Analyzing Circuits Assign node voltage variables to every node except ground (whose voltage is arbitrarily taken as zero) Assign component current variables to every component in the circuit Write one constructive relation for each component in terms of the component current variable and the component voltage Express KCL at each node except ground in terms of the component currents Solve the resulting equations Power = IV = I2R = V2/R 22 Question: Circuit Analysis R1 = 80Ω, R2 = 10Ω, R3 = 20Ω, Step 1, Step 2 R4 = 90Ω, R5 = 100Ω Battery: V1 = 12V, V2 = 24V, V3 = 36V Resistor: I1, I2, …, I5 = ? P1, P2, …, P5 = ? 23 Solution a VN = 0 I1: M R5 V1 R1 B I2: M V3 R3 R2 B I4: M V2 R4 B Step 1, Step 2 24 Solution a VM – VB = R5I1 + V1 + R1I1 I1 = (VM – VB – V1)/(R5 + R1) = (24 – VB)/180 Step 3 25 Solution a VN – VB = R2I2 + R3I2 I2 = (VN – VB)/(R2 + R3) = – VB/30 Step 3 26 Solution a VM – VB = V2 + R4I4 I4 = (VM – VB – V2)/R4 = (12 – VB)/90 We get three relationships now (I1, I2, I4) Step 3 27 Solution a KCL of Node B: I1 + I4 + I2 = 0 (24 – VB)/180 + (12 – VB)/90 – VB/30 = 0 Step 4, Step 5 VB = 16/3 V 28 Solution a I1 = (24 – VB)/180 = 14/135 A = 0.104A I4 = (12 – VB)/90 = 2/27 A = 0.074A I2 = – VB/30 = – 8/45 A = – 0.178A Step 5 29 Solution a P = I2R = P1 = (0.104)2 80 = 0.86528W P4 = (0.074)2 90 = 0.49284W = VR42 / R (6.66V, 90Ω) 30 Quick Checking NOT Always always True true R2 If R4 R3 , then i6 0 R5 i2 i3 i4 i5 i2 i6 i3 e1 R4 R2 R4 V0 If i6 0, then R2 R2 R4 R3 R3 R5 31 Quick Checking NOT Always always True true R2 If R4 R3 , then i6 0 √ R5 i2 i3 i4 i5 i2 i6 i3 e1 R4 R2 R4 √ V0 If i6 0, then R2 R2 R4 R3 √ R3 R5 √ √ 32 (Appendix) Boolean Algebra 33 (Appendix) Boolean Algebra 34 (Appendix) Question: Voltage Calculation Find V2 using single loop analysis Without simplifying the circuit Simplifying the circuit Vs1 2v,Vs 2 2v,Vs 3 2v, R1 1, R2 2, R3 4 Vs2 R1 R2 Vs1 + Vs3 R3 35 Solution Choose loop current Vs2 R1 R2 Vs1 + Vs3 Apply KVL R3 Replace V2 by R2I Vs 2 R1I R2 I R3 I Vs 3 Vs1 0 2 I A 7 Find V2 4 V2 R2 I v 7 36 Solution Simplify the circuit with one voltage source and one resistor Req. = R1 + R2 + R3 = 7 ohm Veq. = Vs1 + Vs2 + Vs3 = -2 + 2 + 2 = 2 V I = Veq. / Req. = 2/7 A Req. V2 = 4/7 v Veq. 37