Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

I will not cheat on this exam. GOOD LUCK!, Lecture notes of Software Engineering

Department of Electrical and Computer Engineering ... Note: Please be sure your name is recorded on each sheet of the exam. I will not cheat on this exam.

Typology: Lecture notes

2022/2023

Uploaded on 05/11/2023

eklavya
eklavya 🇺🇸

4.5

(22)

19 documents

1 / 9

Toggle sidebar

Related documents


Partial preview of the text

Download I will not cheat on this exam. GOOD LUCK! and more Lecture notes Software Engineering in PDF only on Docsity! Department of Electrical and Computer Engineering The University of Texas at Austin EE 306, Fall 2015 Yale Patt, Instructor Stephen Pruett, Siavash Zangeneh, Kamyar Mirzazad, Esha Choukse, Ali Fakhrzadegan, Zheng Zhao, Steven Flolid, Nico Garofano, Sabee Grewal, William Hoenig, Adeesh Jain, Matthew Normyle Exam 2, November I l, 2015 Name: Problem 1 (20 points): Problem 2 (15 points): Problem 3 (15 points): Problem 4 (25 points): Problem 5 (25 points): Total (100 points): Note: Please be sure that your answers to all questions (and all supporting work that is required) are contained in the space provided. Note: Please be sure your name is recorded on each sheet of the exam. I will not cheat on this exam. Signature GOOD LUCK! Name: Problem 1. (20 points): Part a. (5 points): Part of the state of the computer is as follows: Then, I-DR R3: x3000 R4: x4000 R-5: x5000 is executed. After this instruction is executed, R5 contains Mem[x40001: x 1234 Mem[x4001J: x2345 Mem[x4002]: x3456 Mem[x40031: x4567 Part b. (5 points): The program below adds the absolute value of the integer in A to the absolute value of the integer in B, and stores the sum in C. We decide to use the subroutine ABS to take as input the contents of RO, and return its absolute value in RO. B c ABS SKIP DONE . ORIG *3000 JSR S ADD R4 RO, LDR B JSR ABS ST RO, HALT . BLKW 1 . BLKW 1 . BLKW 1 AD R4 RO, BRzp ONE NOT R4, R4 ADD RO, R4, RET Why will the above program not work correctly? Please answer in 20 words or fewer. subrouhru MediAes Sq v.M/nsArirÐ i 4 bð callze. 2 Name: Problem 3. (15 points): We want to support 8 input keyboards instead of I. To do this we need 8 ready bits in KBSR, and 8 separate KBDRs. We will use the 8 odd-numbered bits in the KBSR as ready bits for the 8 keyboards, as shown below. We will set the other 8 bits in the KBSR to 0. 13 9 S 3 KBSR The 8 memory-mapped keyboard data registers and their corresponding ready bits are as follows: FE04: KBSR FE06: KBDRI, FE08: KBDR2, FEOA: KBDR3, FEOC: KBDR4, FEOE: KBDR5, FEIO: KBDR6, FE12: KBDR7, FE14: KBDR8, Ready bit is KBSR[II Ready bit is KBSR(3J Ready bit is KBSR(51 Ready bit is KBSR[7J Ready bit is KBSR(91 Ready bit is KBSRII Ready bit is KBSR1131 Ready bit is KBSR[151 We wish to write a program that polls the keyboards and loads the ASCII code typed by the highest priority keyboard into RO. That is. if someone had previously typed a key on keyboard I, we want to load the ASCII code in KBDRI into RO. If no key was typed on keyboard I, but a key had been typed on keyboard 2, we want to load the ASCII code in KBDR2 into RO. ...and so on. That is, KBI has higher priority than KB2, which has higher priority than KB3, which has higher priority than KB4, etc. KB8 has the lowest priority. The following program will do the job AFŒR you fill in the missing instructions: POLL AGAIN FOUND KBSR KBDRI . ORIG X3000 LD RO, KBDRI LDI RI, KBSR BRz POLL AND R2, R2, ADD R2, R2, BRnp FOUND ADD ADO R2,RL, R2 BRnp AGAIN LDR ROJ £0 HALT . FILL xFE04 . FILL xFE06 Your job: fill in the missing instructions. mask a kt3DR 5 read Name: Problem 4. (25 points): You are given a linked list, consisting of at most 20 elements, as shown below. x4000 xoooo c Note the listhead is at location x4000. We want to reverse the nodes of the linked list. For the above linked list, the result would be: x4000 xoooo c The program on the following page (with missing instructions filled in) does the job, using subroutines PUSH and POP Your job: fill in the missing instructions. 6 Name: PHASEI PHASE2 AGAIN . ORIG X3000 LEA LDR JSR R6, BASE RO, START RO, RO, Broach Qul 40 poinJer XOOOO PUSH BRnzp PHASEI LD RI, START JSR POP Cluck SuccesS BRnp DONE STR RQ/ RI, 40 40 LDR RI, BRnzp AGAIN DONE AND RO, RO, *I-A "c X 000 QHALT START . FILL x4000 STACK . BLKW BASE. FILL-gÅse x-3Q2 5 x CF08 PUSHAPO R' , POP EMPTY STR RET AND ADD BRz LDR ADD RET ADD RET RO, R6, R5, R5, RO, BASE R6 EMPTY R6, R5, 7
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved