





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!






Spring 2011 Tuesday, March 1 5 , 2011 Attach label here Workstation #:
Problem 1 ( 10 points): FSM Design FSM and combinational circuit necessary to implement the FSM logic for detecting binary sequence '101' in an arbitrary binary string. As long as entered binary string does not contain '101' sequence, the circuit should have red light turned on. Once the expected binary sequence is detected, red light should be turned off and green light should be turned on and stay on regardless of any new input. Part A ( 3 points): Draw state diagram. Initial state 00 in which Red light is ON is pre-filled as an example. Assume that transition between states is triggered by an external input consisting of binary digits '0' and '1'.
00 01 10 11 Part B (4 points): Fill in state transition and output truth tables. External input Present state Next state Output S 1 present S 0 present S 1 next S 0 next Red Green 0 0 0 1 0 0 0 0 1 1 0 1 0 1 0 1 1 0 0 1 1 1 1 1 Part C ( 3 points): Design combinational logic circuit that implements the state transition logic of this FSM.
Problem 3 ( 5 points): LC- 3 data path A TA accidentally stepped on his LC-3 computer. As a result, the computer was damaged in some ways. Explain how this damage manifests itself in computer’s ability to execute some instructions. ( Note: formats of the entire LC-3 instruction set are provided on page 8 and LC- 3 data path diagram is provided on page 9. MSB is bit #15 and LSB is bit #0. ) Part A ( 1 point): If bit 3 of the IR is shorted to ground, what impact would that have on arithmetic instructions ADD and AND? Part B ( 2 points): If SEXT unit is replaced with ZEXT unit, which instructions will be affected and how? List instructions that will be affected: ______________________________________________
Explain what will happen to them. Part C (2 points): TRAP instruction no longer functions as expected. What part of the data path relevant to the execution of this instruction might have been damaged to cause this? (Assume all other instructions still function as expected.)
Problem 4 (5 points): LC-3 I/O You are asked to design TRAP routine for plotter --a new LC-3 output device which draws lines on paper. The interface to this device is to be implemented using memory-mapped I/O using five new device registers: PDR_X1, PDR_Y1, PDR_X2, and PDR_Y2 (plotter data registers) and PSR (plotter status register) mapped into some memory addresses. The plotter expects 2- dimensional coordinates of the two ends of a line segment, (x1, y1) and (x2, y2), to be transferred to it via the corresponding PDR_* registers in order to plot a single line segment. The plotter sets the most significant bit of PSR to indicate when it is ready to accept a new line segment. Once you fill in the plotter data registers with the required data, you should manually clear this bit to indicate that coordinates of a new line segment are loaded. Draw a detailed flowchart describing the sequence of steps for sending data to the plotter for plotting one line segment. You can assume that line segment coordinates are stored in memory starting from some address, already pre-loaded for your convenience in register R0, in the following order: x1, y1, x2, y2. Be specific , your flowchart should show all interactions with PDR_*, PSR, LC-3 memory, and any other registers you decide to use.
Also indicate if the stack is empty, and IF the stack is NOT empty be sure to draw an arrow clearly pointing to the element on the top of the stack. Also for this implementation of the stack if the string of three characters “abc” were pushed onto the stack and “c” is then POPed off, the stack would look like this: ç Part A (2 points): For INPUT string “aaaaabbb”, fill in the contents of the stack at the moment the program branches to LOOP2 for the first time. Part B (2 points): For INPUT string “aaaaabbb”, fill in the contents of the stack at the moment the program branches to either PASS or FAIL. Part C (2 points): For INPUT string “aaaabbbb”, fill in the contents of the stack at the moment the program branches to LOOP2 for the first time. Part D (2 points): For INPUT string “aaaabbbb”, fill in the contents of the stack at the moment the program branches to either PASS or FAIL. Part A Part B Part C Part D Part E (2 points): Given your results, fill in the code with the missing BR condition codes and branch locations (the three missing branches either jump to PASS or FAIL). b a