search
Log In
3 votes
825 views
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
in CO and Architecture 825 views
0
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 ?
2

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$

0
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 :)
1

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 $

0
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 :)
2

@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.

1
Oh thanku so much Soumya that was really important thing you corrected in me. Thanx a lot :)

2 Answers

3 votes
 
Best answer

Given answer is right.


selected by
0
How that op and reg are 8 and 6
0
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
256 KB is the answer.

Related questions

10 votes
3 answers
1
7.3k views
A computer uses expanding opcode. It has 16 bit instructions 6 bit addresses, it supports one address, two address instructions only. If there are n two address instructions, the maximum number of one address instructions are?
asked Sep 9, 2015 in CO and Architecture Tehreem 7.3k views
1 vote
0 answers
2
694 views
Q.A stack based CPU executes the instruction.Memory location 500 contains 0x88 and memory location 700 contains 0x37.The stack pointer is at 0x003F. The instructions are as follows: I1:PUSH 500 I2:PUSH 700 I3:ADD I4:POP 600 I5:PUSH 300 Which of the ... )Memory location 0x40 contain 0x88 after execution instructions c)Memory location 600 contains 0xBF after execution instructions d)Both (a) and (c)
asked Jan 20, 2019 in CO and Architecture Badayayash 694 views
2 votes
1 answer
4
1.8k views
Assume that RISC processor contains 10 global registers, 10 local registers, 6 In registers and 6 Out register. It contain 4 register windows. What is the size of window and register file of the processor? Ans. 32 and 74 Please Explain the Formula and what's the meaning of Window size and register file in RISC Processor ?
asked Jul 27, 2018 in CO and Architecture Na462 1.8k views
...