Ece190_sp11_exam2_pr - Spring 2011 Practice Exam N a me N et I D Programming studio section(mark only the one you attend 9:00 AM 12:00 PM 1:00

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Spring 2011 Practice Exam N a me : N et I D : Programming studio section (mark only the one you attend): 9:00 AM 12:00 PM 1:00 PM 2:00 PM 3:00 PM DCL 440 [ ] AD4 [ ] AD5 [ ] AD3 AD1 DCL 520 [ ] AD6 [ ] AD8 [ ] AD7 [ ] AD9 [ ] AD2 B e su r e you r e x a m b oo k l e t h as 8 p ages. D o not t e a r t h e e x a m b oo k l e t a p a r t . W r i t e y o u r n a m e a t t h e t o p o f e a c h p a ge . T h is i s a c lose d b oo k e x a m . Y o u m a y n o t u se a c a l c u l a t o r . Y ou a r e a l l ow e d on e h a n d w r i t t e n 8.5 x 11 " sh e e t of n ot es. A b so l u t e l y n o i n t e r a c t i o n b e t w e e n s t u d e n t s i s a l l o w e d . B e su r e to c l e a r l y i n d i c a t e a n y assu m p t ions t h a t you m a k e . Problem 1 10 points _______________________________ Problem 2 10 points _______________________________ Problem 3 5 points _______________________________ Problem 4 5 points _______________________________ Problem 5 10 points _______________________________ Total 40 points _______________________________ Page: 2 Name: ___________________________________________ P r ob l e m 1 (10 p oi n ts) : F S M E x a m p l e p r ob l e m 1 : Design FSM and combi na t i ona l circuit necessary to implement the FSM logic for controlling traffic danger sign described in section 3.6.4 of the textbook. P a r t A (1 point): Draw state diagram. P a r t B (2 points): Fill in st a t e t r ansi t i on and output t ruth tables. P a r t C (2 points): Using Programmable Logic Array, design combinational logic circuit that implements the traffic danger sign controller logic. E x a m p l e p r ob l e ms 2 & 3 : Solve problems 3.41 and 3.43 from the textbook. Name: ___________________________________________ Page: 3 address instruction x3000 x3001 x3002 register R0 R1 R2 R3 R4 x903F x1021 x1201 Value x000A x000B x000C x000D x000E P a r t A (6 p oi n t) : Assuming PC is initially set to x3000, trace the execution of three steps of the given program segment and fill in the table below. Write down values stored in PC, IR, MAR, MDR, N, Z, and P registers a t t h e e n d of t h e i nst r u c t ion c y c l e . Values for PC, IR, MAR, and MDR should be written in hexadecimal. Values for N, Z, and P should be written in binary. PC IR MAR MDR N Z P P a r t B (2 p oi n t) : How many memory accesses will take place during the execution of this program segment? Answer: _______________________ P a r t C (2 p oi n t) : What hexadecimal value will be stored in R1 once all three instructions are executed? Answer: _______________________ Page: 4 Name: ___________________________________________ P r ob l e m 3 (5 p oi n ts) : L C -3 I S A A TA spilled a cup of coffee on his LC-3 computer. As a result, the computer was damaged in instructions. P a r t A (1 p oi n ts) : If MSB of IR is always stuck at one, which LC-3 instructions will be affected and how? List instructions that will be affected: ______________________________________________ Explain what will happen to them. P a r t B (2 p oi n ts) : If the MSB of the global bus is shorted to ground, what impact would that have on executions of RET? P a r t C (2 p oi n t) : Computer skips every other instruction. What damage to its PC register might cause this? Name: ___________________________________________ Page: 5 - - - - Name: ___________________________________________ Page: 6 - - - LEAR1,INPUT loadaddressofstring ADDR1,R1,# 1 LDR2,LPAREN_NEG LDR3,RPAREN_NEG  LOOP ADDR1,R1,#1 LDRR0,R1,#0 loadnextcharfromstring BRzDONE doneifwereachnullchar ADDR4,R2,R0 checkifcharisleftparenthesis BRnpNOT_LPAREN JSRPUSH pushontostackifleftparenthesis BRnzpLOOP  NOT_LPAREN ADDR4,R3,R0 checkifcharisrightparenthesis BRnpLOOP gobacktoloopifnotrightparenthesis JSREMPTY checkifthestackisempty BR______________ PASSorFAILifstackisempty JSRPOP BRnzpLOOP  DONE JSREMPTY BR______________ PASSorFAIL BR______________ PASSorFAIL  LPAREN_NEG.FILL RPAREN_NEG.FILL     F o r p r ob l e ms t h a t as k you to d r a w t h e st a c k , assu m e t h a t t h e st a c k st a r ts a t t h e bot to m of t h e t a b l e a n d g r ow s u p w a r d . If a location on the stack contains an ASCII character, you may just draw that character (you do NOT need to put the hex value of that character).   Page: 7 Name: ___________________________________________ Page: 8 Name: ___________________________________________ ...
View Full Document

This note was uploaded on 01/23/2012 for the course ECE 190 taught by Professor Hutchinson during the Spring '08 term at University of Illinois, Urbana Champaign.

Ask a homework question - tutors are online