exam_final_109_spring_2018_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
19
Uploaded by CountPartridgePerson987
Name:
________________________________________ Section
: ____________
ECE 109 Final Exam w/ Solutions May 4, 2018 Cover Sheet
This exam is Closed Note, Closed Book, Closed Calculator, No Electronics, Earbuds.
No correspondence is allowed with anyone other than the instructor/proctor.
Absolutely NO IMs, E-Mails, Verbal Messages, or other communications during the exam!
No Cell Phones, e-watches, pagers, or other communications devices, may be used.
It is OK to work on separate paper, but please write answer back into space on test pages
. STAPLE the extra sheets to your exam and write your name on ALL sheets!
All work must be completed in PENCIL
. No ink pen allowed!
This is a 180 minute exam. Students who arrive late will NOT be given extra time on the exam.
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. Things like “Mary had a little lamb” will not count!
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.
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: __________________________________________________
Name: __________________________
Except
for name,
DO NOT WRITE ON THIS PAGE.
Grader
: _____________________________________________
ECE 109 Spring 2018 Final Exam w/ Solutions Page 2 of 20
Question
Points
Topic
Score
1
10
Transistor Gates
2
15
POS/SOP
3
25
State Diagrams
4
10
Instruction Flow
5
20
Assembly / Machine
Conversions
6
10
Subroutines
7
25
Code Segments
8
20
IEEE 32-bit, Hex,
Binary, Decimal
9
15
Code Line Counting
10
10
Stack
TOTAL
160
Name: __________________________
[1] [10 pts. Total] Complete the truth table for the following transistor circuit. Is this a legal circuit? Solving for intermediate nodes is not required but may help you in solving the final solution at node Z.
Solving for nodes R and Q is not required but may help you solve the final answer.
Legal Circuit
ECE 109 Spring 2018 Final Exam w/ Solutions Page 3 of 20
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] [15 pts total
] Complete the following logic questions.
[a] [10 pts] Draw a SOP or POS combinational logic circuit (using AND, OR, etc.) that implements the function described by the truth table below. This table has 4 inputs ABCD and one output X.
ECE 109 Spring 2018 Final Exam w/ Solutions Page 4 of 20
Name: __________________________
[b] [5 pts] Use any combination of 2-input AND, 2-input OR, and 1-input NOT gates to ensure winning the Stanley Cup from the material supplied. You must use all items shown. You may use multiple gates of each type, you do not have to use all gates. You may use a “bubble” on any input or output instead of an inverter. Many acceptable ways to solve this. Students may show “bubbles” on gate inputs rather than use an inverter.
ECE 109 Spring 2018 Final Exam w/ Solutions Page 5 of 20
Name: __________________________
[
3] [25 points total] State Machines
For the following circuit, determine the Next State Truth Table [15 pts]
and the State Diagram [10 pts].
There are two inputs X1 and X0, X1 is the MSB.
ECE 109 Spring 2018 Final Exam w/ Solutions Page 6 of 20
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: __________________________
Format of Next State Truth Table Above or Below are Acceptable
ECE 109 Spring 2018 Final Exam w/ Solutions Page 7 of 20
Name: __________________________
ECE 109 Spring 2018 Final Exam w/ Solutions Page 8 of 20
Name: __________________________
[4] [10 points] Instructions Version A
[a] [8 pts]
Using the figure below, illustrate the dataflow of the RET
instruction. (Show where
and when
data moves during the execution phase of the instruction.)
[b] [2 pts]
Briefly (in English) describe each step shown in your diagram.
(1) The contents of R7 are sent to the Program Counter (PC)
ECE 109 Spring 2018 Final Exam w/ Solutions Page 9 of 20
R7
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: __________________________
[4] [10 points] Instructions Version B
[a] [8 pts]
Using the figure below, illustrate the dataflow of the JMP Rx
instruction. (Show where
and when
data moves during the execution phase of the instruction.)
[b] [2 pts]
Briefly (in English) describe each step shown in your diagram.
(1) The contents of Rx are sent to the Program Counter (PC)
ECE 109 Spring 2018 Final Exam w/ Solutions Page 10 of 20
R7
Name: __________________________
[5] [20 points] Assembly Language and Machine Code Using the symbol table shown on the right, translate each LC-3 assembly language statement to machine language. If the statement cannot be translated, write ILLEGAL, and explain why the translation cannot be performed. In each case
, assume that the statement being translated is at memory location x3050
.
Assembly Language
Machine Language
BRnp CAROLINA
____
0000 101 0 0100 0000
___
JMP KURE
Illegal - JMP operand is register, not label
____
ADD R1, R3, #-7
____
0001 001 011 1 11001
___
ST R2, TOPSAIL
____
0011 010 1 1010 0010
______
OUT
____
1111 0000 00100001
_____
ECE 109 Spring 2018 Final Exam w/ Solutions Page 11 of 20
Symbol
Value
CAROLINA
x3091
KURE
x30FF
TOPSAIL
x2FF3
WRIGHTSVILLE
x3130
MYRTLE
x3F30
VIRGINIA
x3030
HOLDEN
x3001
Name: __________________________
[6] Subroutines [10 pts]
[a] [2 pts]
Where is the return address from a subroutine stored?? R7
[b] [5 pts]
How far ahead/back can a subroutine jump in the code??
11 bit PC offset, so +1023/-1024 memory locations
[c] [3 pts]
How is a TRAP command mainly different from a subroutine call JSR?
TRAP is a call to an Operating System routine, usually in the OS memory space. JSR is a jump to a routine in User Space. ECE 109 Spring 2018 Final Exam w/ Solutions Page 12 of 20
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] [25 points] Code Segments
[a] [10 points]
Write a code segment to count the number of characters in a string. This string MYSTRING is guaranteed to contain an EVEN number of characters. Put the total in R4 and the total divided by 2 in R5. Assume the string is already set up in memory for us.
;
; Hard to Divide in LC3 Assembly. So have two counters since EVEN number of Characters. ; R4 counts every character, R5 counts every-other character so is equivalent to R4 div 2
;
LEA R1, MYSTRING
; Get address of first char
AND R4, R4, #0
; Clear Counter
AND R5, R5, #0
; Clear counter
AND R3, R3, #0
; Odd/Even Counter
LOOP1
LDR R0, R1, #0
; get char from string
BRz ALLDONE
; skip out if NULL end of string
ADD R4, R4, #1
; increment counter
ADD R1, R1, #1
; bump up pointer to next location
ADD R3, R3, #1
; increment Odd/Even counter
AND R6, R3, x0001
; test for odd
BRpn ALMOST
; don’t increment ADD R5, R5, #1
; increment div 2 counter
ALMOST
BRnzp LOOP1
ALLDONE
[b] [2 pts]
Clear R3
AND R3, R3, #0
[c] [3 pts]
Put x21 into R5
AND R5, R5, #0
; clear R5
LD R6, NUM21
; Load x21, too big for immediate mode
ADD R5, R5, R6
; add
BRnzp NEXT
; must jump around .Fill
NUM21
.FILL x21
NEXT
ECE 109 Spring 2018 Final Exam w/ Solutions Page 13 of 20
Name: __________________________
[d] [ 4 pts]
Add x845 to R3, then subtract the result from R2
LD R4, MY8
; Load x845
ADD R3, R3, R4
; add to R3
NOT R3, R3
; Make 2sC
ADD R3, R3, #1
ADD R2, R2, R3
; subtract R2 – (R3+x845)
BRnzp NEXT2
MY8 .FILL x845
NEXT2
[e] [6 pts]
Add every third number between #3 and #39, starting with #3, and put the answer
into R0.
AND R0, R0, #0
; clear counter for sum
AND R3, R3, #0
; clear counter for 3s
AND R1, R1, #0
ADD R1, R1, #3
; set R1 to 3
LD R2, NEG39
ADD R3, R3, #3
; set to 3
LOOP1 ADD R3, R3, #-1
; dec R3
BRp GO1
; not 3
rd
value, skip
ADD R0, R0, R1
; 3
rd
value, add to sum
ADD R3, R3, #3
; reset 3 counter
GO1
ADD R1, R1, #1
; increment number 3 to 39
ADD R5, R1, R2
; Test for -39
BRnp LOOP1
BRz HOME
NEG39 .FILL #-39
HOME
ECE 109 Spring 2018 Final Exam w/ Solutions Page 14 of 20
Name: __________________________
[8] [20 pts total] Binary Math, Floating Point
[a] [10 pts]
Convert the decimal value into the 32-bit IEEE floating-point binary number below. You must show your work
to get full credit.
-1372.09375
Show work:
Sign = 1, negative
Fraction = 0.09375 = .00011 (base 2)
Number = 1372 decimal = 101 0101 1100 (base 2)
Number = 10101011100.00011 (base 2) x 2
10
Number = 1.0101011100.0001 (base 2) x 2
10
Exponent = 10 + 127 = 137
IEEE Binary floating-point:
1
10001001
01010111000001100000000
ECE 109 Spring 2018 Final Exam w/ Solutions Page 15 of 20
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
1
0
512
1024
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: __________________________
[b] [10 pts] Complete the following math problems. You must show your work
to get full credit.
Show all results in 8-bit 2sC Hex Coding
. All values are 8-bit 2sC integers.
I chose to convert to decimal, do the math, then convert to hex.
x26 #38
+ b11110111 #-9
x1D #29
#11 #11
+ x27 #39
x32 #50
xFFE7
#-25
+ b01001110
#78
x35 #53
ECE 109 Spring 2018 Final Exam w/ Solutions Page 16 of 20
Name: __________________________
[9] [15 pts]
Suppose the LC-3 registers contain the values shown on the left. Show the value
of each register after the code is executed -- up to, but not including the HALT. (DO NOT execute the HALT instruction!!!) Write your answers in hexadecimal format.
Before:
R0: x4000
R1: xFFFF
R2: x1010
R3: xDCBA
R4: x9876
R5: x00FE
R6: xC0D4
R7: x3250
ECE 109 Spring 2018 Final Exam w/ Solutions Page 17 of 20
.ORIG x3250
LEA R0, PR ; start here
PUTS
LDI R3, MM
JSR J1
PUTS
HALT
; stop -- don't execute
PR .STRINGZ "AbCdEf"
MM .FILL x3273
J1 ST R1, D1
ST R2, D2
ST R3, D3
ADD R1, R0, #0
XX LD R3, D3
LDR R2, R1, #0
BRz ZZ
AND R3, R3, R2
BRp YY
ADD R2, R2, R3
STR R2, R1, #0
YY ADD R1, R1, #1
BRnzp XX
ZZ LD R3, D3
LD R2, D2
LD R1, D1
RET
D1 .BLKW 1
D2 .BLKW 1
D3 .BLKW 1
.FILL x20
.FILL x40
.FILL x80
.END
After execution...
R0 = ____x3256___________
R1 = _____xFFFF__________
R2 = ____x1010___________
R3 = ___x0040____________
R4 = ___x9876____________
R5 = ___x00FE____________
R6 = ___xC0D4____________
R7 = __x3255_____________
Name: __________________________
[10] [10 points] Stack
A section of a user program is shown:
.ORIG x5000
COLORRED .FILL x02C0
COLORBLUE
.FILL x01F0
ASCIINEG
.FILL xFFD0
STACKP
.BLKW x0008
TEST0
.FILL x0030
[a] [2 pts]
How large is the space allocated for the stack?
x08 or #8
[b] [2 pts]
What should be the initial location for the Stack Pointer SP ??
Bottom of stack is at x5003. Add x08, Top of Stack will be x500B
[c] [2 pts]
After 4 PUSH operations, what will be the value of the Stack Pointer?
X5007
[d] [2 pts]
After 4 more PUSH operations, Then 2 POP Operations, what will be the value of the Stack Pointer?
X5007 – 4 + 2 = x5005 [e] [2 pts]
What will happen after 6 more PUSH operations?
Overflow Error
ECE 109 Spring 2018 Final Exam w/ Solutions Page 18 of 20
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 2018 Final Exam w/ Solutions Page 19 of 20
TRAP TABLE
Related Documents
Related Questions
Please answer in typing format with explanation
arrow_forward
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
1. A14/2 type copper used for a general lighting branch circuit. Ampacity:______________ Maximum Fuse or Circuit Breakers Sizes:________________ 2.Three 8 AWG copper conductors with THHN insulation Installed in garage in electrical metallic tubing (EMT). The ambient temperature in the garage can reach as high as 110'F. All termination points for this circuit are rated 60'C. Ampacity:______________ Maximum Fuse or Circuit Breakers Sizes:________________ 3.Four 4 AWG copper conductor with THWN insulation imstalled in EMT in a basement. All termination points are rated at 60'C.
Ampacity:______________ Maximum Fuse or Circuit Breakers Sizes:________________ 4. An 8/3 Type UF copper cable installed underground from a house to a detached garage to feed a 120/240-volt subpanel. All termination points are rated at 60'C.…
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
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
The _______ diode used in the circuit below
Your answer
-OV
arrow_forward
if present, are required to be bonded together to form a grounding electrode system. What article does this refer to in the NEC 2017?
arrow_forward
The circuit breaker cubicles illustrated in your reading material each contain____circuit breakers.
A. Two B. Three C. Four D. Six
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
Please answer in typing format
arrow_forward
Four electricians are discussing wiring under raised floors in information technology equipment rooms. Electrician A says that wiring under the raised floor requires fire-resistant walls, floors, and ceilings between other occupancies. Electrician B says that wiring under the raised floor requires fire resistant halfway up the walls and floors between other occupancies. Electrician C says that the room must employ a disconnecting means that removes half of the power to all equipment in the room. Electrician D says that a disconnecting means isn't necessary for the room. Which of the following statements is correct?
A. Electrician B is correct.
B. Electrician D is correct.
C. Electrician A is correct.
D. Electrician C is correct.
arrow_forward
Potential energy, or voltage, introduced into a circuit is called a(n) ____________________.
arrow_forward
Complete the following statement about multimeters using the following words.
Words:
Accuracy, Advanced, Available, Circuits, Current, Digital, Diode, Direct, Display, Electronic, Functions, High, Hundredths, Impedance, Measure, Multimeter, Needle, Ohms, Provide, Range, Selected, Test
A digital __________ (DMM) can __________ many more things than volts, __________, and lowcurrent. Most multimeters measure __________ current (dc) and alternating __________ (ac)amperes, volts, and ohms. More __________ multimeters may also measure __________ continuity,frequency, temperature, engine speed, and dwell, and/or duty cycle.Multimeters are __________ with either digital or analogue displays. DMMs __________ great__________ by measuring volts, ohms, or amperes in tenths, __________, or thousandths of a unit.Several test __________ are usually provided for each of these __________. Some meters havemultiple __________ ranges that must be manually __________; others are auto-ranging.Analogue…
arrow_forward
schedules are typically provided to detail the circuits and overcurrent protection required for
listribution equipment.
Branch-circuit
- Outlet
C.
d.
ore distribution points for electrical in ....
Switch
Panelboard
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:9780133923605
Author:Robert L. Boylestad
Publisher:PEARSON
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:9781337900348
Author:Stephen L. Herman
Publisher:Cengage Learning
Programmable Logic Controllers
Electrical Engineering
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Fundamentals of Electric Circuits
Electrical Engineering
ISBN:9780078028229
Author:Charles K Alexander, Matthew Sadiku
Publisher:McGraw-Hill Education
Electric Circuits. (11th Edition)
Electrical Engineering
ISBN:9780134746968
Author:James W. Nilsson, Susan Riedel
Publisher:PEARSON
Engineering Electromagnetics
Electrical Engineering
ISBN:9780078028151
Author:Hayt, William H. (william Hart), Jr, BUCK, John A.
Publisher:Mcgraw-hill Education,
Related Questions
- Please answer in typing format with explanationarrow_forwardName: _____________________________________ 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_forward1. A14/2 type copper used for a general lighting branch circuit. Ampacity:______________ Maximum Fuse or Circuit Breakers Sizes:________________ 2.Three 8 AWG copper conductors with THHN insulation Installed in garage in electrical metallic tubing (EMT). The ambient temperature in the garage can reach as high as 110'F. All termination points for this circuit are rated 60'C. Ampacity:______________ Maximum Fuse or Circuit Breakers Sizes:________________ 3.Four 4 AWG copper conductor with THWN insulation imstalled in EMT in a basement. All termination points are rated at 60'C. Ampacity:______________ Maximum Fuse or Circuit Breakers Sizes:________________ 4. An 8/3 Type UF copper cable installed underground from a house to a detached garage to feed a 120/240-volt subpanel. All termination points are rated at 60'C.…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_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_forwardThe _______ diode used in the circuit below Your answer -OVarrow_forward
- if present, are required to be bonded together to form a grounding electrode system. What article does this refer to in the NEC 2017?arrow_forwardThe circuit breaker cubicles illustrated in your reading material each contain____circuit breakers. A. Two B. Three C. Four D. Sixarrow_forwardA/An ________ captures different types of signals from the human body and convert them into electrical signals. Question 8 options: Electrode Transducer Sensorarrow_forward
- Please answer in typing formatarrow_forwardFour electricians are discussing wiring under raised floors in information technology equipment rooms. Electrician A says that wiring under the raised floor requires fire-resistant walls, floors, and ceilings between other occupancies. Electrician B says that wiring under the raised floor requires fire resistant halfway up the walls and floors between other occupancies. Electrician C says that the room must employ a disconnecting means that removes half of the power to all equipment in the room. Electrician D says that a disconnecting means isn't necessary for the room. Which of the following statements is correct? A. Electrician B is correct. B. Electrician D is correct. C. Electrician A is correct. D. Electrician C is correct.arrow_forwardPotential energy, or voltage, introduced into a circuit is called a(n) ____________________.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Introductory Circuit Analysis (13th Edition)Electrical EngineeringISBN:9780133923605Author:Robert L. BoylestadPublisher:PEARSONDelmar's Standard Textbook Of ElectricityElectrical EngineeringISBN:9781337900348Author:Stephen L. HermanPublisher:Cengage LearningProgrammable Logic ControllersElectrical EngineeringISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
- Fundamentals of Electric CircuitsElectrical EngineeringISBN:9780078028229Author:Charles K Alexander, Matthew SadikuPublisher:McGraw-Hill EducationElectric Circuits. (11th Edition)Electrical EngineeringISBN:9780134746968Author:James W. Nilsson, Susan RiedelPublisher:PEARSONEngineering ElectromagneticsElectrical EngineeringISBN:9780078028151Author:Hayt, William H. (william Hart), Jr, BUCK, John A.Publisher:Mcgraw-hill Education,
Introductory Circuit Analysis (13th Edition)
Electrical Engineering
ISBN:9780133923605
Author:Robert L. Boylestad
Publisher:PEARSON
Delmar's Standard Textbook Of Electricity
Electrical Engineering
ISBN:9781337900348
Author:Stephen L. Herman
Publisher:Cengage Learning
Programmable Logic Controllers
Electrical Engineering
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Fundamentals of Electric Circuits
Electrical Engineering
ISBN:9780078028229
Author:Charles K Alexander, Matthew Sadiku
Publisher:McGraw-Hill Education
Electric Circuits. (11th Edition)
Electrical Engineering
ISBN:9780134746968
Author:James W. Nilsson, Susan Riedel
Publisher:PEARSON
Engineering Electromagnetics
Electrical Engineering
ISBN:9780078028151
Author:Hayt, William H. (william Hart), Jr, BUCK, John A.
Publisher:Mcgraw-hill Education,