problem weight score 1 20 2 25 3 25 4 30 total...

32
EE 200 Midterm Exam 26 March 2013 Last Name (Print): First Name (Print): ID number (Last 4 digits): Section: DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO Problem Weight Score 1 20 2 25 3 25 4 30 Total 100 INSTRUCTIONS 1. You have 2 hours to complete this exam. 2. This is a closed book exam. You may use one 8.5”× 11” note sheet. 3. Calculators are allowed. 4. Solve each part of the problem in the space following the question. If you need more space, continue your solution on the reverse side labeling the page with the question number; for example, Problem 1.2 Continued. NO credit will be given to solutions that do not meet this requirement. 5. DO NOT REMOVE ANY PAGES FROM THIS EXAM. Loose papers will not be accepted and a grade of ZERO will be assigned. 6. The quality of your analysis and evaluation is as important as your answers. Your reasoning must be precise and clear; your complete English sentences should convey what you are doing. To receive credit, you must show your work. 1

Upload: others

Post on 13-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

EE 200 Midterm Exam 26 March 2013

Last Name (Print):

First Name (Print):

ID number (Last 4 digits):

Section:

DO NOT TURN THIS PAGE UNTIL YOU ARE TOLD TO DO SO

Problem Weight Score

1 20

2 25

3 25

4 30

Total 100

INSTRUCTIONS

1. You have 2 hours to complete this exam.

2. This is a closed book exam. You may use one 8.5”× 11” note sheet.

3. Calculators are allowed.

4. Solve each part of the problem in the space following the question. If you need more space, continue your solutionon the reverse side labeling the page with the question number; for example, Problem 1.2 Continued. NO

credit will be given to solutions that do not meet this requirement.

5. DO NOT REMOVE ANY PAGES FROM THIS EXAM. Loose papers will not be accepted and agrade of ZERO will be assigned.

6. The quality of your analysis and evaluation is as important as your answers. Your reasoning must be preciseand clear; your complete English sentences should convey what you are doing. To receive credit, you must

show your work.

1

Page 2: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

Problem 1: (20 Points)

From Monday March 18 through Friday March 29, the Penn State Urban Gaming Club is sponsoring the 2013Humans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club web page: HvZ comes back to

Penn State for an awesome zombie stunning and human surviving time! Meet new friends in the fight for survival,

and bond over the hunting of human cranium! This problem requires you to apply your knowledge of finite statemachines to construct a state diagram and state table that models zombie behavior.

For your analysis, assume that zombies are either roaming, hunting humans, or evading humans. Further assumethat zombies respond to only two binary inputs. The first input, prey present, is true when delectable humans arewithin reach, or false of if there are no humans present. The second input, threat present, is true when the zombie isbeing chased by an army of humans. On every tick of the clock, the zombie decides whether to roam, hunt, or evadedepending upon the two binary inputs it perceives.

Suppose a zombie starts out roaming. If on the next clock tick prey is present, and no threats are present, the zombiebegins to hunt humans. If on the other hand a threat is present, regardless of whether or not prey is present, thezombie will begin to evade humans. If neither prey nor threats are present, the zombie continues to roam.

Once the zombie begins to evade humans, it will continue to do so on each tick of the clock until the threat input isno longer true. Once the threat input is false, the zombie will either begin to roam or hunt, depending on whetheror not prey is present.

Once the zombie begins to hunt humans, it will continue to do so until either the prey is no longer present, becauseit escaped or was devoured, or a threat is sensed. If prey is no longer present and there are no threats, the zombiewill stop hunting and starting roaming. On the other hand, if the zombie senses a threat, it will stop hunting, evenif prey is present, and it will start evading humans.

Assume that the group of humans includes an electrical engineer who has placed a transmitter on the zombie. Thisdevice continuously transmits a sequence of two bits that describes the current actions of the zombie. The transmittersends 00 when the zombie is roaming, 01 when the zombie is evading humans, and 10 when the zombie is huntinghumans.

2

Page 3: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

1. (10 points) Represent the inputs prey present and threat present by the binary variables P and T . Represent thestates of the zombie as roaming (R), hunting humans (H), and evading humans (E). Represent the behaviorof the zombie using a Moore finite state machine by sketching the state diagram. To receive full credit, labelthe states as R, H , and E, the inputs as P and T , and appropriately specify the output (transmitted binarysequence) for each state.

3

Page 4: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

2. (10 points) Construct a state table with columns labeled present state, input, next state, and output.

4

Page 5: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

Problem 2: (25 Points)

1. (8 points) Figure 1 shows the state diagram for a Moore finite state machine with input x and output y.

Figure 1: State diagram for a Moore finite state machine.

Complete the state table for the Moore machine in Figure 2.

Figure 2: State table for the Moore finite state machine.

5

Page 6: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

2. (9 points) Figure 3 shows the state table for another Moore finite state machine with input x and outputy. Suppose we implement the finite state machine with D-type flip-flops. Using the state table in Figure 3,determine expressions for the flip-flop inputs DA and DB , and the system output y, in terms of x, QA, andQB. To receive credit, use Figure 4 as a guide and show the three-variable Karnaugh map used to derive eachexpression.

Figure 3: State table for a Moore finite state machine.

Figure 4: Three variable Karnaugh map

6

Page 7: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

7

Page 8: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

8

Page 9: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

3. (8 points) For a certain digital design, in terms of the signals A, B, and C, the output y is

y = ABC + AC

Draw a circuit diagram that uses two-input NAND gates and generates the output y using A, B, and C asinputs. Do not use A, B or C as inputs to your logic circuit.

9

Page 10: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

Problem 3: (25 Points)

1. (15 points) Once again consider a finite state machine with input x, output y, and the state table in Figure 5.Using the CUPL state machine syntax, write data flow code for implementing this finite-state machine usingthe ATMEL 750CL programmable logic device. Assign the clock to pin 1, the input to pin 2 and the outputto pin 23. Set the reset (clear) and set input of all D-type flip-flops to zero. Label the output of the D-typeflip-flops in the data flow code as QA and QB. Denote the state QAQB = 00 as S0, QAQB = 01 as S1,QAQB = 10 as S2, and QAQB = 11 as S3. Do not include the header information in your code, but you mustinclude comment lines to improve the readability of your code.

Figure 5: State table for a Moore finite state machine.

10

Page 11: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

11

Page 12: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

2. (10 points) A student wishes to realize the circuit in Figure 6 using the single layer printed circuit board inFigure 7.

Figure 6: Circuit diagram for a finite state machine implemented using the ATMEL 750CL programmable logicdevice.

Figure 7: Realization of the circuit using a single copper layer on top of the printed circuit board.

12

Page 13: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

(a) (5 points) Is the printed circuit board layout consistent with the circuit diagram in Figure 6? If not, statethe differences.

(b) (5 points) Regardless of whether or not the circuit layout is consistent with the circuit diagram, the studentrequests that you critique their design in Figure 7 with respect to how they routed traces. What changeswould you suggest to the student? To help the student, assign each of your suggestions a number, and inFigure 7, circle the affected region and label the circle with the corresponding suggestion number.

13

Page 14: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

Problem 4: (30 Points)

The following ten questions are each worth three points, and each question has only one correct answer. Clearlycircle the letter corresponding to your solution.

1. How do you document a VI so that the description appears in the Show Context Help popup window?

(a) Use the VI Properties Documentation window

(b) Type in the Show Context Help window

(c) Create a free label on the front panel

(d) Edit the LabVIEW help files

2. What is the value in XOR Result after the following code has executed?

Figure 8: All wires and terminals are blue.

(a) 0

(b) 1

(c) True

(d) False

3. A coercion dot indicates that:

(a) The data types are consistent

(b) A polymorphic operation will be performed on the data

(c) A data buffer is created to handle data conversion

(d) Data values are being coerced because they are out of range

4. In the figure below, what will Result equal when for loop complete execution?

(a) 7

(b) 14

(c) 25

(d) 46

14

Page 15: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

5. Which of the following illustrates an advantage of a global variable over a local variable?

(a) A global variable can pass data between two independent VIs running simultaneously

(b) Only the global variable can pass array data, local variables cannot

(c) Global variables follow the dataflow model, and therefore cannot cause race conditions

(d) Global variables do not require owned labels to operate

6. You are inputting data that represents a circle. The circle data includes an x position, a y position, and aradius. All three pieces of data are double-precision. In the future, you might need to store the color of thecircle, represented as an integer. How should you represent the circle on your front panel window?

(a) Three separate controls for the two positions and the radius

(b) A cluster containing all of the data

(c) A type definition containing a cluster

(d) An array with three elements

7. In the figure below, what are the values of Display and Numeric after the VI completes execution?

(a) ”Stage 3”; 3

(b) ”Stage 3”; 4

(c) ”Exit”; 7

(d) ””; 11

8. Can a wire be used to pass data between loops that are intended to run in parallel?

(a) Yes

(b) No

9. Which of the following NOT a component of an Error Cluster?

(a) Status

(b) Code

(c) Source

(d) Time Stamp

15

Page 16: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club

10. Which combination of words correctly completes the following statement?

Unlike , which display an entire waveform that overwrites the data already stored,update periodically and maintain a history of the data previously stored.

(a) Graphs; Charts

(b) Charts; Plots

(c) Plots; Graphs

(d) Charts; Graphs

16

Page 17: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 18: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 19: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 20: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 21: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 22: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 23: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 24: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 25: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 26: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 27: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 28: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 29: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 30: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 31: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club
Page 32: Problem Weight Score 1 20 2 25 3 25 4 30 Total 100courses.ee.psu.edu/schiano/ee200/Exams/midterm_s13.pdfHumans vs. Zombies (HvZ) contest. Quoting directly from the Urban Gaming Club