What is the size of a memory address?

6

What size of a memory address?

I think a memory address has 32 bits, but I'm seeing in a debugger a int , where it separated 4 addresses for it.

So, is an address equivalent to 32 bits? Why did you separate 4 addresses and 32 bits already give 4 bytes?

    
asked by anonymous 18.03.2015 / 00:06

2 answers

4

The models differ from architecture to architecture, when you say you have a 32-bit memory address, the processor operates, and you have 32-bit instructions. Using the MIPS microprocessor architecture we have.

Thatis:

  • 6bitsforoperationcode
  • 26bitsforinstructions

Withintheinstructionswecanstilldivideintomorepartsdependingonthetypeofinstruction.Andwhenyoustartusingsimulatorsyouusuallydividethisinformationintomorepieces.Inyourcasethefollowingmaybehappening,youmayhaveusedanentireinputstringthinkingthatyouareonlypassingyourinteger,butyouaredoingafulloperation.

Example:ori$t1,$t2,0x4

Iwillnotgointodetail,butingeneralthestatementhasthefollowingformat.

This is due to the fact that most (not all) statements are sometimes made on top of the Hexadecimal number system.

What may be happening is that you may be confusing passing data to memory with passing an instruction.

So be sure to write only the data, not the complete statement. But there is a great possibility as commented in the other answer your simulator is dividing your word into bytes.

I would like to better specification, simulator, and assembly for which processor you are simulating.

    
18.03.2015 / 14:15
2

It's a little confusing. You need to learn and use the correct terms to know what you are talking about.

On a computer running 32-bit architecture, it will have a 32-bit address. Note that 64-bit computers can run in this addressing mode. With 32 bits you can access up to 4GB of memory which is 2 up to 32. When you do not need to access all the address space that the architecture allows you use only what is needed to save space since each address used, and many are used in a large application, takes up the amount of bytes of its size.

We often use the term "word size" to indicate the size of what you call memory address. The word is the size of the processor register. It is common for the word to be the same size as the register, but it is not required.

Each byte has 8 bits, so to represent a memory address would need 32 bits.

Usually an integer is usually the size of the processor word, so it is the size of the memory address.

If you say that you have separated into 4 addresses (the term seems to be wrong), it may have separated by 4 bytes . You may have separated by 4 bytes in hexadecimal format. If there really are 4 integer values, each with 4 byte, you need to find out what it is showing, there must be a reason, if is showing this.

But objectively, your question is answered: in 32-bit address space the address size is . As in 64-bit address space, it is 8 bytes in 16-bit address space is 2 bytes and in address space of 8 bits is 1 byte .

    
18.03.2015 / 12:54