Memory Bank Address Calculator
Convert linear memory addresses into bank numbers and offsets, or rebuild an absolute address from a bank and bank-local offset. Supports contiguous banking and word-interleaved memory layouts with hexadecimal, binary and decimal addresses.
Bank = floor((Address − Base) / BankSize) and
Offset = (Address − Base) mod BankSize. For word interleaving,
whole words are distributed bank 0, bank 1, bank 2 and so on before cycling
back to bank 0.
| Property | Decimal | Hexadecimal | Calculation / Meaning |
|---|
—
What Is a Memory Bank Address Calculator?
A Memory Bank Address Calculator determines which memory bank contains a particular address and calculates the offset of that address within the bank. It can also perform the reverse operation by converting a bank number and bank-local offset into an absolute memory address.
Bank addressing is commonly encountered in embedded systems, retro computers, microcontrollers, graphics memory, SRAM and DRAM arrangements, FPGA designs and systems where the available address space is divided into multiple memory regions.
Contiguous Memory Bank Formula
When banks are placed sequentially in the address space, the relative address is first calculated from the memory-region base.
Relative Address
= Address - Memory BaseThe bank number and offset are then:
Bank Number
= floor(Relative Address / Bank Size)
Bank Offset
= Relative Address mod Bank SizeExample: 64 KiB Memory Banks
Suppose a system contains four 64 KiB banks starting at address zero.
Bank Size:
64 KiB
= 65536 bytes
= 0x10000
Address:
0x23456
Bank:
floor(0x23456 / 0x10000)
= 2
Bank Offset:
0x23456 mod 0x10000
= 0x3456
Therefore address 0x23456 is located in bank 2 at offset
0x3456.
Calculate an Address from Bank and Offset
For contiguous banks, the reverse calculation is:
Address
= Memory Base
+ (Bank Number × Bank Size)
+ Bank OffsetFor example:
Base = 0x00000000
Bank Size = 0x10000
Bank = 2
Offset = 0x3456
Address
= 0x00000000
+ (2 × 0x10000)
+ 0x3456
= 0x23456What Is a Memory Bank?
A memory bank is a separately addressable or selectable portion of memory. Depending on the hardware, banks may represent physical memory chips, internal arrays, DRAM banks, external memory regions or logical windows exposed through bank-selection registers.
The exact hardware meaning of a bank therefore depends on the processor and memory architecture.
Bank Base Address
For contiguous banking, each bank begins at:
Bank Base
= Memory Base
+ Bank Number × Bank SizeFor 64 KiB banks starting at zero:
Bank 0 → 0x00000
Bank 1 → 0x10000
Bank 2 → 0x20000
Bank 3 → 0x30000Bank End Address
The final byte belonging to a contiguous bank is:
Bank End
= Bank Base + Bank Size - 1
A 64 KiB bank beginning at 0x20000 therefore ends at:
0x20000 + 0x10000 - 1
= 0x2FFFFTotal Banked Memory Capacity
If all banks are the same size, total capacity is:
Total Capacity
= Number of Banks × Bank SizeFor four 64 KiB banks:
4 × 64 KiB
= 256 KiBWhat Is Interleaved Memory Banking?
Interleaving distributes consecutive words across multiple banks rather than placing one complete bank after another. This can permit multiple banks to participate in sequential memory accesses.
4 banks
4-byte interleave word:
Address 0x00–0x03 → Bank 0
Address 0x04–0x07 → Bank 1
Address 0x08–0x0B → Bank 2
Address 0x0C–0x0F → Bank 3
Address 0x10–0x13 → Bank 0 againInterleaved Bank Number Formula
First determine the word number relative to the memory base:
Word Number
= floor(Relative Address / Word Size)Then:
Bank
= Word Number mod Number of BanksThe byte position within the interleave word remains part of the bank-local address.
Interleaved Bank Offset Formula
Word Number
= floor(Relative Address / Word Size)
Bank Row
= floor(Word Number / Bank Count)
Byte Within Word
= Relative Address mod Word Size
Bank Offset
= Bank Row × Word Size
+ Byte Within WordThis gives a logical byte offset inside the selected interleaved bank.
Interleaved Address from Bank and Offset
For the reverse calculation, split the bank-local offset into a word row and byte position:
Bank Row
= floor(Bank Offset / Word Size)
Byte Within Word
= Bank Offset mod Word Size
Global Word Number
= Bank Row × Bank Count + Bank
Relative Address
= Global Word Number × Word Size
+ Byte Within Word
Address
= Base + Relative AddressContiguous vs Interleaved Memory
| Feature | Contiguous Banks | Interleaved Banks |
|---|---|---|
| Address grouping | Complete bank ranges | Words alternate between banks |
| Bank calculation | Relative ÷ Bank Size | Word Number mod Bank Count |
| Typical use | Banked address spaces | Parallel memory organization |
| Bank offset | Relative mod Bank Size | Row + byte-in-word |
Bank Numbering
This calculator uses zero-based bank numbering:
First bank = Bank 0
Second bank = Bank 1
Third bank = Bank 2
Fourth bank = Bank 3Some hardware manuals label banks differently, so always verify the numbering used by the target device.
Bank Size and Address Bits
If a bank size is an exact power of two, its internal offset can often be identified directly from the lower address bits.
64 KiB Bank
64 KiB
= 65536 bytes
= 2^16
Therefore:
16 bits are required for
the byte offset inside the bank.Common Memory Bank Sizes
| Bank Size | Bytes | Hex Size |
|---|---|---|
| 16 KiB | 16,384 | 0x4000 |
| 32 KiB | 32,768 | 0x8000 |
| 64 KiB | 65,536 | 0x10000 |
| 128 KiB | 131,072 | 0x20000 |
| 1 MiB | 1,048,576 | 0x100000 |
Banked Memory vs Bank Switching
Banked memory and bank switching are related but not identical concepts. This calculator works with mathematical bank mappings. Some processors expose only one bank through a fixed CPU address window at a time and require a register to select which physical bank is visible.
Memory Bank Address Calculator FAQs
How do I calculate which memory bank contains an address?
How do I calculate the offset within a memory bank?
How do I convert a bank and offset into an address?
What is bank 0?
What is the bank offset?
What is a contiguous memory bank?
What is memory interleaving?
How is an interleaved bank selected?
What is interleave word size?
Can the base address be nonzero?
Can I enter hexadecimal addresses?
Can this calculator handle large addresses?
Does every computer use the same memory banking method?
Calculate Memory Banks and Offsets
Convert addresses to banks and bank-local offsets, rebuild absolute addresses, and inspect contiguous or interleaved memory mappings using exact integer address arithmetic.