






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Name: NetID:
Lab Section: DCL 440 DCL 520 9:00 AM [ ] AD 4 [ ] AD 11:00 AM [ ] AD 12:00 PM [ ] AD 5 [ ] AD 6 2:00 PM [ ] AD 7 [ ] AD 8 3:00 PM [ ] AD 1 [ ] AD 2
Be sure your exam booklet has 10 pages. Do not tear the exam booklet apart; you can only detach the last page. Use backs of pages for scratch work if needed. Be sure to write your name and lab section on each exam page. This is a closed book exam. You may not use a calculator. You are allowed one handwritten 8.5 x 11" sheet of notes. Absolutely no interaction between students is allowed. Be sure to clearly indicate any assumptions that you make. The questions are not weighted equally. Budget your time accordingly. You can start on Programming Problems only after finishing Problems 1-6. Page 9 contains additional instructions for Programming Problems. Don’t panic, and good luck!
Problem 1 10 points: ___________
Problem 2 13 points: ___________
Problem 3 10 points: ___________
Problem 4 9 points: ___________
Problem 5 11 points: ___________
Problem 6 12 points: ___________
Programming Problem 1 25 points: ___________
Programming Problem 2 10 points: ___________
Total 100 points: ___________
Problem 1 ( 10 pts): Binary Representation
i) Perform the following calculation by first converting the two decimal numbers to two’s complement notation using 6 bits. Write results in both two’s complement binary representation and decimal, indicate if overflow occurs.
Overflow: yes ______, no _____
ii) What is the range of numbers you can represent with 6 bits using 2's complement representation?
From _______________ to _______________
iii) What is the result of the following bit-wise operation: NOT(xC6 AND NOT(x07))? Write your answer in hexadecimal.
Answer: ____________________
iv) Compute the addition and write your answer in decimal:
v) A computer runs in an unsigned 6 bit mode. What is the output for the following calculation?
vi) Convert the following floating point number to decimal:
Problem 3 (10 pts): Memory Organization
i) What is the memory output q 3 q 2 q 1 q 0 when A[1:0]=00 and WE=0?
D Q
we
0
D Q
we
1
D Q
we
1
D Q
we
0
D Q
we
0
D Q
we
1
D Q
we
1
D Q
we
0
D Q we
1
D Q we
0
D Q we
0
D Q we
1
Answer: ________________
ii) What is the address space of the memory shown in part (i)?
Answer: ________________
Problem 4 ( 9 pts): FSM
i) Consider the following FSM with states A and B and inputs I 1 I 0. Suppose the FSM is fed the following sequence of inputs: 00, 11, 01, 10, 01, 11, 00, 10, 10. If the FSM is initially in state B, what is the series of states that the FSM will transition through?
ii) A series of inputs causes the FSM from part (i) to stay in state B, what is the relationship between the input bits I 1 and I 0 while the FSM is in state B?
Answer: ____________________________________________________________
Problem 6 ( 12 pts): LC-3 ISA
LC-3 computer is about to perform a FETCH. The current IR, PC, and general-purpose registers contain the following values:
IR PC R0 R1 R2 R3 R4 R5 R6 R
and relevant memory locations are:
Write down (in hexadecimal notation) values in IR, PC, and general-purpose registers after executing two instructions:
Programming Problem 1 ( 25 pts): LC-3 Machine code
In this assignment you are asked to write a program in LC-3 machine (binary) codes that examines values at 7 consecutive memory locations starting at address x 30 FF and stores their absolute values back to the same memory locations. For example, look at the following test case scenario:
Memory Location Input Test Set Result after Program Run x30FF - (^1010 ) x3100 (^010 ) x3101 (^1010 ) x3102 - (^234510 ) x3103 - (^12310 ) x3104 (^65710 ) x3105 - (^1600010 )
i) 5 pts. Provide a systematic decomposition for the above problem.
ii) 20 pts. Implement your algorithm on the computer. Your program should start at memory address x3000. Your code should be saved in exam1/project1/abs.bin file. To receive full credit, it should correctly run in lc3sim (or lc3sim-tk).