midterm17f-soln
.pdf
keyboard_arrow_up
School
University of Michigan *
*We aren’t endorsed by this school
Course
373
Subject
Electrical Engineering
Date
Feb 20, 2024
Type
Pages
5
Uploaded by GeneralTarsierMaster519
EECS 373 Midterm 1
Fall 2017
27 September 2017
No calculators or reference material.
Pledge: I have neither given nor received aid on this exam nor observed anyone else doing so.
Signature:
Name:
Unique name:
1.
(10 pts.)
Build process
(a)
(3 pts.)
Consider the following makefile definition and rule.
CFLAGS = -mcpu=cortex-m3 -mthumb -g3 -O1
%.o: %.c Makefile
${PREFIX}gcc ${CFLAGS} -c -o $@ $<
${PREFIX}objdump -D $@ > ‘basename $@ .o‘.lst
${PREFIX}nm $@ > ‘basename $@ .o‘.nm
If the user has just completed a build, changes the CFLAGS optimization level in the makefile to
3, and types make again, will the source files be recompiled?
Yes
/
No
(b)
(4 pts.)
Sometimes a linker adds new labels and code to a program. Here is one such example.
__*ABS*0x4000001_veneer:
ldr
pc, [pc, #-4]
; 2000001c <__*ABS*0x4000001_veneer+0x4>
streq
r0, [r0], #-1
When a program branches to this label, will the streq instruction be executed?
Yes
/
No
(c)
(3 pts.)
Circle the tool with the job of finalizing the offset literals within branch instructions.
•
Compiler
•
Assembler
•
Linker
1
•
Make
2.
(10 pts.)
Interrupts
(a)
(2 pts.)
Using one sentence, explain preemption.
Preemption is the process of temporarily interrupting a running task to run another.
(b)
(1 pts.)
Using one sentence, explain why it is useful in embedded systems.
Preemption allows
for system critical tasks to take priority when necessary.
(c)
(7 pts.)
You have designed a robot controller with three external interrupts.
•
Interrupt A occurs when the robot detects it will soon collide with an object.
It is in the
highest priority group (priority group 1) and has a subpriority of 2.
•
Interrupt B occurs when the robot’s battery energy is low. It is also in the highest priority
group (priority group 1) and has a subpriority of 3.
•
Interrupt C occurs when the robot enters a power saving mode. It is in priority group 2 and
has a subpriority of 1.
For each of the following situations, indicate the order in which interrupts are handled by the
processor, using “A”, “B”, and “C”.
Assuming “handle” means “enter ISR”.
i. All of the interrupts occur at the same time.
A, B, C
ii. Interrupt C is executing when interrupts A and B trigger at the same time.
A, B, C
iii. Interrupt B is executing when interrupts A and C trigger at the same time
B, A, C
3.
(10 pts.)
MMIO
Write a C function that takes an integer input, compares the input to a threshold, and turns on a
LED if and only if the input is greater than the threshold. The LED is mapped to memory address
0x45001234 and has two states: on and off. The threshold value is an integer with range [0:255] and
can be read from the register mapped to memory address 0x4500FFFF. The LED is active-high.
void LEDoutput(int val) {
volatile uint32_t * threshold_reg = (uint32_t *)(0x4500ffff);
volatile uint8_t * led_reg = (uint8_t *)(0x45001234);
if(val > *threshold_reg) {
*led_reg = 1;
} else {
*led_reg = 0;
}
}
4.
(10 pts.)
The C implementation of greatest
arr is on this page. The next page contains an assembly
version with some lines missing. Fill in the missing lines so that the function works properly and is
ABI compliant. The
fill
function takes in an array and places some values into it.
This is a simple example of allocating an integer on the stack. Note that the stack grows downwards,
and the integer is deallocated by adding to the stack pointer.
allocate_int:
sub sp, #4
mov r0, #2
str r0, [sp]
add sp, #4
2
void greatest_arr(uint32_t arr1[], uint32_t return_arr[]){
uint32_t arr2[5];
int i = 0;
fill(arr2);
for(; i < 5; i++){
if(arr1[i] >= arr2[i]){
return_arr[i] = arr1[i];
} else {
return_arr[i] = arr2[i];
}
}
return;
}
greatest_arr:
push{r4, r5, r6, lr}
sub sp, #20
mov r2, r0
//r2 = arr1
mov r0, sp
// r0 = arr2 for fill, r1 = return_arr
push{r0, r1, r2}
bl fill
pop{r0, r1, r2}
mov r3, #0
// r3 = i
mov r4, #5
// end loop
loop:
lsl r0, r3, #2
// r0 = i*4
ldr r5, [r2,r0]
// r5= arr1[i]
ldr r6, [sp, r0] // r6 = arr2[i]
cmp r5, r6
blt else
if:
str r5, [r1,r0]
//return_arr[i] = arr1[i]
b endif
else:
str r6, [r1, r0]
//return_arr[i] = arr2[i]
endif:
add r3, r3, #1 // i= i+ 1
cmp r3, r4
blt loop
// branch if i < 5
add sp, #20
pop{r4, r5, r6, lr}
bx lr
5.
(10 pts.)
Instruction Encoding
Provide the machine code in hexadecimal for the following instructions. See the attached reference.
Assume UAL.
(a)
(3 pts.)
strb r1, [r2, #7]:
71d1
(b)
(4 pts.)
ldrh r7, [r2, #100]:
f8b2 7064
(c)
(3 pts.)
cmp r2, #32:
2a20
3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
(02) DC Si Diode Circuit. (Course: Electronic Devices and Circuit Theory)
What is the minimum value for RL needed to turn Zener diode ON?, And what is the maximum value for RL needed to turn Zener diode is ON?
-Use Equation Operators or write it down on paper/digital paper.
-Redraw and Apply.
-You can add //comments for a better understanding.
-Please answer without abbreviation.
-Make it clean and clear typing/writing.
Thank you.
arrow_forward
Find the state graph for the following parallel counter:
QA
C
clk
clk
clk
(Handwriting solution is needed: include this in your pdf file)
CBA
B
arrow_forward
3. Graphical Representation of the signal
1) Write the type of the voltage from simulation results:
2) Write the value of the voltage from simulation result:
L.......
-2 DDU
12ns
SónG
Trace Color Trace Name
X Values
CURSOR 1,2 V(R1:1,0)
Y1 Y2 Y1 - Y2
5.0373m 0.000 5.0373m
249.983 0.000 249.983
Y1(Cursor1) - Y2(Cursor2)
Y1-Y1(Cursor1) Y2 - Y2(Cursor2) Max Y Min Y Avg Y
249.983
0.000
0.000
249.983 0.000 124.991
arrow_forward
(01) DC Si Diode Circuit. (Course: Electronic Devices and Circuit Theory)
-Use Equation Operators or write it down on paper/digital paper.
-Redraw and Apply.
-You can add //comments for a better understanding.
-Please answer without abbreviation.
-Make it clean and clear typing/writing.
Thank you.
arrow_forward
1)This multiple choice question from MEASUREMENTS INSTRUMENTATIONS course.just write for me the final answer.
arrow_forward
Subject: Circuit II
arrow_forward
In FET, An outward-pointing arrow represents ___.
Choose the correct answer below:
a.N-type substrate
b.intrinsic substrate
c.P-type substrate
d.extrinsic substrate
arrow_forward
Obtain the state diagrams that would be used to design the circuits to detect the given sequences. Sequences may overlap. a) 01001 b) 000101. Sequences may overlap.
arrow_forward
Q1/ Answer the following questions:
a) What is the structure of ANFIS?
b) What is the principal idea of PSO?
c) Why we use triangle MF to design FLC?
d) How we can design the rule of ANN?
arrow_forward
Hello I am having trouble with a practice problem for my digital circuits class. I would appreciate if you can help me out. Thanks.
arrow_forward
Sketch the electronic symbol (schematic) for the following components/ devices. Briefly describe the function of the electronic component and use the IEEE/ANSI standard symbol as indicated below.
Fixed Resistor
Any Variable Resistor
Polarized Capacitor
arrow_forward
Click Submit to complete this assessment.
Question 10
Extrinsic semiconductors are having more charge carriers than intrinsic semiconductor.
True
False
A Click Submit to complete this assessment.
MacBook Pro
arrow_forward
What are the modes of operations used in 8253?
arrow_forward
I need the correct expert solution with explanation of the steps of the solution and the abbreviations, please.
arrow_forward
Sketch the electronic symbol (schematic) for the following components/ devices. Briefly describe the function of the electronic component and use the IEEE/ANSI standard symbol as indicated below.
SPDT Switch
DPST Switch
DPDT Switch
arrow_forward
Basic architecture (block diagram) of the latest board, for Banana Pi. (Banana Pi, BPI-r2 Pro). Please show block diagram clearly and neatly.
arrow_forward
topic: diodes
the data in the table is obtained using electronics workbench simulation. answer the following blanks using computation. (the second picture is the circuit illustration in forward biasing)
given:
Vs = 10V and R1 = 1.2KΩ
arrow_forward
can someone explain how to do this problem step by step
arrow_forward
Please help. You are going to draw arrows that indicates the flow of the given 5 actions (a,b,c,d,e).
You can draw arrows for all of them in the picture above, or make separate drawing for each letter. Please help me this is about CARRIER ACTION/FLOW OF CARRIERS in a semiconductor. It is also about Ferni Level.
arrow_forward
Project 3: - Design MCU based system to form the following state machine? Proj4:- redesign the project using active low method (method 2) for LEDs? Show all design parts (the circuit and the program) and the state machine diagram.
arrow_forward
Produce a working circuit with the Integrated Circuits shown in the image.
arrow_forward
please provide me solution of this question which includes detail explanation . it will great help for me .
subject name : microprocessor and microcontroller (8051)
arrow_forward
Please help me, write clearly and clearly on a clean sheet of paper.Thank you :)
arrow_forward
please include explanations. will give thumbs up if the answer has explanations
arrow_forward
Question Ach
calculate the decimal equivalent of the hexadecimal number 3AE2 .Show proper steps and calculation.. .Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this line .
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Electricity for Refrigeration, Heating, and Air C...
Mechanical Engineering
ISBN:9781337399128
Author:Russell E. Smith
Publisher:Cengage Learning
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:9781337900348
Author:Stephen L. Herman
Publisher:Cengage Learning
Related Questions
- (02) DC Si Diode Circuit. (Course: Electronic Devices and Circuit Theory) What is the minimum value for RL needed to turn Zener diode ON?, And what is the maximum value for RL needed to turn Zener diode is ON? -Use Equation Operators or write it down on paper/digital paper. -Redraw and Apply. -You can add //comments for a better understanding. -Please answer without abbreviation. -Make it clean and clear typing/writing. Thank you.arrow_forwardFind the state graph for the following parallel counter: QA C clk clk clk (Handwriting solution is needed: include this in your pdf file) CBA Barrow_forward3. Graphical Representation of the signal 1) Write the type of the voltage from simulation results: 2) Write the value of the voltage from simulation result: L....... -2 DDU 12ns SónG Trace Color Trace Name X Values CURSOR 1,2 V(R1:1,0) Y1 Y2 Y1 - Y2 5.0373m 0.000 5.0373m 249.983 0.000 249.983 Y1(Cursor1) - Y2(Cursor2) Y1-Y1(Cursor1) Y2 - Y2(Cursor2) Max Y Min Y Avg Y 249.983 0.000 0.000 249.983 0.000 124.991arrow_forward
- (01) DC Si Diode Circuit. (Course: Electronic Devices and Circuit Theory) -Use Equation Operators or write it down on paper/digital paper. -Redraw and Apply. -You can add //comments for a better understanding. -Please answer without abbreviation. -Make it clean and clear typing/writing. Thank you.arrow_forward1)This multiple choice question from MEASUREMENTS INSTRUMENTATIONS course.just write for me the final answer.arrow_forwardSubject: Circuit IIarrow_forward
- In FET, An outward-pointing arrow represents ___. Choose the correct answer below: a.N-type substrate b.intrinsic substrate c.P-type substrate d.extrinsic substratearrow_forwardObtain the state diagrams that would be used to design the circuits to detect the given sequences. Sequences may overlap. a) 01001 b) 000101. Sequences may overlap.arrow_forwardQ1/ Answer the following questions: a) What is the structure of ANFIS? b) What is the principal idea of PSO? c) Why we use triangle MF to design FLC? d) How we can design the rule of ANN?arrow_forward
- Hello I am having trouble with a practice problem for my digital circuits class. I would appreciate if you can help me out. Thanks.arrow_forwardSketch the electronic symbol (schematic) for the following components/ devices. Briefly describe the function of the electronic component and use the IEEE/ANSI standard symbol as indicated below. Fixed Resistor Any Variable Resistor Polarized Capacitorarrow_forwardClick Submit to complete this assessment. Question 10 Extrinsic semiconductors are having more charge carriers than intrinsic semiconductor. True False A Click Submit to complete this assessment. MacBook Proarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Electricity for Refrigeration, Heating, and Air C...Mechanical EngineeringISBN:9781337399128Author:Russell E. SmithPublisher:Cengage LearningDelmar's Standard Textbook Of ElectricityElectrical EngineeringISBN:9781337900348Author:Stephen L. HermanPublisher:Cengage Learning
Electricity for Refrigeration, Heating, and Air C...
Mechanical Engineering
ISBN:9781337399128
Author:Russell E. Smith
Publisher:Cengage Learning
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:9781337900348
Author:Stephen L. Herman
Publisher:Cengage Learning