HW4 - ECE 2%3%-C Home5ork Assignment ;< Assigned:...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECE 2%3%-C Home5ork Assignment ;< Assigned: Nov 23, 2%%2 1. (20%) (D ata D irectives) Fall Semester, 2%%2 Due: Nov 3%, 2%%2 C 2:%Dpm 1.1 Answer the follow ing questions w ith respect to the d ata d irectives g iven below. Th e data segment star ts at address 0x1001000. The ascii valu e for ‘A’ starts at 0x41. Th e ascii value for ‘ a’ star ts at 0x61. NU L = 0x00. .data .space 7 .asciiz “Ece” .align 4 .word 11 .word 12 .align 2 .word 13 label0: label1: label2: label3: How many by tes of storage are requir ed? What is th e value stored at the memory location associated w ith lab el1 if u sing little end ian format? What is th e value stored at the memory location associated w ith lab el2 if u sing b ig end ian format? What is th e address of th e word con taining the valu e 12? What is th e address of th e word con taining the char acter ‘c’? 1.2 Assume the data segmen t star ts at address 0x10010010. Write the data directives asso ciated w ith storing string ‘Star t’ at address 0x10010010, byte 0x33 at address 0x10010100, and word 0x33 at address 0x10010110. 2. (20%) (Memory) Consider th at you have available 1M x 4 memory ch ips (as shown below) and w ish to design a A) 1Mx8 memory system, a B) 2M x 4 memory system, and a C) 2M x 8 Memory System. For each design, deter min e 1) What is the number of bits r equired for th e address? 2) How many chips ar e n eeded ? and 3) Draw a co mplete design using th e 1 M x 4 memory chip as a bu ild ing block. 3. (20%) (Data paths) Using the supplied datap ath, write a micro code fragment to acco mplish th e following expression. Express all values in hexadecimal notation. Use ‘X’ when a value is don’t car e. Th e ∩ symbol represen ts logical AND . The ∪ symbol represen ts logical O R. # mem[100] & R1 = % " R2 ( + ( R3 ) 4 ) $ 256 ' ! 4. (20 points) ( Microcode and ISA) Write a microcode fragment that imp lements the fo llow ing MIPS assemb ly language program fr agmen t: lw $2, ($1) andi $6, $2, 0xF sr l $ 2 , $ 2 , 4 su b $ 6 , $ 2 , $ 6 sw $ 6 , ( $ 3 ) 5. (20 points) (ISA and Bran ches) Consider the follow ing MIPS program fragment and memory frag men t star ting at address 300. A) How many words of data are read in by the program fr agmen t? How many times is th e add instruction at address 1024 executed? What values ar e in registers $1, $2, $3, $4, and $5 at the end of the program fragment? What is the br anch offset ( in bytes) of the bne instruction at address 1032? .word n10 .byte n10 .asciiz “string ” ascii “str ing” .space n10, .align k Data D irectives Store the value n10 in memory as a 32 bit word b inary value Store the value n10 in memory as a byte value (8 bits) Store the ASCII string in memory w ith a null ch aracter Store the ASCII string in memory Skip th e nex t n bytes Force loader to go to n ext 2k byte boundary ...
View Full Document

This note was uploaded on 11/24/2009 for the course ENGINEERIN 4283 taught by Professor Smith during the Spring '09 term at American InterContinental University Dunwoody.

Ask a homework question - tutors are online