BANK Memory Address Utility

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 Number ✓ Bank Offset ✓ Linear Address ✓ Interleaving ✓ Hex Addresses
MEM
Bank Address Mapping
● Ready
First address of the banked memory region.
Size of one bank in bytes for contiguous-bank mapping.
Used for range checking and interleaving.
Choose how consecutive addresses are assigned to memory banks.
Number of consecutive bytes assigned to one bank before moving to the next.
Address to decode into a bank number and bank-local offset.
Bank numbering begins at bank 0.
Byte offset measured relative to the selected bank.
Mapping rule: for contiguous banking, 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.
Memory Bank Address Result Calculated
Decoded Bank Address
Bank Number
Bank Offset
Absolute Address
Relative Address
Bank Size
Bank Base
Bank End
Mapping
Total Capacity
Bank Count
Word / Lane Offset
Address Width
Memory Bank Selection
Property Decimal Hexadecimal Calculation / Meaning
Calculation Breakdown

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 Base

The bank number and offset are then:

Bank Number = floor(Relative Address / Bank Size) Bank Offset = Relative Address mod Bank Size

Example: 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 Offset

For example:

Base = 0x00000000 Bank Size = 0x10000 Bank = 2 Offset = 0x3456 Address = 0x00000000 + (2 × 0x10000) + 0x3456 = 0x23456

What 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 Size

For 64 KiB banks starting at zero:

Bank 0 → 0x00000 Bank 1 → 0x10000 Bank 2 → 0x20000 Bank 3 → 0x30000

Bank 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 = 0x2FFFF

Total Banked Memory Capacity

If all banks are the same size, total capacity is:

Total Capacity = Number of Banks × Bank Size

For four 64 KiB banks:

4 × 64 KiB = 256 KiB

What 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 again

Interleaved 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 Banks

The 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 Word

This 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 Address

Contiguous 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 3

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

When hardware uses a bank-switching register, the CPU-visible address may stay the same while the physical memory bank changes. Consult the hardware memory map before treating a banked physical address as a direct CPU address.

Memory Bank Address Calculator FAQs

How do I calculate which memory bank contains an address?
For contiguous banks, subtract the memory base and divide the relative address by the bank size. The integer quotient is the bank number.
How do I calculate the offset within a memory bank?
For contiguous banks, calculate the relative address modulo the bank size.
How do I convert a bank and offset into an address?
Use Base + Bank × Bank Size + Offset for contiguous bank mapping.
What is bank 0?
Bank 0 is the first bank when zero-based bank numbering is used.
What is the bank offset?
It is the location of a byte relative to the beginning of its selected memory bank.
What is a contiguous memory bank?
A contiguous bank occupies one continuous range of addresses before the next bank begins.
What is memory interleaving?
Memory interleaving distributes consecutive words or blocks across multiple banks instead of storing them all sequentially in one bank.
How is an interleaved bank selected?
Divide the relative address by the interleave word size and take the resulting word number modulo the number of banks.
What is interleave word size?
It is the number of consecutive bytes assigned to one bank before addressing moves to the next bank.
Can the base address be nonzero?
Yes. The calculator first subtracts the configured memory-region base before performing bank calculations.
Can I enter hexadecimal addresses?
Yes. Hexadecimal, binary and unsigned decimal integer values are supported.
Can this calculator handle large addresses?
Yes. It uses BigInt address arithmetic rather than JavaScript floating-point integer calculations.
Does every computer use the same memory banking method?
No. Banking, interleaving and bank switching are architecture dependent. The selected model should match the target hardware documentation.

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.

Scroll to Top