Address Width and Addressable Positions
Calculate the number of addressable positions from the address width and the storage unit per position.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 4
- Reading time
- 1 min
In this article4 chapters
An address of width \(w\) bits provides at most \(2^w\) distinct address patterns.
Use a tiny capacity
With eight address bits, there are 256 patterns from 0 to 255. If positions each address one byte, that is 256 bytes of addressable positions. Unsigned fields supply the possible code range.
Account for the addressed unit
If each address selects a two-byte word, the same address count instead names 512 bytes of word storage. Real systems can reserve addresses or omit devices. Compare byte addresses before converting a field width to capacity.[1]
Calculate the number of positions and their units
Ten address bits select 1024 distinct positions numbered from zero through 1023. With byte-addressable memory this covers 1024 bytes. If each address instead designates a sixteen-bit word, the same number of positions holds 2048 bytes. See unsigned range by width.
Address bits: 10
Addressable positions: 2^10 = 1024
Last position: 1023
Bytes represented depend on the addressing unit
Check mapped capacity separately from address encoding
An address space can reserve positions for devices or leave some unused. Available memory can therefore be less than the number of representable positions. Test the highest valid mapped position and the first unmapped one.