midterm - eecs.umich.edu

15
10/27/2020 Submit Midterm | Gradescope https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 1/15 0/21 Questions Answered Midterm Q1 Honor Code 0 Points This exam is open book and open Internet. During the exam you are not allowed to communicate with any person. Not via phone, text, telegraph, in person or in any other way other than the 473 staff via the exam Piazza. This includes not posting things on any website (reddit, facebook, slack, slashdot, quara, whatever). You may read anything there as long as it doesn't involve another student in the class violating that rule. Given that, please sign (put your name) in the box below indicating that you have not violated that rule and are not aware of anyone else having done so. Enter your answer here Save Answer Q2 Select all 18 Points Select all of the following which are true. You must select all of the true ones and none of the false ones to receive credit. Q2.1 mknod 3 Points STUDENT NAME Search students by name or email… No file chosen Choose Files No file chosen Choose Files

Upload: others

Post on 10-Feb-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 1/15

0/21 Questions Answered

Midterm

Q1 Honor Code0 Points

This exam is open book and open Internet. During the exam you are not

allowed to communicate with any person. Not via phone, text, telegraph, in

person or in any other way other than the 473 staff via the exam Piazza. This

includes not posting things on any website (reddit, facebook, slack, slashdot,

quara, whatever). You may read anything there as long as it doesn't involve

another student in the class violating that rule.

Given that, please sign (put your name) in the box below indicating that you

have not violated that rule and are not aware of anyone else having done so.

Enter your answer here

Save Answer

Q2 Select all18 Points

Select all of the following which are true. You must select all of the true ones and none of the false ones to receive credit.

Q2.1 mknod3 Points

STUDENT NAME

Search students by name or email…

No file chosenChoose Files No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 2/15

Say you have run the command “mknod /dev/bob 12 4” while in the directory

/home. Which of the following is true?

Save Answer

Q2.2 RM3 Points

Which of the following is true of Rate Monotonic (RM) scheduling? Assume

ideal tasks (tasks have no non-preemptable sections, only processing

requirements are significant; memory, I/O, and other resource requirements are

negligible; task are independent) and that the cost of preemption is negligible.

Save Answer

A file is created in the /home/dev directory named “bob”

The created file “bob” is a character device.

The file “bob” is associated with major number 12 and minor number 4.

When in the directory that bob is in, writing the string “abc” to bob can

be expected to cause bob to become a text file with the contents “abc”.

RM scheduling can successful schedule any set of tasks that EDF can

successfully schedule.

EDF scheduling can successful schedule any set of tasks that RM can

successfully schedule.

If you have 3 tasks with a total CPU utilization of no more than 76%, RM

can always schedule those tasks successfully.

If you have 3 tasks with a total CPU utilization of no more than 95%, RM

may be able to schedule those tasks successfully.

No file chosenChoose Files No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 3/15

Q2.3 Caps and PI3 Points

Which of the following is true of capacitors used to address power integrity

issues?

Save Answer

Q2.4 Busybox3 Points

Which of the following are true of the program “Busybox”

Save Answer

The capacitors with smaller capacitance also generally have lower

parasitics, and thus can help with higher frequency noise than larger

capacitors.

Even though the PCB ground/power plane is much larger in size than

most of the capacitors used, it has relatively low capacitance, ESR and

ESL.

When placing multiple capacitors across the same power and group

pins of a given device, you want to put the capacitors as close to the

pins as possible and put the larger capacitors closer to those pins than

the smaller ones.

It is a single binary executable that can act as a number of different

programs, such as ls, rm, and gzip, though sometimes with more limited

functionality than the “real” program.

When using softlinks to link to busybox, busybox can use argv0 to

figure out what program it is supposed to emulate.

One reason to use busybox is to have much of the functionality of the

most common programs while having a lower overall memory footprint

than having them all.

No file chosenChoose Files No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 4/15

Q2.5 Battery3 Points

Which of the following is true of the battery described by the above graph?

Save Answer

Q2.6 PCBs3 Points

Which of the following statements are true about PCBs and PCB design?

A good estimate is that the battery has a capacity of about 2.8Ah

The 0.2C line is about 0.6 Amps.

You should be able to supply at least 2.75 for 20 minutes if the drain is

a constant 10A.

At 30A constant drain, this battery can be expected to run out of power

before 3 minutes have gone by (assume you need at least 2.75V).

No file chosenChoose Files No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 5/15

Save Answer

Q3 memory read8 Points

Consider the following code found as the read function member of the

file_operations struct for a Linux kernel module. It is associated with the

device file "/dev/txx2" (so a read of the file /dev/txx2 will result in this function

being called). Assume that everything is set up appropriately beforehand.

Ignore the fact that copy_to_user’s return value is being ignored (it’s just a

warning…).

const char s[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; ssize_t memory_read(struct file *filp, char *buf, size_t count, loff_t *f_pos) {

printk("<1> f_pos= %d\n",*f_pos);

/* Transferring data to user space */ copy_to_user (buf, s+*f_pos+1, 5); /* Changing reading position as best suits */

if(*f_pos>=8) return 0;

*f_pos+=3; return 4; }

A trace 1cm long and 20 mils wide will have a lower resistance than

one 2cm long and 15 mils wide.

Vias can be useful even when routing between two parts on the same

layer.

“Necking down” a trace is generally used to reduce heat transference

to the rest of the board when soldering, making it easier to solder parts.

The “rat’s nest” generally includes a bunch of “air wires”.

No file chosenChoose Files No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 6/15

Say that someone does a cat of /dev/txx2.

Q3.13 Points

What will appear in the log file?

Enter your answer here

Save Answer

Q3.25 Points

What will be printed by the cat command?

Enter your answer here

Save Answer

Q4 Decoupling capacitors6 Points

No file chosenChoose Files No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 7/15

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

Redraw the graph showing the same information we instead put used 10 new

capacitors (in parallel) which each had the same ESR and capacitance but 5

times the ESL.

Please select file(s) Select file(s)

Save Answer

Q56 Points

Say you have a linear regulator with an 8V input and a 6V output. If the load

being driven by the regulator is using 2 Watts and the quiescent current is

10mA, how much power is being wasted as heat by the regulator? Show your

work.

Enter your answer here

Save Answer

Q6 Moar BatteriesNo file chosenChoose Files

No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 8/15

8 Points

Consider the battery discharge graph above.

Q6.13 Points

About what is the nominal capacity of the battery in Ah? Briefly justify your answer.

Enter your answer here

Save Answer

Q6.23 Points

If you are drawing the battery at about 36A, about what is the effective

capacity in Ah? Briefly justify your answer.

No file chosenChoose Files No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 9/15

Enter your answer here

Save Answer

Q6.32 Points

If you have 2 of these batteries in parallel and you are drawing 52A total, about

how long will they last?

Enter your answer here

Save Answer

Q718 Points

Consider an embedded application which consists of 3 tasks named A, B, and

C. Each task is CPU bound (that is, there is no I/O or memory operations which

take significant time to execute) and periodic. Each task must complete before

the next instance of the task is ready to start. These tasks have the following

properties and requirements. You are to assume there is no overhead of any

type (including scheduling overhead) and that this machine runs any given

instruction in exactly the same amount of time.

Q7.15 Points

No file chosenChoose Files No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 10/15

You are choosing between 4 different processors. Which of these would be

the lowest MIPS processor which would be able to schedule these tasks using

EDF? You must clearly explain your work to get any credit.

Enter your answer here

Save Answer

Q7.28 Points

You are choosing between 4 different processors. Which of these would be

the lowest MIPS processor which would be able to RM schedule these tasks?

(The table has been copied here for your convenience.) You must clearly

explain your work to get any credit.

Enter your answer here

Save Answer

Q7.35 Points No file chosenChoose Files

150 MIPS

200 MIPS

250 MIPS

300 MIPS

150 MIPS

200 MIPS

250 MIPS

300 MIPS

No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 11/15

Write the FreeRTOS task creation functions you would call to schedule this

application. The task functions take no arguments and are named A(), B(), and

C(). We are just asking you to create the tasks, not write the rest of the main or

the task functions themselves!

Enter your answer here

Save Answer

Q8 Design question--room capacity36 Points

The Problem

In the time of COVID-19, it is crucial that all designated safety measures are

maintained at UM and beyond. The capacity of indoor spaces has been strictly

limited, and it is crucial not to exceed these limits. Additionally, it is important to

limit the number of people walking around the room at any time. A new system

is needed that detects the number of people present in a room, signals

whether more people are allowed to enter or the room is at capacity, and

tracks whether people are at their stations. You should read the entire question

before starting.

You have been asked to create a prototype of this system. This means

assembling the hardware as well as writing the associated firmware. The

device has the following components:

One red LED, that should be powered using 3.3V with a 330 Ohm resistor

One green LED that should be powered using 3.3V with a 330 Ohm resistor

One yellow LED that should be powered using 3.3V with a 330 Ohm resistor

One Arduino Uno Board, powered by a 9 V battery

Two PIR sensors

(https://static6.arrow.com/aropdfconversion/8a3dc1f0f917e341ef9098816a87a2ca65f735c/e

You may assume that the sensor will remain high the entire time someone is

in its line of sight.

One analog MUX (https://www.analog.com/media/en/technical-

documentation/data-sheets/ADG5208F_5209F.pdf)

Eight pressure sensors. The pressure sensors are linear and the circuitry

needed for each pressure sensor is provided below. At 100lbs or more its No file chosenChoose Files No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 12/15

value is 0 Ohm, at 50 lbs its value is 5k Ohm, and at 0 lbs its value is 10k

Ohm. You may assume a person sitting at a station will weigh at least 50 lbs.

Any passives that you may require

This system will be used in a room that has a single entryway, which is narrow

enough to require single-file foot traffic.The room is allowed to hold at most 8

people at a time. If the number of people in the room is below this capacity, the

green indicator LED should be illuminated. Otherwise, the red indicator LED

should be illuminated, signaling newly arriving people that they may not enter

the room. The room also contains 8 lab stations, each with a single chair

equipped with one of the pressure sensors described above. If there are

individuals not seated at their stations in the room, the yellow indicator LED

should be illuminated, to warn people to return to their stations. A setup of the

room is shown below:

Assume we have a way to efficiently connect the pressure sensors to the

Arduino over these distances. The PIR sensors are set up in such a way that

only one sensor or the other will detect a person at a given time.

No file chosenChoose Files No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 13/15

As we learn more about COVID-19, our response to it and thus also

management of interior spaces, may change. As a result, we want to be able to

remotely update the room capacity through a UART line that communicates at

38400 baud. All that will be transmitted is an integer value for the new room

capacity. Your device should only respond to the serial input if something is

present, rather than constantly polling the Serial line. (Hint: use the RX line to

trigger an interrupt).

Q8.1 Electricals7 Points

Provide the connections between the Arduino, the LEDs, PIR sensors, the

pressure sensors, the analog MUX, and the battery. You should also provide

power and GND. You only need to add one pressure sensor hookup (so you do

not need to show the wiring for all 8). Just state where they will be connected

to the rest of the circuit. Add resistors and capacitors as needed. You may use

labels to make connections. You may assume that the wireless communication

module is already attached to the Serial pins.

Please select file(s) Select file(s)

Save AnswerNo file chosenChoose Files No file chosenChoose Files

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 14/15

Q8.2 check_lab_stations()8 Points

Write the function called check_lab_stations that returns how many people are

sitting at all eight lab stations in the room.

int check_lab_stations() {

Enter your answer here

}

Save Answer

Q8.36 Points

Write your implementation for the capacity_ISR() that gets the updated room

capacity from the UART lines and changes the LED states if appropriate.

void capacity_ISR() {

Enter your answer here

}

Save Answer

10/27/2020 Submit Midterm | Gradescope

https://www.gradescope.com/courses/178126/assignments/774879/submissions/new 15/15

Q8.415 Points

Write the loop and setup functions that will initialize any sensors, inputs and

outputs, detect people entering and exiting the room, and set the LEDs

according to the current number of people in the room. Define any variables or

helper functions you may need. We've provided some potentially useful

definitions.

#define LED_YELLOW = 10 #define LED_GREEN = 9 #define LED_RED = 8 #define SENS_ENTER = 0 #define SENS_EXIT = 1 #define INTERRUPT = 2

#define ENABLE = 7 #define A0 = 13 #define A1 = 12 #define A2 = 11 #define PRESS_DATA = 2

Enter your answer here

Save Answer

Save All Answers Submit & View Submission