4 votes 4 votes A computer has 170 different operations. Word size is 4 bytes one word instructions requires two address fields. One address for register and one address for memory. If there are 37 registers then the memory size is ______________(in KB). Ans. 256KB CO and Architecture co-and-architecture addressing-modes machine-instruction + – Na462 asked Jul 31, 2018 Na462 2.1k views answer comment Share Follow See all 8 Comments See all 8 8 Comments reply Na462 commented Jul 31, 2018 reply Follow Share My answer :- Instruction:- Opcode , Register , Memory Opcode bits = 8 bit Register = 6 bit So Memory = 32-8-6 = 18 Bits So size of Memory :- 2^18 * 4 Byte (Because every word is of 4B) Hence Size of Memory = 1024 KB Please tell where i am wrong ? 0 votes 0 votes Soumya29 commented Aug 1, 2018 reply Follow Share So size of Memory :- 2^18 * 4 Byte (Because every word is of 4B) This is not correct. Why you are multiplying by 4 when you have already converted 4 bytes to 32 bits above. Memory size will be $2^{18} = 256 KB$ 2 votes 2 votes Na462 commented Aug 1, 2018 reply Follow Share Here a word is divided into 3 fields right, a word is of 32 bit the remaining bits represent the memory word i.e. 18 bits, so total 2^18 words are there, but i should also multiply with 4 n.a. because a word is comprised of 4 bytes. Please clear my doubt :) 0 votes 0 votes Soumya29 commented Aug 1, 2018 reply Follow Share No No.. The remaining bits represent the memory word i.e. 18 bits, so total $2^{18}$ words are there, Where is it written that memory is word addressable so you are giving these addresses to words? Always consider byte addressability unless otherwise specified. So each byte will take a different address. A memory address is of 18 bits. So with these 18 bits $2^{18}$ different addresses are possible and each of which is given to a different Byte of memory so memory size is $256 KB $ 1 votes 1 votes Na462 commented Aug 1, 2018 reply Follow Share I know that, but when I say memory is of k bits it means that total 2^k words are present and by default every word is of 1 bytes so total 2^k bytes are there,with address given to every byte. Say I have memory of k bits and every word is of 4Byte. Then can't I say total words are 2^k and each word is of 4 Byte. While giving address to each byte the total bytes would be 2^(k+2). Please correct me @ Soumya if I am wrong somewhere :) 0 votes 0 votes Soumya29 commented Aug 1, 2018 i edited by Soumya29 Aug 1, 2018 reply Follow Share @Na462(I don't know your real name) :) when I say memory is of k bits it means that total 2^k words are present and by default every word is of 1 bytes so total 2^k bytes are there,with address given to every byte. There is nothing like that. By default, we consider memory is Byte Addressable. So when you say memory address is of k bits, it means $2^k$ bytes are there. And if say word size is 4 byte then $\frac{2^k}{4}=2^{k-2} \ words$ are there. But if it is given in the question that memory is word addressable then only you can say that memory address is of k bits, it means $2^k$ words are there. And if say word size is 4 byte then $2^k*4=2^{k+2} \ bytes$ are there. 2 votes 2 votes Na462 commented Aug 1, 2018 reply Follow Share Oh thanku so much Soumya that was really important thing you corrected in me. Thanx a lot :) 1 votes 1 votes Deepak Poonia commented Nov 14, 2023 reply Follow Share It is common to have byte addressability, and access words. A word address is defined to be the smallest byte address of the bytes within that word. https://pages.cs.wisc.edu/~markhill/cs354/Fall2008/notes/addressibility.html 0 votes 0 votes Please log in or register to add a comment.
Best answer 3 votes 3 votes Given answer is right. abhishekmehta4u answered Aug 1, 2018 selected Dec 20, 2018 by Mk Utkarsh abhishekmehta4u comment Share Follow See all 2 Comments See all 2 2 Comments reply Diksha Kiran 1 commented Aug 30, 2018 reply Follow Share How that op and reg are 8 and 6 0 votes 0 votes suneetha commented Oct 1, 2018 reply Follow Share opcode represent the what type of operation which it is and it is given that there are 170 instructions so to represent 170 instructions we need 8 bits. there are 37 registers to represent those registers we need 6 bits . 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes 256 KB is the answer. eshita1997 answered Jan 13, 2021 eshita1997 comment Share Follow See all 0 reply Please log in or register to add a comment.