html5-img
1 / 11

CPEG323 Quiz 1 Review

CPEG323 Quiz 1 Review. Long Chen October, 26 th , 2005. 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) 0x44332211 (see slides) What is Addressing mode?

rad
Télécharger la présentation

CPEG323 Quiz 1 Review

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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)0x44332211 (see slides) • What is Addressing mode? (C) It determinates where an operand in an instruction can be located and addressed (see slides)

  3. 5 16 18 16 5 bits 5 bits 16 bits 6 bits 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 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 = - 2-1-2-2 = -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 = .1000 0000 0000 0000 0000 000two, Exponent = 126ten = 0111 1110two (A) 1011 1111 0100 0000 0000 0000 0000 0000

  5. Problem 1 (30 points) - 4 • Compare signed and unsigned numbers (3) 1 and 0 • 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) 1100 0000 1111 0000 0000 0000 0000 0000 (a) unsigned INT 231+230+223+222+221+220 (b) 2’s comp INT -231+230+223+222+221+220 (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) fib(1) fib(1) fib(0) fib(1) fib(0)

  10. $s1 8($sp) $s0 4($sp) $ra $sp 0($sp) 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

More Related