Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPEG323 Quiz 1 Review Long Chen October, 26th, 2005.

Similar presentations


Presentation on theme: "CPEG323 Quiz 1 Review Long Chen October, 26th, 2005."— Presentation transcript:

1 CPEG323 Quiz 1 Review Long Chen October, 26th, 2005

2 Problem 1 (30 points) - 1 (D) MIPS is using a RISC ISA
Represent 256 in its binary representation (C) 2^8 => [0, 255], so we need 9 bits Big endian vs. little endian (A) 0x (see slides) What is Addressing mode? (C) It determinates where an operand in an instruction can be located and addressed (see slides)

3 This number is used to identify the distance in WORDs!
Problem 1 (30 points) - 2 The range of addresses in the conditional branch instructions in MIPS (Homework #2 - 5) This number is used to identify the distance in WORDs! Conditional branch instruction: beq $s0, $s2, there 16 5 6 bits 16 bits 18 5 bits The range of the distance is about 2^15 WORDs before and 2^15 WORDs after the branch. In other words, 2^17 bytes before and 2^17 bytes after the branch (D) Addresses up to about 128K before and 128K after the branch

4 Problem 1 (30 points) - 3 f) In a N-bit ALU, overflow can be detected by looking at (A) the carry into MSB and the carry out MSB (See Topic3b) g) -0.75ten = = -0.11two Normalized it into -1.1twoX2-1 Compared with the general representation (-1)s X (1+Fraction) X 2(Exponent – 127) We have, s= 1, Fraction = two, Exponent = 126ten = two (A)

5 Problem 1 (30 points) - 4 Compare signed and unsigned numbers
Represent decimal number to hexadecimal number (2) 14D Translate IEEE 754 binary representation to decimal representation (B) -5.0

6 Problem 2 (30 points) - 1 Homework #2 – 5 Homework #3 – 3
Caller save register: the registers that the calling procedure (caller) is responsible for saving and restoring across the call. The called procedure (callee) can then modify the registers without constraint. Callee save register: the registers that the callee is responsible for saving and restoring if it might use. The caller uses the registers without worrying about restoring them after a call. (see slides)

7 Problem 2 (30 points) - 2 P + P = N; N + N = P; P – N = N;
N – P = P (see slides) i, j, temp, $fp, $ra

8 Problem 3 (10 points) Homework #3 – 1 (with slight change)
(a) unsigned INT (b) 2’s comp INT (c) IEEE 754 single precision FP -7.5

9 Problem 4 (15 points) - 1 Homework #3 - 6 fib(4) fib(3) fib(2) fib(2)

10 Problem 4 (15 points) - 2 sw $s0,4($sp) sw $s1,8($sp) sw $ra,0($sp)

11 Problem 5 (15 points) Homework #3 – 2


Download ppt "CPEG323 Quiz 1 Review Long Chen October, 26th, 2005."

Similar presentations


Ads by Google