Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

number 4 and 5 specifically Name Midterm CS300 Spring 2018 6 questio #1 . Answer

ID: 3728354 • Letter: N

Question

number 4 and 5 specifically

Name Midterm CS300 Spring 2018 6 questio #1 . Answer Chapter #4 Questions 1 to 41 Odd numbered. #2-Answer Chapter #6 Questions 2 to 38 Even numbered #3-Answer Chapter #7 Questions 2 to 48 Even numbered #4-A digital computer has a memory unit with 40 bits per word. The instruction set consists of 312 different operations. All instructions have an opcode and two address fields: one for a memory address and one for a register address. This system includes 32 registers. a) How many bits are needed for the opcode? b) How many bits are needed to specify the register? c) How many bits are left for the memory address part of the instruction? d) What is the maximum allowable size for memory? e) What is the largest unsigned binary number that can be accommodated in one word of memory? #5-A 2-way set associative cache consists of 4 sets. Main memory contains 16K blocks of 8 bytes each and byte addressing is used. a) Show the main memory address format that allows us to map addresses from main memory to cache. Be sure to include the fields as well as their sizes. b) Compute percentage of the hit ratio for a program that loops 3 times from addresses 0X0 to 0X25(Hex) in main memory 6-Do item #9 ofyour project: reate 500 additional register and I/O instructions for your Show all works, have a nice spring recess.

Explanation / Answer

If you have any problems with the answer or want me to edit the answer, just let me know in the comments and I will try to get on to it as soon as possible. Do give a positive rating if you think this answer helped.

We are required to do only 4 parts of a question

4.

a. Since there are 312 instructions so 2^9 = 512 would be enough to store

these as 2^8 = 256 which is less than 312 so, 9 bits are required for the

opcode.

b. Since the system includes 32 registers so 5 bits are required to specify

the register. As 2^5 = 32.

c. Bits for memory address part = 40-9-5 = 26bits

d. Maximum allowable size for memory is 2^26 = 67108864

e. largest unsigned binary number that can be accomodated within one word

of memory is (2^40-1).

5. A.

16K blocks means = 2^4*2^10 = 2^14

8 Bytes each = 2^3 so total number of bytes = 2^17

  

hence,

address size = 17 bits

Since we have four sets so 2 bits required for sets and memory map be like

|```````````````````|``````````````````|``````````````````|

| 12 bits(tag) |(block/set) 2bits | offset (3 bits) |

|...................|..................|..................|