exam2-a-spr10-soln

exam2-a-spr10-soln -...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ECE 109 Name:____________________________________________ NC State University (Print legibly – at least first initial and last name.) Exam 2(A): 30 March 2010 Section:________________ 1. (18 points) Using the symbol table on the right, write the corresponding LC-3 machine language word (16 bits, binary ) for each assembly language statement below. Assume in each case that the instruction/data word is located at address x3015 . If a translation cannot be performed with the information given, write ILLEGAL in the blank space. Assembly Language Machine Language NOT R6, R7 ___ 1001 110 111 111111 _________ LDI R0, ZULU ___ 1010 000 111101111 __________ TRAP x66 ___ 1111 0000 01100110 __________ LD R2, DELTA ___ 0010 010 000001010 __________ ADD R1, R5, ECHO ____ illegal ______________________ HALT ___ 1111 0000 00100101 (TRAP x25) ______________ JSR VICTOR ___ 0100 1 00111101010 ____________________________ BRnz ZULU ___ 0000 110 111101111 ____________________________ Symbol Value ECHO x3014 TANGO x3000 DELTA x3020 VICTOR x3200 ZULU x3005 WHISKEY x2FF8
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ECE 109 Name:____________________________________________ NC State University (Print legibly – at least first initial and last name.) Exam 2(A): 30 March 2010 2 2. (14 points) Using the figure below, illustrate the dataflow of the TRAP instruction. (Show where and when data moves during the execution phase of the instruction.) PC IR MAR MDR Registers Memory ALU N Z P Briefly (in English) describe each step shown in your diagram. (1) PC is saved to R7. (2) Trap vector (IR[7:0]) is zero-extended and placed in MAR. (3) Memory contents addressed by MAR are retrieved and placed into MDR.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/18/2010 for the course ECE 109 taught by Professor Bradley during the Spring '08 term at N.C. State.

Page1 / 6

exam2-a-spr10-soln -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online