# How to Calculate a Memory Address

Save

A computer memory address is a hexadecimal or binary address that a computer uses when storing data. Whenever a piece of information is stored, the computer has to calculate where to store the data in memory based off of a segment and offset address from the hard drive. Calculating the memory address from these segment and offset addresses can be tricky and requires advanced computing and mathematical knowledge, but is crucial for a programmer to know how to do so.

### Things You'll Need

• 16-bit segment and offset addresses
• Take your 16-bit segment and offset addresses and break them into pairs. For example, if the two addresses you are dealing with are "0000:0100," you can translate them into 20-bit segment and offset addresses by breaking them in half at the colon so they become "0000" for the 20-bit segment address and "0100" for the 20-bit offset address.

• Convert the hexadecimal 20-bit physical address into binary format by breaking each of the hexadecimal digits into its own binary form. In the "00100" example, you break them down into "0000," "0000," "0001," "0000," and "0000" to get the string "0000 0000 0001 0000 0000" as the final binary memory address.

## References

• Photo Credit Siri Stafford/Digital Vision/Getty Images
Promoted By Zergnet