


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



4 problems, 4 pages Exam Three Solutions 1 December 201 0 Problem 1 ( 2 parts, 18 points) Datapath Elements Part A (9 points) Consider the following input and output values for a shift operation. Determine the shift type and amount required to achieve the listed transformation. I/Os are in hexadecimal. Input Value Output Value Shift Type Shift Amount (signed decimal value) 87654321 FFF87654 (^) arithmetic + (^87654321 00000008) logical + (^87654321 43218765) rotate 16 Part B (9 points) Consider the following input and output values for a logical operation. Determine the logical function and function code (in hexadecimal) required for the operation. X Input Y Input Output Logical Function Function Code 87654321 00FF00FF (^00650021) AND 8 87654321 00FF00FF 8 79A43DE (^) XOR 6 87654321 00FF00FF 789ABCDE (^) X 5 Problem 2 (3 parts, 3 2 points) Memory Systems Part A (1 2 points) Consider a DRAM chip organized as 64 million addresses of 16 bit words. Assume both the DRAM cell and the DRAM chip is square. The column number and offset concatenate to form the memory address. Using the organization approach discussed in class, answer the following questions about the chip. Express all answers in decimal. number of columns (^) 64Mx16=1G; sqrt(2^30) = 2^15 = 32K column decoder required ( n to m ) (^15) to 32 K type of mux required ( n to m ) 32K/16 = 2K to 1 number of muxes required (^16) number of address lines in column number (^15) number of address lines in column offset 11 Part B (10 points) Consider a 4 Gbyte memory system with 512 million addresses of 8 byte words using DRAM chips organized as 64 million addresses by 16 bit words. word address lines for memory system (^) log 2 (512M) = 29 chips needed in one bank (^) 8 bytes * 8 bits/byte / 16 bits = 4 banks for memory system 512M / 64M = 8 memory decoder required ( n to m ) (^) 3 to 8 DRAM chips required (^) 4 chips / bank x 8 banks = 32 chips
4 problems, 4 pages Exam Three Solutions 1 December 201 0 Part C (10 points) Design a 32 M address x 12 bit memory system with six 16 M address x 4 bit memory chips. Label all busses and indicate bit width. Assume R/W is connected and not shown here. Use a decoder if necessary. Place a star on the chip(s) that contain address 26,000,000. ADDR MSEL 16M x 4 D D D D ADDR CS 16M x 4 D D D D ADDR CS 16M x 4 D D D D ADDR CS 16M x 4 D D D D ADDR CS 16M x 4 D D D D ADDR CS 16M x 4 D D D D ADDR CS D D D D D D D D D D D D 25 24 24 24 24 24 24 1 to 2 decoder A23: A S EN O O
4 problems, 4 pages Exam Three Solutions 1 December 201 0 Problem 4 (1 part, 25 points) Assembly Programming Part A (25 points) Complete this subroutine that averages an array of integers in memory. Assume $4 contains the number of integers and $5 contains the starting address of the array. Return the average in $7. Use the $8 for the input value, $7 for the sum, and $6 for the end test. label instruction comment AvgN: sll $6, $4, 2 # offset = 4 * # elems add $6, $6, $5 # end = base + offset lw $7, 0($5) # load 1st element addi $5, $5, 4 # point to 2nd element Loop: lw $8, 0($5) # load next element add $7, $7, $8 # add to sum addi $5, $5, 4 # point to next element bne $5, $6, Loop # loop until end div $7, $4 # compute average mflo $7 # put average in $ jr $31 # return to caller