exam_final_109_spring_2020_sol
docx
keyboard_arrow_up
School
North Carolina State University *
*We aren’t endorsed by this school
Course
109
Subject
Electrical Engineering
Date
Apr 3, 2024
Type
docx
Pages
14
Uploaded by CaptainVultureMaster1051
Name:
________________________________________ Section
: ____________
ECE 109 Final Exam w/ Solutions May 4, 2020 Cover Sheet
This exam is Open Note, Open Book, Open Calculator, Open Computer for notes.
No correspondence is allowed with anyone other than the instructor/proctor.
You absolutely may NOT access online resources (Google, Yahoo, Chegg, etc.) to obtain any problem solutions or previous class work from ANY organization! This applies before and during the exam.
You may NOT have any materials printed/downloaded which were received from Anyone other than the instructor or TAs.
Absolutely NO IMs, E-Mails, Verbal Messages, or other communications during the exam!
If you do not have a printer available you may complete your exam on plain/lined paper and upload it at the end.
You MUST have a camera turned on you during the entire exam. If your computer does not have an exam use a cell phone. Be sure to have your charger cable ready to cover the entire exam period.
This is a 120 minute exam. Students who arrive late will NOT be given extra time on the exam. You are allotted 15 minutes to print the exam, 120 minutes to complete the
exam, and then a final 15 minutes to scan and upload the exam. If you are still working on the exam past the 120 minute time, this will be considered cheating.
You WILL be required to show your work for full credit! Partial Credit will be Generous!
Please turn in your exam when asked! I consider it cheating
to continue to work on an exam when told to stop and will count this as an Honor Offence!!
Exam Problem Grading:
10% For Trying. Writing anything intelligent on the test paper.
40% for choosing the correct methods and formulae
50% for placing the proper values into the proper places and for carrying through the math to get the final answer
Failure to abide by these rules and the NCSU Honor Policy will result in a zero
on the exam
and will be treated as a violation of the NCSU Code of Student Conduct.
Name: __________________________
Read and sign the following statement. Failure to sign the statement will result in a zero
on the exam.
I have neither given nor received unauthorized assistance on this test. I have notified the proctor
of any violations of the above policies.
Signature: __________________________________________________ Grader
: _____________________________________________
ECE 109 Spring 2020 Final Exam w/ Solutions Page 2 of 14
Question
Points
Topic
Score
1
10
Transistor Gates
2
10
POS/SOP
3
15
State Diagrams
4
10
Assembly / Machine
Conversions
5
10
Subroutines
6
27
Code Segments
7
18
Code Line Counting
8
10
Interrupts
9
10
Stack
TOTAL
120
Name: __________________________
[1] [10 pts. Total] Transistor Circuits Complete the truth table and equations. Solving for intermediate nodes R and Q is not required but may help you in solving the final solution at node Z. ECE 109 Spring 2020 Final Exam w/ Solutions Page 3 of 14
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
Name: __________________________
[2] [10 pts total
] Logic
Complete the circuit for the function shown. Choose your design to use the lowest number of gates.
ECE 109 Spring 2020 Final Exam w/ Solutions Page 4 of 14
Name: __________________________
[
3] [15 points total] State Machines
Construct the next state and output table for the following state diagram.
ECE 109 Spring 2020 Final Exam w/ Solutions Page 5 of 14
Name: __________________________
[4] [10 points] Assembly Language and Machine Code [a] For the following table convert the assembly language commands to machine code. Assume that each command is located at PC=x3100. This code is NOT sequential. 1.
STR R2, R5, x0C
0111 010 101 001100
2.
LD R2, VIR
0010 010 1 1010 0100 x1A4
3.
ST R2, RATLANTA
0011 010 0 1001 1100 x09C
4.
LEA R5, SEBRING
1110 101 1 1111 1111 x1FF
Assume the following Symbol Locations:
SEBRING
x3100
DAYTONA
x3127
VIR
x30A5 RATLANTA
x319D
RAMERICA
x465E
WATKINS
x31DE
BARBER
x3164
LAGUNA
x316A
ECE 109 Spring 2020 Final Exam w/ Solutions Page 6 of 14
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
Name: __________________________
[5] [10 pts] Subroutines
[a] [2 pts]
Upon jumping to a subroutine, where is the return address saved?
R7
[b] [5 pts]
The current PC = x3180. What are the min and max address values to which a subroutine may jump using the JSR command?
11 bits +1023 / -1024 x3FF / -x400 x2D80 / x3580
[c] [3 pts]
To what addresses can a JSRR command jump to? Anywhere. 16 bit location
ECE 109 Spring 2020 Final Exam w/ Solutions Page 7 of 14
Name: __________________________
[6] [27 points] Code Segments Complete the following code segments
[a] [4 pts]
Add R6 to R4 and put the result in R2
ADD R2, R6, R4
[b] [ 4 pts]
Subtract R4 from x3248 and leave the result in R1
LD R1, BIGNUM
NOT R4, R4
ADD R4, R4, #1
ADD R1, R1, R4
BRnzp NEXT
BIGNUM .FILL x3248
NEXT
[c] [4 pts] Compute R3 OR R5 and put result in R1
NOT R3, R3
NOT R5, R5
AND R1, R3, R5
NOT R1
[d] [10 pts] Assume string NUMS contains only chars ‘0’-‘9’. Add all the binary numeric values
and leave the sum in memory at MYSUM. String NUMS is already defined. AND R3, R3, #0
; clear sum
LEA R5, NUMS
; get start of string
LOOP1 LDR R0, R5, #0
; get char
BRz GO1
; end of string ADD R0, R0, NEGASCII
; subtract ASCII Offset
ADD R3, R3, R0
; add to sum
ADD R5, R5, #1
; increment ptr to next char
BRnzp LOOP1
GO1 ST R3, MYSUM
BRnzp NEXT
MYSUM .FILL x0000
NEGASCII .FILL #-48
NEXT
ECE 109 Spring 2020 Final Exam w/ Solutions Page 8 of 14
Name: __________________________
[e] [5 pts] Read a character from the keyboard using GETC and compare to ‘F’. Set R5 =1 if character is F, set R5 = 0 if other.
GETC
; read char
LD R2, NEGF
; get negative ‘F’
AND R5, R5, #0
; clear return code
ADD R1, R0, R2
; compare
BRz GOHOME
ADD R5, R5, #1
; set return code to 1
BRnzp GOHOME
NEGF
.FILL #-70
GOHOME
Alternative Solution uses KYBSR and KYBDR as GETC was not originally specified.
ECE 109 Spring 2020 Final Exam w/ Solutions Page 9 of 14
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
Name: __________________________
[7] [18 pts]
Code Counting
Suppose the LC-3 has the code loaded as shown. Answer each question. [a] What is the address of the last instruction or variable declaration? x3075
[b] What is the address of the first instruction?
x3030
[c] After the first LEA is executed, what is the
value in R0?
x303B
[d] After the LDI instruction is complete, what
value is in R2?
x006D or ‘m’ [e] What is the first output to the display?
Zoom Zoom!
[f] What is the last output to the display?
Podium Finish!
[g] After the JSRR is executed what is the address of the next instruction fetched?
x305D
ECE 109 Spring 2020 Final Exam w/ Solutions Page 10 of 14
;
; Final Code
Counting .ORI
G x3030
; Comment Line 1
LEA R0, FERRARI
PUTS
LDI R2, MERC
AND R4, R4, #0
ADD R4, R4, #7
LD R3, REDBULL
LEA R5, BOXBOX
JSRR R5
Name: __________________________
[8] [10] points Interrupts
[a] [2 pts]
When an internal interrupt occurs, due to events such as an illegal opcode, privileged operation, etc., this is called:
Exception
[b] [6 pts] Name three (3) things that must be preserved before servicing an interrupt.
Processor Status Register, Program Counter, Registers
[c] [2 pts] Where are these saved during the processing of an interrupt?
On the Supervisor (Super) Stack
ECE 109 Spring 2020 Final Exam w/ Solutions Page 11 of 14
Name: __________________________
[9] [10 pts total] Stack
[a] [5 pts]
Write the code to set up a user stack with x20 locations in memory. Set up the labels as required.
In the main code above your stack setup show how to setup the Stack Pointer (SP, TOS, TOP) Do not worry about jumping around the .FILLs and .BLKWs, etc. MAIN LEA R6, STACKTOP
…
HALT
; not required to show
STACK .BLKW x1F
STACKTOP .FILL x0000
[b] [5 pts]
A stack is set up with the TOS (R6) pointing to x5000. After 5 PUSH and 2 POP operations, what is the new R6 value? x4FFD
ECE 109 Spring 2020 Final Exam w/ Solutions Page 12 of 14
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
Name: __________________________
ECE 109 Spring 2020 Final Exam w/ Solutions Page 13 of 14
Name: __________________________
ECE 109 Spring 2020 Final Exam w/ Solutions Page 14 of 14
TRAP TABLE
n
2
n
-8
0.00390625
-7
0.0078125
-6
0.015625
-5
0.03125
-4
0.0625
-3
0.125
-2
0.25
-1
0.5
0
1
1
2
2
4
3
8
4
16
5
32
6
64
7
128
8
256
9
512
1
0
1024
1
1
2048
Related Documents
Related Questions
Name: _____________________________________
Decode the value of the following resistors and indicate the tolerance:
Brown-Black-Red Gold. _____________________
Yellow-Violet-Yellow Gold. ______________________
Brown-Black-Green-Red Silver. ______________________
Blue-Grey-Black-Blue Grey. ______________________
Orange-White-Orange-Silver Red. ______________________
Violet-Black-Red-Black ________________________
Grey-Yellow- Brown-Silver Blue. __________________________
What are the color bands on the following value resistors all of which have a 5% tolerance?
8) 22k Ω ___________________________________________________________
9) 10.5 Ω ___________________________________________________________
10) 10k Ω ___________________________________________________________
11) 4.70 Ω __________________________________________________________
12) 33.1k Ω ___________________________________________________________
What are the color bands on the following value…
arrow_forward
Please answer with detail and how it is done. Photo is attached with the questions.
arrow_forward
. Does ‘a three digit color coding of resistor values’ limit producible resistor value ranges? Why? If you need to increase these range what would be your solution?
**please type it using keyboard NO handwriting**
arrow_forward
You wish to turn on the two LEDs located at the outside of the LED pack, so the first thing you will do is set AL to _________.
A) 00
B) 11
C) 18
D) 55
E) 81
arrow_forward
Potential energy, or voltage, introduced into a circuit is called a(n) ____________________.
arrow_forward
A/An ________ captures different types of signals from the human body and convert them into electrical signals.
Question 8 options:
Electrode
Transducer
Sensor
arrow_forward
using the base of 2 to answer following subtraction:
1000 base 2
-101 base 2
________________
arrow_forward
in text form with proper workings and explanation for each and every part and steps with concept and introduction no AI no copy paste remember answer must be in proper format with all working!!!!!!!
arrow_forward
oleg is using a multimeter to test the circuit branch he's just installed. after turning off the current to the circuit at the service panel, he'll first attach one probe to the ----- in the end of the run. a. black wire b. box c. white wire d. ground wire
Please answer with explanation
In typing format
arrow_forward
The _______ diode used in the circuit below
Your answer
-OV
arrow_forward
5. Electrical apprentices must take _______ core hours of training to satisfy the Michigan academic program requirement.
A. 650
B. 550
C. 250
D. 450
arrow_forward
A one meter rod 2 cm diameter is drawn until its resistance is 100 times the initialresistance. Its length afterward is _________.
arrow_forward
Which of the following will need the highest level of
illumination ?
O a. Bed rooms
O b. Hospital wards
O c. Proof reading
O d. Railway platforms.
arrow_forward
Determine the current, voltage and power dissipated by each of the 6 resisters in the following circuit:
R47: V:_______ I:_______ P:_______
R16: V:_______ I:_______ P:_______
R5: V:_______ I:_______ P:_______
R40: V:_______ I:_______ P:_______
R22: V:_______ I:_______ P:_______
R2 : V:_______ I:_______ P:_______
arrow_forward
Please help answer all questions.?
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
Related Questions
- Name: _____________________________________ Decode the value of the following resistors and indicate the tolerance: Brown-Black-Red Gold. _____________________ Yellow-Violet-Yellow Gold. ______________________ Brown-Black-Green-Red Silver. ______________________ Blue-Grey-Black-Blue Grey. ______________________ Orange-White-Orange-Silver Red. ______________________ Violet-Black-Red-Black ________________________ Grey-Yellow- Brown-Silver Blue. __________________________ What are the color bands on the following value resistors all of which have a 5% tolerance? 8) 22k Ω ___________________________________________________________ 9) 10.5 Ω ___________________________________________________________ 10) 10k Ω ___________________________________________________________ 11) 4.70 Ω __________________________________________________________ 12) 33.1k Ω ___________________________________________________________ What are the color bands on the following value…arrow_forwardPlease answer with detail and how it is done. Photo is attached with the questions.arrow_forward. Does ‘a three digit color coding of resistor values’ limit producible resistor value ranges? Why? If you need to increase these range what would be your solution? **please type it using keyboard NO handwriting**arrow_forward
- You wish to turn on the two LEDs located at the outside of the LED pack, so the first thing you will do is set AL to _________. A) 00 B) 11 C) 18 D) 55 E) 81arrow_forwardPotential energy, or voltage, introduced into a circuit is called a(n) ____________________.arrow_forwardA/An ________ captures different types of signals from the human body and convert them into electrical signals. Question 8 options: Electrode Transducer Sensorarrow_forward
- using the base of 2 to answer following subtraction: 1000 base 2 -101 base 2 ________________arrow_forwardin text form with proper workings and explanation for each and every part and steps with concept and introduction no AI no copy paste remember answer must be in proper format with all working!!!!!!!arrow_forwardoleg is using a multimeter to test the circuit branch he's just installed. after turning off the current to the circuit at the service panel, he'll first attach one probe to the ----- in the end of the run. a. black wire b. box c. white wire d. ground wire Please answer with explanation In typing formatarrow_forward
- The _______ diode used in the circuit below Your answer -OVarrow_forward5. Electrical apprentices must take _______ core hours of training to satisfy the Michigan academic program requirement. A. 650 B. 550 C. 250 D. 450arrow_forwardA one meter rod 2 cm diameter is drawn until its resistance is 100 times the initialresistance. Its length afterward is _________.arrow_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 Learning
Electricity for Refrigeration, Heating, and Air C...
Mechanical Engineering
ISBN:9781337399128
Author:Russell E. Smith
Publisher:Cengage Learning