ENGG 1 Tutorial Quick Checking Sequential Logic (II) and Electrical Circuit (I) Feb Learning Objectives Design a finite state machine Analysis circuits through circuit laws (Ohm s Law, KCL and KL) News HW1 (Feb, 1, 11:55pm) Ack.: ISU CprE 81x, HKU ELEC18, MIT.111, MIT.1 If =, then 5 i = i + i = i + i5 i + i = i e = 1 ( + ) If i =, then = ( + ) ( + ) 5 NOT always true Always True 1 A FSM design for a ending machine (evisited) ending Machine Collect money, deliver product and change ending machine may get three inputs Inputs are nickel (5c), dime (1c), and quarter (5c) Only one coin input at a time Product cost is c Does not accept more than 5c eturns 5c or 1c back Exact change appreciated 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: I 1 I epresent the coin inserted - no coin ( cent), 1 nickel (5 cents), 1 dime (1 cents), 11 quarter (5 cents) Output specification: C 1 C P C 1 C represent the coin returned, 1, 1, 11 P indicates whether to deliver product, 1
States: S 1 S S epresent the money inside the machine now bits are enough to encode the states S ( cents) S5 (5 cents) 1 S1 1 S15 11 S 1 S5 11 S 11 S5 111 5 11/11 11/ 1/ 1/ S5 Input S5: Currently the machine has 5 cents Output Next state 11/11 S5 1/11 S 1/1 S / S5 e.g. 11/11 : If we insert a quarter (11), then the machine should return one quarter and zero product (11) 5c (5 cents inside the machine now) + 5c (insert 5 cents) = 5c (5 cents inside the machine in the next state) + 5c (return 5 cents) + c (return no product) 11/11 11/ 1/ 1/ S5 11/11 S5 1/11 S 1/1 S / S5 e.g. 1/11: If we insert a dime (1), then the machine should return one nickel and one product (11) 5c (5 cents inside the machine now) + 1c (insert 1 cents) = c (zero cent inside the machine in the next state) + 5c (return 5 cents) + c (return one product) e.g. 1/1: If we insert a nickel (1), then the machine should return zero coin and one product (1) 5c (5 cents inside the machine now) + 5c (insert 5 cents) = c (zero cent inside the machine in the next state) + c (return zero cent) + c (return one product) 7 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. Specifications Signals from the card reader: MEMBE 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, egular Guest is Tokens. 9 1 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. 11 1
ules Governing Currents and oltages ule 1: Currents flow in loops The same amount of current flows into the bulb (top path) and out of the bulb (bottom path) ule : Like the flow of water, the flow of electrical current (charged particles) is incompressible Kirchoff s Current Law (KCL): the sum of the currents into a node is zero ule : oltages accumulate in loops Kirchoff s oltage Law (KL): the sum of the voltages around a closed loop is zero 1 1 Parallel/Series Combinations of esistance To simplify the circuit for analysis v = i + i v = i s 1 s = + p 1 1 1 1 = = 1 + 1 + = // 1 Series 1 Parallel oltage/current Divider I = + 1 = = 1 1 1I 1 + = = I 1 + oltage Divider Current Divider ( // ) = I 1 1 I1 I I 1 1 1 + I // = = = 1 = I + 1 15 1
Question: Potential Difference Assume all resistors have the same resistance,. Determine the voltage v AB. Determine AB We assign G = A B = = + 5.5 1 = = + 1.5 ( ) = =.5 1.5 = AB A B 17 18 Question: Current Calculation using Parallel/Series Combinations For the circuit in the figure, determine i 1 to i 5. (i) Ω Ω 1Ω Ω We apply: = I Series / Parallel Combinations Current Divider (ii) 1 Ω // Ω = Ω (iii) Ω Ω // Ω = Ω 7 /7Ω (iv) 5 Ω // Ω = Ω 7 7 19
(v) = I 5 = i1 i1 = 11.A 7 (vi) (vii) Ω Ω 1Ω Ω i = i + i 1 1 i = i1 = ( 11.) 1. = A + 7 i = i + i5 i = 11. 1. = 9.A i = ( )( 9.) =.A ( )( ) i 1 5 = 9. =.A 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 = I = I = / 1 Question: Circuit Analysis a 1 = 8Ω, = 1Ω, = Ω, = 9Ω, 5 = 1Ω Battery: 1 = 1, =, = Step 1, Step esistor: I 1, I,, I 5 =? P 1, P,, P 5 =? N = I 1 : M 5 1 1 B I : M B I : M B Step 1, Step
a a M B = 5 I 1 + 1 + 1 I 1 I 1 = ( M B 1 )/( 5 + 1 ) = ( B )/18 Step N B = I + I I = ( N B )/( + ) = B / Step 5 a a M B = + I I = ( M B )/ = (1 B )/9 We get three relationships now (I 1, I, I ) Step KCL of Node B: I 1 + I + I = ( B )/18 + (1 B )/9 B / = B = 1/ Step, Step 5 7 8
a a I 1 = ( B )/18 = 1/15 A =.1A I = (1 B )/9 = /7 A =.7A I = B / = 8/5 A =.178A Step 5 P = I = P 1 = (.1) 8 =.858W P = (.7) 9 =.98W = / (., 9Ω) 9 Quick Checking Quick Checking If =, then 5 i = i + i = i + i5 i + i = i e = 1 ( + ) If i =, then = ( + ) ( + ) 5 NOT always true Always True If =, then 5 i = i + i = i + i5 i + i = i e = 1 ( + ) If i =, then = ( + ) ( + ) 5 NOT always true Always True 1
(Appendix) Boolean Algebra (Appendix) Boolean Algebra (Appendix) Question: oltage Calculation Find using single loop analysis Without simplifying the circuit Simplifying the circuit = v, = v, = v, = 1 Ω, = Ω, = Ω s1 s s 1 s1 s s 1 - + Choose loop current Apply KL eplace by I + + I + I + I + = Find s1 s 1 s s1 I = A 7 = I = v 7 s s 1 - + 5
Simplify the circuit with one voltage source and one resistor eq. = 1 + + = 7 ohm eq. = s1 + s + s = - + + = I = eq. / eq. = /7 A = /7 v eq. eq. 7