Please print LEGIBLY 4003-345 Computer Organization Exam - RIT CS

Loading...

4003-345 Computer Organization NAME:

Exam 2

20052

Please print LEGIBLY

4003-345 Computer Organization Exam: 2 Section: UNKNOWN SECTION! Instructor: UNKNOWN INSTRUCTOR’S NAME!

INSTRUCTIONS: The exam is CLOSED book and notes. There are 0 questions, which are worth a total of 0 points. Write your answers in the space provided.

-1-

4003-345 Computer Organization

Exam 2

20052

MIPS instruction formats: R-type I-type J-type

op op op

Selected MIPS instructions: Instruction add sub addi mult div mfhi mflo and andi or ori xor xori sll srl load word store word load byte load byte unsigned store byte load halfword load halfword unsigned store halfword load upper immediate branch on equal branch on not equal branch on less than 0 branch on less or equal 0 branch on greater or equal 0 branch on greater than 0 set on less than set less than imm. jump jump register jump and link

rs rs

rt rt

Example add $s1,$s2,$s3 sub $s1,$s2,$s3 add $s1,$s2,100 mult $s1,$s2 div $s1,$s2 mfhi $s1 mflo $s1 and $s1,$s2,$s3 andi $s1,$s2,10 or $s1,$s2,$s3 ori $s1,$s2,10 xor $s1,$s2,$s3 xori $s1,$s2,10 sll $s1,$s2,10 srl $s1,$s2,10 lw $s1,100($s2) sw $s1,100($s2) lb $s1,100($s2) lbu $s1,100($s2) sb $s1,100($s2) lh $s1,100($s2) lhu $s1,100($s2) sh $s1,100($s2) lui $s1,0x123 beq $s1,$s2,25 bne $s1,$s2,25 bltz $s1,25 blez $s1,25 bgez $s1,25 bgtz $s1,25 slt $s1,$s2,$s3 slti $s1,$s2,100 j loc jr $ra jal loc

-2-

rd

shamt offset/immediate target address

func

Meaning $s1 = $s2 + $s3 $s1 = $s2 - $s3 $s1 = $s2 + 100 HI, LO = $s1 x $s2 HI = $s1 mod $s2, LO = $s1 div $s2 $s1 = HI $s1 = LO $s1 = $s2 & $s3 $s1 = $s2 & 10 $s1 = $s2 | $s3 $s1 = $s2 | 10 $s1 = $s2 xor $s3 $s1 = $s2 xor 10 $s1 = $s2 << 10 bits $s1 = $s2 >> 10 bits $s1 = Memory[$s2 + 100] Memory[$s2 + 100] = $s1 $s1 = Memory[$s2 + 100] (sign-extended) $s1 = Memory[$s2 + 100] (zero-extended) Memory[$s2 + 100] = $s1 $s1 = Memory[$s2 + 100] (sign-extended) $s1 = Memory[$s2 + 100] (zero-extended) Memory[$s2 + 100] = $s1 $s1 = 0x01230000 if( $s1 == $s2 ) go to PC + 4 + 100 if( $s1 != $s2 ) go to PC + 4 + 100 if( $s1 < 0 ) go to PC + 4 + 100 if( $s1 <= 0 ) go to PC + 4 + 100 if( $s1 >= 0 ) go to PC + 4 + 100 if( $s1 > 0 ) go to PC + 4 + 100 if( $s2 < $s3 ) $s1 = 1 else $s1 = 0 if( $s2 < 100 ) $s1 = 1 else $s1 = 0 go to loc go to $ra $ra = PC + 4; go to loc

4003-345 Computer Organization

Exam 2

20052

Selected MIPS pseudo-instructions: Pseudo-Instruction load word load halfword load byte load halfword unsigned load byte unsigned store word store halfword store byte load address load immediate move multiply divide remainder not

Example lw $t1,foo lh $t1,foo lb $t1,foo lhu $t1,foo lbu $t1,foo sw $s1,foo sh $s1,foo sb $s1,foo la $t1,foo li $t1,10 move $t2,$t3 mul $t0,$t1,$t2 div $t0,$t1,$t2 rem $t0,$t1,$t2 not $t1,$t2

Meaning $t1 = Mem[addr. of "foo"] $t1 = Mem[addr. of "foo"] (sign-extended) $t1 = Mem[addr. of "foo"] (sign-extended) $t1 = Mem[addr. of "foo"] (zero-extended) $t1 = Mem[addr. of "foo"] (zero-extended) Mem[addr. of "foo"] = $s1 Mem[addr. of "foo"] = $s1 Mem[addr. of "foo"] = $s1 $t1 = addr. of "foo" $t1 = 10 $t2 = $t3 $t0 = $t1 x $t2 (lower 32 bits) $t0 = $t1 div $t2 (quotient) $t0 = $t1 mod $t2 (remainder) $t1 = ! $t2

MIPS Registers: Reg. # 0 1 2, 3 4-7 8-15 16-23 24, 25 26, 27 28 29 30 31

Name zero at v0 v1 a0-a3 t0-t7 s0-s7 t8 t9 k0 k1 gp sp fp ra

Notes always contains 0 reserved for assembler expression evaluation and function results arguments passed to procedures and functions temporary storage - can be overwritten by called routines variable storage - must be saved by called routines temporary storage reserved for OS use global area pointer stack pointer frame pointer return address register

-3-

4003-345 Computer Organization

Exam 2

20052

Here are the Boolean identities and other useful theorems: #

Identity

#

1. 3. 5. 7. 9. 10. 12. 14. 16.

X +0=X X +1=1 X +X =X X +X =1 X =X X +Y =Y +X X + (Y + Z ) = (X + Y ) + Z X .(Y + Z ) = X .Y + X .Z (X + Y ) = X .Y

18. 19.

X + XY = X + Y XY + XZ + YZ = XY + XZ

2. 4. 6. 8. 11. 13. 15. 17.

Identity

Common Name

X .1 = X X .0 = 0 X .X = X X .X = 0 X .Y = Y .X X .(Y .Z ) = (X .Y ).Z X + Y .Z = (X + Y ).(X + Z ) X .Y = X + Y

Commutative Associative Distributive DeMorgan Concensus

Powers of 2: Value 1 2 4 8 16 32 64 128

Exponent 0 1 2 3 4 5 6 7

Value 256 512 1024 2048 4096 8192 16384 32768

Exponent 8 9 10 11 12 13 14 15

Value .5 .25 .125 .0625 .03125 .015625 .0078125 .00390625

Exponent -1 -2 -3 -4 -5 -6 -7 -8

Here is the ASCII character set, with encodings shown in hex: Hex 00 08 10 18 20 28 30 38 40 48 50 58 60 68 70 78

Char nul bs dle can sp ( 0 8 @ H P X ‘ h p x

Hex 01 09 11 19 21 29 31 39 41 49 51 59 61 69 71 79

Char soh ht dc1 em ! ) 1 9 A I Q Y a i q y

Hex 02 0a 12 1a 22 2a 32 3a 42 4a 52 5a 62 6a 72 7a

Char stx nl dc2 sub " * 2 : B J R Z b j r z

Hex 03 0b 13 1b 23 2b 33 3b 43 4b 53 5b 63 6b 73 7b

Char etx vt dc3 esc # + 3 ; C K S [ c k s {

-4-

Hex 04 0c 14 1c 24 2c 34 3c 44 4c 54 5c 64 6c 74 7c

Char eot np dc4 fs , 4 < D L T \ d l t |

Hex 05 0d 15 1d 25 2d 35 3d 45 4d 55 5d 65 6d 75 7d

Char enq cr nak gs % 5 = E M U ] e m u }

Hex 06 0e 16 1e 26 2e 36 3e 46 4e 56 5e 66 6e 76 7e

Char ack so syn rs & . 6 > F N V ^ f n v ~

Hex 07 0f 17 1f 27 2f 37 3f 47 4f 57 5f 67 6f 77 7f

Char bel si etb us ’ / 7 ? G O W _ g o w del

Loading...

Please print LEGIBLY 4003-345 Computer Organization Exam - RIT CS

4003-345 Computer Organization NAME: Exam 2 20052 Please print LEGIBLY 4003-345 Computer Organization Exam: 2 Section: UNKNOWN SECTION! Instructor...

29KB Sizes 0 Downloads 0 Views

Recommend Documents

Dr. Ivona Bezáková | Computer Science - RIT CS department
Ivona Bezáková is an Assistant Professor in the Department of Computer Science at the Rochester Institute of Technolog

CS 408 - Computer Networks
Computer Networking with Internet Protocols and Technologies, William Stallings, ISBN: 0-13-141098-9. Reference: Compute

B.Tech Syllabus-Computer Science & Engineering Download - RIT
M.Morris Mano- Computer System Architecture- PHI- Third Edition-2006. 2. M.Morris Mano – Digital Logic ... Application

CS 351 - UNM Computer Science
Feb 2, 2017 - Conway's Game of Life - Rules. ▫ Finite two-dimensional grid of square cells. ▫ Each cell is in one of

CS2600 - Computer Organization - cse.iitm
Introduction: Function and structure of a computer, Functional components of a computer, Interconnection of components,

Computer Organization I
Jan 6, 2017 - [Course Home] [Syllabus] [Announcements] [Calendar] [Solutions]. CDA3100 - Computer Organization I. Spring

Computer Organization (E1327)
Jan 15, 2015 - For the register values shown above, what is the value of $t0, $t1 and $t2 for the following sequence of

CS 3251 Computer Networking - WordPress.com
include wireless and mobile networks, queuing fundamentals, security, and network management. Prerequisite: CS 2200 (min

Computer Organization & Design.pdf - Biomisa
sll $t2, $t0, 44 or $t2, $t2, $t1. 2.19.2 [5] For the register values shown above, what is the value of $t2 for the fol

Elkhound: A Fast, Practical GLR Parser Generator - [email protected]
Second, we describe a design for an action interface and a new ... parser generator. ... Existing GLR parsers build a pa