# ECE385H1 Study Guide - University Of Toronto Faculty Of Applied Science And Engineering, Endianness, Nios Ii

54 views11 pages

Published on 12 Apr 2013

Department

Electrical & Computer Engineering

Course

ECE385H1

Professor

Page 1 of 11 Last Name (in case pages get detached):__________________

UNIVERSITY OF TORONTO

FACULTY OF APPLIED SCIENCE AND ENGINEERING

MIDTERM EXAMINATION, MARCH 2009

ECE243H1 S – COMPUTER ORGANIZATION

Exam Type: D

Duration: 2 Hours

A. Moshovos and G. Steffan

This is a type D exam. You are allowed to use any

printed material and a calculator as allowed by the

University regulations.

Last Name (Print): __________________

First Name: _________________________

Student Number: _____________________

Marks

Max.

Marks

1 20

2 15

3 10

4 10

5 20

6 10

7 10

8 5

Total 100

Please:

State your assumptions. Show your work. Comment your code.

Use your time wisely as not all questions will require the

same amount of time. If you think that assumptions must be

made to answer a question, state them clearly. If there are

multiple possibilities, comment that there are, explain why

and then provide at least one possible answer and state the

corresponding assumptions.

Page 2 of 11 Last Name (in case pages get detached):__________________

1. [20] Basic Instruction Semantics: Assume the following initial state for

registers:

R8 = 0x12345678

R9 = 0xBADFADEB

R10 = 0x00101000

R11 = 0xFFFFFFFE

R12 = 0xFFFFFFFF

For the following list of instructions, determine what is resulting value in R2 in

hexadecimal, using all eight digits (that is write 0x00000000 and not 0x0). If an

instruction is not legal (i.e., the instruction does not exist, or the given use of operands is

not allowed for the instruction), then write 'illegal'.

a. ADDI R2, R10, 5 R2 = __0x00101005________

b. ADDI R2, 0x1FACE R2 = __illegal___________

c. AND R2, R9, R11 R2 = __0xBADFADEA________

d. MOVIA R2, 0x1 R2 = __0x00000001________

e. ADDI R2, R8, 0xFFFF R2 = __0x12345677________

f. ANDI R2, R9, R10 R2 = __illegal___________

g. ADDI R2, R0, 0x8000 R2 = __0xFFFF8000________

h. AND R2, R8, R10 R2 = __0x00101000________

i. ADDI R2, R9, -9 R2 = __0xBADFADE2________

j. CMPLEU R2, R11, R12 R2 = __0x00000001________

-2 for any wrong

No part marks for some digits being right

Page 3 of 11 Last Name (in case pages get detached):__________________

2. [15] Memory Operations: Assume the following initial state:

R8 = 0x11223344

R9 = 0xFADEABAD

R10 = 0x55667788

What is final value of R2 in hexadecimal, using all eight digits (that is write

0x00000000 and not 0x0), after the execution of each sequence of instructions, for both

little- and big-endian machines? If any access in the sequence is misaligned, write

'misaligned' instead of an answer.

Little-Endian Big-Endian

STW R9, 0(R8)

LDW R2, 0(R8) 0xFADEABAD 0xFADEABAD

STB R9, 3(R8)

LDB R2, 3(R8) 0xFFFFFFAD 0xFFFFFFAD

STB R9, 3(R8)

LDBU R2, 3(R8) 0x000000AD 0x000000AD

STH R9,1(R8)

LDB R2,1(R8) Misaligned Misaligned

STW R10,0(R8)

LDB R2,1(R8) 0x00000077 0x00000066

STW R10,0(R8)

LDH R2,2(R8) 0x00005566 0x00007788

STH R10,2(R8)

LDB R2,3(R8) 0x00000077 0xffffff88

-1 for any wrong

## Document Summary

Duration: 2 hours: moshovos and g. steffan. You are allowed to use any printed material and a calculator as allowed by the. Use your time wisely as not all questions will require the same amount of time. If you think that assumptions must be made to answer a question, state them clearly. If there are multiple possibilities, comment that there are, explain why and then provide at least one possible answer and state the corresponding assumptions. Last name (in case pages get detached):_________________: [20] basic instruction semantics: assume the following initial state for registers: For the following list of instructions, determine what is resulting value in r2 in hexadecimal, using all eight digits (that is write 0x00000000 and not 0x0). No part marks for some digits being right. Page 3 of 11: [15] memory operations: assume the following initial state: What is final value of r2 in hexadecimal, using all eight digits (that is write.