• No results found

University of Toronto Faculty of Applied Science and Engineering

N/A
N/A
Protected

Academic year: 2021

Share "University of Toronto Faculty of Applied Science and Engineering"

Copied!
12
0
0

Loading.... (view fulltext now)

Full text

(1)

Print :

First Name: . . . Last Name:. . . . Student Number: . . . .

University of Toronto

Faculty of Applied Science and Engineering

1. There are 7 questions and 13 pages. Do all questions. The total number of marks is 80.

The duration of the test is 2 hours 30 minutes.

2. ALL WORK IS TO BE DONE ON THESE SHEETS! Use the back of the pages if you need more space. Be sure to indicate clearly if your work continues elsewhere.

3. Open book - Exam Type D. Only authorized photocopies of copyrighted material are allowed.

A photocopy of Appendix A for Verilog is permitted.

4. All calculators permitted.

5. Please put your final solution in the appropriate spaces. A big space does not necessarily mean a long answer is required.

6. Place your student card on your desk

Final Examination - December 17, 2003 ECE253F - Digital and Computer Systems Examiners - Parham Aarabi and Paul Chow

1

[10] 2 [15]

3 [15]

4 [10]

5 [10]

6 [10]

7 [10]

Total [80]

(2)

[10 marks] 1 . An insurance company has the following requirements for giving car insurance. The applicant must be:

- A married female 25 years old or over, or

- A married male 25 years old or over who has not been involved in a car accident, or - A female under 25, or

- A married male who has been involved in a car accident, or

- A married male under 25 who has not been involved in a car accident.

Assuming that young single males are the most accident prone drivers, what are the minimum characteristics of people that this company wants to insure?

Page 2 of 1 3

(3)

2 . By reverse engineering an alien space ship, you have obtained a black box that can shut down any alien space ship . After careful study, you realize that there are 16 input bits that define the space ship number, and a second set of 16 bits that define the command (i.e . the `shut down' command would correspond to the number $047), and a control bit whose positive edge executes the given command on the given ship.

For example, if the 16 bit ship number corresponds to the decimal number 36, and the 16 bit command corresponds to the hex number $047, then the positive edge of the control bit shuts down ship 36 .

Armed with your 68000 Gizmo board and as many AND, OR, and NOT gates as well as any multiplexors or tri-state buffers as you need, you devise a plan to shut-down ALL alien ships . [8 marks] a; As a first step, design the circuit to interface the black box with the 68000 bus, assuming that memory addresses at or above $100000 can be used as the device address. As a reminder, the bus handshake control for a write operation is shown below:

Note: Page 4 of 13i's left blank.

Page 3 of 13

(4)

(7 marks] b) Now, given your circuit of part (a), write the 68000 assembly code to perform the shut down of ALL alien ships.

(5)

3. Consider the following 68000 assembly program:

; initializing the stack

STUCK

[5 marks] a) After the program gets stuck in the infinite loop at STUCK, what is the value of DO and D1?

Page 6 of 13

ORG $18000

DS.L 100

STK DS.L 1

ORG $20000

MOVEA.L #STK,A7

MOVE.L #15,DO

MOVE.L #O,D1

MOVEI #O,D2

LOOP MOVE.L D0,-(A7)

ADD #5,Dl

CMP D1,DO

BNE LOOP

MOVEM.L DO-D1,-(A7)

MOVE #12,DO

MOVE #O,D1

BSR MSUB

STUCK BRA

MSUB ADD.L 4(A7,DO),D1

HERE SUB #4,DO

BNE MSUB

RTS

(6)

(5 marks] b) Assuming that all branch instructions (i.e. BSR, BNE) take 1 word (16 bits) of memory, find out the memory addresses used for LOOP and STUCK.

[5 marks] c) Show the exact contents of the stack after the HERE line is reached in the MSUB subroutine.

Page 7 of 13

(7)

[2 marks] 4. a) What is the difference between polling I/O and interrupt driven I/O?

[2 marks] b) Under what circumstance would polling I/O be preferred to interrupt driven I/O?

(8)

[6 marks] c) During the middle of writing your Interrrupt Service Routine (ISR), the `e' key on the keyboard gets stuck, and you decide to use the `RTS' instruction at the end of the ISR instead of the `RTE' instruction. Given that the `e' key cannot be used, how would you write the end of your ISR (i.e. the instructions preceding the RTS) to make sure everything functions correctly? Assume that the following code was entered prior to the malfunctioning `e' key and assume further that you are free to use (without restoring) D5, D6, and D7 in your program . For the purposes of this program, assume that you can access SR like any other processor register (i .e. AND DO,SR is a valid instruction), that you are always in supervisor mode, and that you cannot use the RTR instruction.

ISR MOVEM.L DO-D4/AO-A6,-(A7)

MOVEM.L (A7)+,DO-D4/AO-A6

*put your code

*right here and

*use as many

*lines as you

*need RTS

[5 bonus] d) This is for 5 bonus marks and is to ONLY be attempted if you have done all the other questions and have extra time. Do your solution on the back of the previous page. Please indicate that you have attempted this question here.

In Part c) above, an assumption was made that the use of SR as a destination is allowed for all 68000 instructions. For the bonus marks, find a solution that accesses the SR using ONLY legal 68000 instructions.

Page 9 of 13

(9)

5 . You are given the following Verilog code:

module mystery(X,Y,Z.Clock, Reset) ; output [7:0]X;

output [7:0]Y;

input [7:0] Z;

input C1ock,Reset;

reg [7 :0]X;

reg [7:0]Y;

always @(posedge Clock) if (Reset)

begin X<=1 ; Y<=Z ; elseend

begin

if (Y[0]==1) begin

X<=X+X+X;

Y[0]<=Y[1] ;end Y[1]<=Y[2];

Y[2]<=Y[3];

Y[3]<=Y[4];

Y[4] <=Y[5];

Y[5] <=Y[6];

Y[6] <=Y[7];

Y[7] <=0;

endmodule end

[7 marks] a) When the input Z=$32, you raise the Reset signal. After many Clock cycles, you lower the Reset signal. What sequence of numbers will X and Y take on every positive edge of Clock for the first ten clock cycles after Reset is lowered? (continue your answer on the next page).

Page 10 of 13

(10)

Continue your answer from part (a) here .. .

[3 marks] b) For a given input Z, what does the circuit defined by this Verilog code do?

Page 11 of 13

(11)

[10 marks] 6. The performance of the EngSci I processor needs to be improved. A suggestion has been to try adding an instruction cache. You have been asked to carry out a number of simulations to test the proposed direct-mapped cache. The cache contains a total of 8 blocks, with 1 word per block.

One of the programs that you ran generated the following sequence of instruction addresses.

4 5 6 7 8 911 5 6 9 5 6 9 13 17 18 19 20 24 28 20 25 26 11 28 25 27

The table below represents the 8 words in the cache. Complete the table by showing the addresses stored in each cache location as the above sequence of addresses is accessed. Write the addresses starting from the left side in each box. If a word is replaced, then write the new address beside the old one separated by a comma, so that the most recent address is the one on the right.

Block

0

2

3

4

5

6

7

What is the total number of cache misses assuming the cache was empty at the start?

Page 12 of 13

# cache misses =

CI

(12)

(10 marks] 7. Design and draw a sequential circuit that can be used as a "serial 2's complementer" . The circuit must operate as follows . The input number., in 2's complement format, is fed to the circuit one bit at a time (one bit per clock cycle), starting with the least-significant bit and ending with the sign bit . The output of the circuit is a 2's complement number that is the negative of the input number, generated in the same bit order as the input number, i.e., the LSB comes out first. Hint: This circuit can be done as a Mealy machine with just one D flip flop and a few simple gates.

Page 13 of 13

References

Related documents

■ Before using, test the Ground Fault Circuit Interrupter (GFCI) provided with the power cord to ensure it is operating properly.. GFCI reduces the risk of

Back Painted White Glass and Eko Panels Eko Panels with Clerestory and Double Glazed Front with Framed Sliding Door.. RANGE i |

In this paper we describe this phenomenon in detail and work out the conditions when single-channel phase measurements can be used for the reliable measurement of the phase and

This tool features: public access through web services; extracting metadata of photos from Flickr or local photo repositories; clustering photos using

Such a collegiate cul- ture, like honors cultures everywhere, is best achieved by open and trusting relationships of the students with each other and the instructor, discussions

Destination Port 16 bits Length 16 bits Checksum 16 bits Data xx bits. 64 What is the function of DDR on

The narrowest grounds rule would then come into play, 110 and Justice Roberts‘s reasoning that the tax power holding depends on the Commerce Clause holding, in conjunction with

When an analytic function has a branch cut, it is an indicator of the fact that the function should not be thought of not as a function on a region of the complex plane, but instead