Download presentation

Presentation is loading. Please wait.

Published byAlbert Fowlkes Modified over 2 years ago

1
1 ENGG 1203 Tutorial Sequential Logic (II) and Electrical Circuit (I) 22 Feb Learning Objectives Design a finite state machine Analysis circuits through circuit laws (Ohm’s Law, KCL and KVL) News HW1 (Feb 22, 2013, 11:55pm) Ack.: ISU CprE 281x, HKU ELEC1008, MIT 6.111, MIT 6.01

2
2 Quick Checking NOT always true Always True If, then

3
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

4
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: I 1 I 2 Represent the coin inserted 00 - no coin (0 cent), 01 – nickel (5 cents), 10 – dime (10 cents), 11 – quarter (25 cents) Output specification: C 1 C 2 P C 1 C 2 represent the coin returned – 00, 01, 10, 11 P indicates whether to deliver product – 0, 1 4

5
Solution States: S 1 S 2 S 3 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

6
Solution 6

7
7 S35 11/110 S35 10/011 S00 01/001 S00 11/110 11/000 01/000 10/000 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) Input Output Next state 00/000 S35

8
Solution 8 S35 11/110 S35 10/011 S00 01/001 S00 11/110 11/000 01/000 10/000 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) 00/000 S35

9
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

10
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
11

12
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

13
Solution 13

14
14 Rules Governing Currents and Voltages Rule 1: Currents flow in loops The same amount of current flows into the bulb (top path) and out of the bulb (bottom path) Rule 2: 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 Rule 3: Voltages accumulate in loops Kirchoff’s Voltage Law (KVL): the sum of the voltages around a closed loop is zero

15
15 Parallel/Series Combinations of Resistance To simplify the circuit for analysis Series Parallel

16
16 Voltage/Current Divider Voltage Divider Current Divider

17
17 Question: Potential Difference Assume all resistors have the same resistance, R. Determine the voltage v AB.

18
18 Solution Determine V AB We assign V G =0

19
For the circuit in the figure, determine i 1 to i 5. 19 Question: Current Calculation using Parallel/Series Combinations

20
20 Solution (i) (iii) (ii) (iv) We apply: V = IR Series / Parallel Combinations Current Divider

21
21 Solution (v) (vi) (vii)

22
22 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 = I 2 R = V 2 /R

23
23 R 1 = 80Ω, R 2 = 10Ω, R 3 = 20Ω, R 4 = 90Ω, R 5 = 100Ω Battery: V 1 = 12V, V 2 = 24V, V 3 = 36V Resistor: I 1, I 2, …, I 5 = ? P 1, P 2, …, P 5 = ? Question: Circuit Analysis Step 1, Step 2

24
24 Solution a V N = 0 I 1 : M R 5 V1 R 1 B I 2 : M V 3 R 3 R 2 B I 4 : M V 2 R 4 B Step 1, Step 2

25
25 Solution a V M – V B = R 5 I 1 + V 1 + R 1 I 1 I 1 = (V M – V B – V 1 )/(R 5 + R 1 ) = (24 – V B )/180 Step 3

26
26 Solution a V N – V B = R 2 I 2 + R 3 I 2 I 2 = (V N – V B )/(R 2 + R 3 ) = – V B /30 Step 3

27
27 Solution a V M – V B = V 2 + R 4 I 4 I 4 = (V M – V B – V 2 )/R 4 = (12 – V B )/90 We get three relationships now (I 1, I 2, I 4 ) Step 3

28
28 Solution a KCL of Node B: I 1 + I 4 + I 2 = 0 (24 – V B )/180 + (12 – V B )/90 – V B /30 = 0 V B = 16/3 V Step 4, Step 5

29
29 Solution a I 1 = (24 – V B )/180 = 14/135 A = 0.104A I 4 = (12 – V B )/90 = 2/27 A = 0.074A I 2 = – V B /30 = – 8/45 A = – 0.178A Step 5

30
30 Solution a P = I 2 R = P 1 = (0.104) 2 80 = 0.86528W P 4 = (0.074) 2 90 = 0.49284W = V R4 2 / R (6.66V, 90Ω)

31
31 Quick Checking NOT always true Always True If, then

32
32 Quick Checking NOT always true Always True If, then √ √ √ √ √

33
(Appendix) Boolean Algebra 33

34
(Appendix) Boolean Algebra 34

35
35 (Appendix) Question: Voltage Calculation Find V 2 using single loop analysis Without simplifying the circuit Simplifying the circuit

36
36 Solution Choose loop current Apply KVL Replace V 2 by R 2 I Find V 2

37
37 Solution Simplify the circuit with one voltage source and one resistor R eq. = R 1 + R 2 + R 3 = 7 ohm V eq. = V s1 + V s2 + V s3 = -2 + 2 + 2 = 2 V I = V eq. / R eq. = 2/7 A V 2 = 4/7 v

Similar presentations

OK

1 ENGG 1015 Tutorial Digital Logic (II) (70 pages) 15 Oct Learning Objectives Learn about Boolean Algebra (SoP/PoS, DrMorgan's Theorem, simplification),

1 ENGG 1015 Tutorial Digital Logic (II) (70 pages) 15 Oct Learning Objectives Learn about Boolean Algebra (SoP/PoS, DrMorgan's Theorem, simplification),

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google