SYSC_3006_200_F_Final_

SYSC_3006_200_F_Final_ - EXAMINATION FINAL EXAM ouaglgu 3...

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

View Full Document Right Arrow Icon
Background image of page 1

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

View Full Document Right Arrow Icon
Background image of page 2
Background image of page 3

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

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

Unformatted text preview: EXAMINATION FINAL EXAM ouaglgu: 3 HQURS No. of Students: 180 De artment Name & Course Number: Cosme mstructoqs) Systems and Computer Engineering 94.306A Professor G. Wainer This examination question paper may be taken from the examination room. In addition to this question paper, students require: an examinstlon booklet yesa not] a Seantron sheet yesu no ER Read the entire exam paper before answering any questions. Answer all questions, but answer the easiest ones first. Answer all questions in the answer books provided. 1. [30marks] Answer each of the following. Be brief, but precise. a) [6 marks] State similarities and differences between traps and hardware interrupts. b) {14 marks] Let us suppose we need to build an automated system devoted to control the following features in a building/house: . Automatic lighting: luminosity sensors are installed outside the building, and several chosen lights can be turned on automatically when the light level falls below a given threshold; . Automatic lighting 2: infrared sensors can be used to detect presence of people in a given room, tumng on the corresponding lights; 94.306 Exam Page 1 of 4 gt; 1T 57, . Heating: a sensor measures ambient temperature, turning on/off the heating according with a desired set point; . Intruder detection: magnetic sensors can be mounted in windows and doors, turning on a sound alarm when intruders are detected; . Fire detection: smoke detectors are located in every room, to see if there is fire in progress. . Access: a keyboard can be placed in the main door, and the owner can enter a password. As a reply, the door is automatically opened. i) Which facilities provided by the IBM PC hardware could be useful to build this application? (4 marks) ii) Draw a design skeleton for this application, explaining how many different routines should be implemented, and how they should be organized in terms of their relation to the facilities provided by the IBM PC hardware. Justify your design choices- 6.6.: you should answer which routines should be provided, how are they related, how to activate them. Take care of every issue which is related to the available PC hardware). (10 marks) 0) [4 marks] Let us suppose that we want to build an operating system to be executed in an Intel 8086 platform. The OS should let multiple users to operate concurrently. Which is the main drawback of the 8086 hardware if this idea is to be implemented? (1) [6 marks] Consider the following instruction sequence: MOV CX, 09F 2 l H MOV DX, 07 l 8 8H ADD CX, DX Afier executing the instruction sequence, what are the values of: CX, DX, OF, CF, SF, ZF Explain the value of each of the requested flags in terms of the values that were added and the result. 2. [30 marks] Write a routine devoted to handle division overflow in any program. If a division overflow occurs, display a "Division Overflow" notice on the screen. Include all the source code needed to handle this error. 94.306 Exam Page 2 of 4 3. [10 marks] Fill in the blanks in the following code fragment. The code is devoted to generate the first 12 Fibonacci numbers (sequence 1, 2, 3, 5, 8, 13, 21..., e.g., Vi+l = Vi + Vi-l, with V0=Vl=l). Declare and initialize all the variables need errors you find. . mode] small . stack 1 00h .8086 .data main proc mov ax, mov , ax mov di, mov bx, 10 mov ax, call PrintInt add di, 2 mov ax, call PrintInt add DI, 2 mov ex, 10 L1: mov ax, [di- | add ax, [di- | mov ax cal] Printint add di, loop L1 mov 4C00h int21 h main end main 94.306 Exam Page 3 of4 ; loop count ed. Mark with circles any syntax 4. [35 marks] Suppose that the buttons in an elevator have been interfaced to a computer system like the I/O box in the lab for this course. The building has three floors. Every time a button is pressed, the line corresponding to a switch is turned on (but in this case, buttons do not "bounce"). Every time the elevator approaches a floor, the line corresponding to a switch is turned off. a) [25 marks] You should build a routine (INCLUDE ONLY THE ROUTINE, the main program is not needed) that reacts to the button pressing/floor approaching. Every time the button is pressed, a LED corresponding to the floor is turned on, letting the user know that the button was properly pressed. When the elevator approaches the floor, the LED should be turned ofi‘. The first 3 LEDs (1, 2, 3) are related with each floor. The first switches (A, B, C) are related with the floor buttons/detectors. You should design your routine using subroutines devoted to manage the different tasks. Your code must follow the subroutine coding policies explained during the course. b) [5 marks] Explain briefly how the previous routine should be changed to be implemented as interrupt driven. SWITCHES iobox Switch data port address: 379 h Bit configuration: bit 7 = most significant bit bit 0 = least significant bit bit 7 6 5 4 3 2 1 O E D C B A x x x A through E indicate bit for Switches A through E respective x indicates unused (undefined) LEDS LED control port address: 3'78 h Bit configuration: bit '7 = most significant bit bit 0 = least significant bit bit '7 6 5 4 3 2 l O x x x 5 4 3 2 1 1 through 5 indicate bit for LEDs 1 through 5 respectively x indicates unused (undefined) 94.306 Exam Page 4 of4 ...
View Full Document

{[ snackBarMessage ]}

Page1 / 4

SYSC_3006_200_F_Final_ - EXAMINATION FINAL EXAM ouaglgu 3...

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

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