Quiz_sol5 - 1 ECE 445 — Computer Organization"its...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1. ECE 445 — Computer Organization "its; ‘ t“ a G#: _ Lia Quiz #5 LL : Wednesday, October 7, 2009 Closed book, closed notes. Time limit of 30 minutes. Please remember that you are held accountable to the GMU Honor Code. Given below is part of the MIPS Assembly Language code required to implement the String Copy function in C. Cornplete the code. Assume that you are copying character array A into character array B (i.e. B = A), and that the base address of character array A is passed to the function in $210 and the base address of character array B is passed to the function in $a1. Remember, a C-style string is terminated by a NUL character; i.e. the last character in the character array has an ASCII value of zero (0). Note: there is exactly one blank tine for each instruction that is missing. strcpy: addi $sp, $sp, —4 sw $30, 0($sp) Iadd $30, $zero, $zero L11 in f 3-0} tie. a m, o «1: \ft __ I M3, hat r ,i ‘0 til, 4‘ r :: ‘3 J t?“ ‘50 , 3 _ _ I i J: Li _ L2: 1w $30, O($spfl)fi_ W addi $sp, $sp, 4 jr $ra page 1 of 3 _,. ,- ’1: “5‘44 ECE 445 — Computer Organization 2. Given below is the datapath for the Single-Cycle implementation of the MIPS Architecture. PC I Read address Instruction [314)] Instruction memory / : l FteQDst -' '- Branch I'f 1, Memfiead 'MWU“ [31—25] E Memto‘r'tet; Control? ALUO li I' MemWrite _‘ ‘ ALUSrc | \ HeWrile \~_. Instruction [25—21] Read registert Head Instruction [20—16] Head data 1 registera we Adm-stat: Insmictton [15—11] register dataz Write Idata Registers Instruction {15—0} data memory Write Dam The major components in the datapath above include: Instruction Memory, Data Memory, Register File, ALU, Sign Extension, Left Shift, Adder, and Program Counter (PC) .1,“ __ a; 1'}- t E.) k 9.,-.- ‘u y'x‘w MUN“ i d .( ‘ t x 1 . ' '. . c _ w - / fa L!‘ y'iu‘j/trd Vtv-t \. ‘fLVL' “Ht ‘1} r 5 -' "-,_ , I 4 w woven» ww k at: agate-x “’ page 2 of 3 334-5;- - u . (a) Identify the major components of the datapath required to carry out an Instruction Fetch. ECE 445 — Computer Organization (1)) Identify the major components of the datapath required to carry out the execution of following instructions. Assume that the instruction has already been fetched from the Instruction Memory and that the PC has already been incremented. {‘1’} (i) add $s0,$t0,$tl ‘” “‘ - . a r L \ - ,I .r’ ’. by .~ '1" “5‘- ~13: '-;.-:£"»~'4”1 3’ {Mfkts'ml i:th \ if" 5”” “M a" W 1 pin? ALL; 4'? .. . Us} (11) addl $51, $t1, 128 'i’ g l" r, _ _ .=' I -' In L. _.._-, E”; 'mlswi iris/é k w war-mm / ta“ 3 {Sr LL? Sl/EJ ZXTEMSLOIJ {If} (iii) 1w $t2, 16($s3) [/dL? {‘btfiquSE-EYL ngb Mic-f“;de 4-H \ . A . ‘_ 4 turf—(Lari: ; ‘ r t; I.” fly {_ 1'33“ Screw-“ i'w/u’v-Wh‘g‘ “new r .. ,, . ._ .M i - ' ‘ V U - \ XX £3 LL31"; ‘5'“; '3 U‘Ji‘) “:- Jays/fie“ {bun—«K -; (iv) sw $t3,28($t2) 1191 l, alas-“C1619!!— t’rtw <---——~—.~. __ _ ’: (SW,ng r; R'LU = flJx’MLCK "u—ryfl W! - H l . i x- r/ f; .o - ' {qu- __I, {Liv gt d .~J i) Rat—T m. ~ (twist-'er < firm 5 ’\ \. -- I ‘ {fl '2 I 91,1 ,( hawhwmt ;“_:_;;r,n,t.;rw page 3 of 3 ...
View Full Document

{[ snackBarMessage ]}

Page1 / 3

Quiz_sol5 - 1 ECE 445 — Computer Organization"its...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online