12
Page 1 of 12 EECS 473 Midterm Exam Fall 2016 Name: ____________________________________ unique name: _____________ Sign the honor code: I have neither given nor received aid on this exam nor observed anyone else doing so. ___________________________________ NOTES: 1. Closed book and Closed notes 2. There are 12 pages total for the exam as well as a handout. The last page of the exam can be removed and used as reference for the last problem. 3. Calculators are allowed, but no PDAs, Portables, Cell phones, etc. Using a calculator to store notes is not allowed nor is a calculator with any type of wireless capability. 4. You have about 120 minutes for the exam. 5. Be sure to show work and explain what you’ve done when asked to do so. That may be very significant in the grading of this exam.

EECS 473 Midterm Exam · 2016. 11. 2. · groups are RM and which are EDF schedulable. Indicate if you needed to do the critical instant analysis. If needed, clearly show that analysis

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

  • Page 1 of 12

    EECS 473 Midterm Exam

    Fall 2016

    Name: ____________________________________ unique name: _____________

    Sign the honor code:

    I have neither given nor received aid on this exam nor observed anyone else doing so.

    ___________________________________

    NOTES:

    1. Closed book and Closed notes 2. There are 12 pages total for the exam as well as a handout. The last page of the exam can be removed and

    used as reference for the last problem. 3. Calculators are allowed, but no PDAs, Portables, Cell phones, etc. Using a calculator to store notes is not

    allowed nor is a calculator with any type of wireless capability. 4. You have about 120 minutes for the exam. 5. Be sure to show work and explain what you’ve done when asked to do so. That may be very significant in

    the grading of this exam.

  • Page 2 of 12

    1) Circle the best answer. [10 points, -2 per wrong or blank answer, minimum 0]

    a. When powering a device that is very rarely used over a period of years, we generally would prefer to

    power it using alkaline batteries / lipo batteries / lead-acid batteries /

    nearly any secondary cell.

    b. Which of the following is not an advantage of creating a standard interface (API) for hardware devices?

    It should allow the programmer to not worry about the details (such as MMIO locations) for

    the hardware device.

    It should make the code itself more efficient (in terms of the number of instructions executed).

    It hopefully limits the number of people who need to have a detailed understanding of the

    hardware.

    It hopefully will make it easier to move existing code from one processor to another.

    c. Which of the following is an advantage of RM scheduling over EDF scheduling?

    RMS can schedule certain sets of periodic tasks EDF cannot.

    When RMS fails to schedule, it will always fail to schedule the task with the shortest period,

    while EDF could fail to schedule other tasks.

    When RMS fails to schedule, it will always fail to schedule the task with the largest CPU needs,

    while EDF could fail to schedule other tasks.

    RMS doesn’t require dynamic priorities for periodic tasks, while EDF generally does.

    d. LDO is a type of linear regulator / switching regulator / primary cell / secondary cell.

    In general an LDO has a lower device order / direct output /maximum switching speed / minimum

    voltage drop compared to others of that same type.

    e. The command mknod /drill/memory c 60 10 does which of the following:

    Creates a drill node in memory location c by 60 by 10.

    Creates a file named /drill/memory which is a block file with a minor number of 60 and a

    major number of 10.

    Creates a read-only character node named /drill/memory of 600 bytes.

    Creates a drill hole for a via in a Gerber file.

    Creates a file named /drill/memory which is a character device with a major number of 60 and

    a minor number of 10.

    Creates a non-plated (i.e. memoryless) drill hole for a node in an Excellon file.

  • Page 3 of 12

    2) Say you have the following groups of tasks. For each group find the CPU utilization and identify which

    groups are RM and which are EDF schedulable. Indicate if you needed to do the critical instant analysis. If

    needed, clearly show that analysis. The following equation may prove useful.

    [9 points]

    Group

    T1

    Execution

    Time

    T1

    Period

    T2

    Execution

    Time

    T2

    Period

    T3

    Execution

    Time

    T3

    Period

    %

    Utilization

    (Total)

    A 2 5 1 6 3 9

    B 1 3 2 5 2 7

    C 3 7 2 8 1 12

    Group EDF

    Schedulable?

    RM

    Schedulable?

    Did you need to examine

    the critical instance?

    A

    B

    C

  • Page 4 of 12

    3) Consider a battery with the following discharge characteristics [8 points]

    a) What is the (approximate) capacity of this battery in mAh? Provide a brief justification.[3]

    b) Say your application requires 55A at 11V.

    i. For about how long would a single battery of this type run your application? [1]

    ii. If your application used 4 of these batteries in parallel, about how long could your application

    run? Briefly justify your answer. [4]

  • Page 5 of 12

    4) Say we have a 6V 200mAh Lipo battery. We are using it through an LDO which outputs 4V and has a

    quiescent current of 1mA. You determine that the load draws a constant current and that the battery lasts

    10 hours under that constant load. [7 points]

    a. What is the effective resistance of load? Show your work. [3]

    b. What percent of the battery’s capacity is used by the LDO? You may assume that the battery keeps

    its voltage constant at 6V the whole time. Show your work. [4]

    5) Some variation of round robin is generally the default scheduling algorithm used by operating systems

    (including FreeRTOS and Linux). Why is round robin the default rather than EDF or RMS?

    [5 points]

  • Page 6 of 12

    6) PCB traces [9 points]

    a) Say your PCB

    has a metal layer that is 1 Oz/ft2 thick

    operates in an ambient temperature of 20˚C

    the trace needs to be kept below 30˚C

    If you wish to drive a motor that uses up to 60 Watts at 12 Volts over a trace that is 4in long, what is

    your minimum trace width according to the figure above? Draw lines on the chart (much like the two

    examples) to show your work and write your answer below. [5]

    b) Explain why necking-down a 40 thou trace to 20 thou can allow you to lower the overall resistance of a

    trace. [4]

  • Page 7 of 12

    7) Decoupling capacitors [10 points]

    a) The above graph shows the frequency vs. impedance for a given capacitor. Redraw the graph showing

    the same information for 10 of these capacitors in parallel. [5]

    b) Explain why we often need a variety of different sizes of capacitors when addressing power integrity. [5]

  • Page 8 of 12

    8) Short answers [11 points]

    a. Does GPLv3 require that voters be able to modify GPL-licensed software running in a voting

    machine? Briefly explain your answer. [4]

    b. What is a deferred interrupt and why do we use them? [3]

    c. A loadable kernel module is “loadable” because it can be attached or removed from the kernel as

    the kernel is running. Why is this useful? [4]

  • Page 9 of 12

    9) The EECS department is looking for a method to dim the lights in the EECS 473/373 lab when the sun is set in

    order to give students a better idea of what time of day it is. You’ve been assigned the task to create a

    prototype to demonstrate to the department. For the prototype, you are to just have an LED turn on when

    it is light outside, otherwise have the LED be off (This corresponds to when the lights should be bright and

    dim).

    To demonstrate this idea, you have selected the TSL2561 light-to-digital convertor (also called a “light

    sensor”), connected to an Arduino Uno, which controls the LED. Your job is to design a circuit diagram

    (devices shown below) and to write a sketch to accomplish this. Be sure to read the entire question and

    briefly look over the various documents available to you before you start. [31 points]

    a. Answer the following questions: [9 points]

    i. What voltage range can you use for the light sensor? [1]

    ii. What is the I2C slave address if the “ADDR SEL” pin is connected to GND? [2]

    iii. What address would you read to get “DATA0LOW"? [2]

    iv. How much power would you expect the light sensor to draw when it’s active? [1]

    v. How much power would you expect the light sensor to draw when it’s not active (powered down)? Show your work. [2]

    vi. When power is first applied, does the device start in active mode or powered down? [1]

  • Page 10 of 12

    b. Below are a number of components: an LDO, the light-to-digital convertor, an Arduino Uno, an LED and a 9V battery. No devices have power unless you supply it. Indicate, by drawing wires, how you will connect the components, and draw any other components needed. (Note on the Uno pin A4 = SDA and A5= SCL). Also, indicate the voltage you’d want out of the LDO. [7 points]

    LDO 9V

    The LDO should output ________V

  • Page 11 of 12

    c. Write an Arduino sketch that lights the LED if the Lux value is above 0.5. You should sample the sensor

    approximately every 30 seconds. We’ve provided a sample sketch (just to remind you of the syntax and

    basic functions of the Arduino environment) and some functions for this code as the last page of this

    exam. Feel free to (carefully) remove it from the exam to use it as a reference. Be sure to read them

    before proceeding. [15 points]

  • Page 12 of 12

    Reference sheet. (You can rip this out.) Sample Arduino sketch:

    int outPin = 8;

    void setup() {

    pinMode(outPin, OUTPUT);

    }

    void loop() {

    digitalWrite(outPin, HIGH);

    delay(1000); // delay 1000ms

    digitalWrite(outPin, LOW);

    delay(1000);

    }

    I2C functions Note: The functions listed below are not actually part of Arduino but for the sake of this exam please treat

    them as built-in functions. You may not use the actual I2C library or otherwise talk to the I2C devices.

    See page 12 of the specification.

    void initI2C();

    Description

    Initializes the I2C connection. Must be called once before other functions are used.

    unsigned char readI2C(usigned char address,

    unsigned char command_code);

    Description

    Reads a single byte from the 7-bit address specified using the 4-bit command code.

    Returns

    The character read

    void writeI2C(char address, unsigned char command_code,

    unsigned char data);

    Description

    Writes a single byte (data) from the 7-bit address specified using the 4-bit command code.

    LUX function float findLUX(unsigned int ch0, unsigned int ch1);

    Description

    Computes the LUX value given the 16-bit values read by channel 0 and channel 1. It assumes the

    TIMING register is set to the default value, 02h. (In other words, don’t change the TIMING

    register)

    Returns

    A float between 0 and 1 (inclusive) that is the LUX value.