ROM Addressing for 4096 Bytes: Chip Count, Address Lines, and Common Addresses
To answer the questions, we rely on standard memory organization relationships:
- Address line count determines how many distinct locations a memory can address: locations for address lines.
- ROM organization relates capacity (in bytes) to addressable locations and word size.
- When multiple ROM chips are used to reach a larger total capacity, the chips typically share the same Address bus for the portion of the address that selects a location within each chip; the overall selection is done using Chip select.
We’ll assume the usual classroom-style premise for this type of problem: each ROM chip has a fixed capacity of 1024 bytes (i.e., bytes). Then producing 4096 bytes requires a straightforward scaling by powers of two.
Footnotes
-
"Address lines — Wikipedia" https://en.wikipedia.org/wiki/Address_lines - Explains that addresses correspond to address lines. ↩
-
"Memory organization — Wikipedia" https://en.wikipedia.org/wiki/Memory_addressing - Covers relationships between memory capacity, addressing, and addressable units (bytes/words) and how address selection works. ↩
-
"Chip select — Wikipedia" https://en.wikipedia.org/wiki/Chip_select - Describes chip-select control enabling devices in memory systems and typical decoding behavior. ↩
Memory Addressing: Address Lines and Capacity (Binary Basics)
Key formula set
-
Total addressable locations:
-
If each address corresponds to 1 byte (byte-addressable memory), then:
This is the common assumption for problems phrased “bytes” with “address lines.”
-
If each ROM chip holds bytes, and you need bytes, then the number of chips is:
(assuming chips are used in a capacity-extension arrangement with decoding).
Footnotes
-
"Address lines — Wikipedia" https://en.wikipedia.org/wiki/Address_lines - Explains that addresses correspond to address lines. ↩
-
"Memory organization — Wikipedia" https://en.wikipedia.org/wiki/Memory_addressing - Covers relationships between memory capacity, addressing, and addressable units (bytes/words) and how address selection works. ↩
-
"Chip select — Wikipedia" https://en.wikipedia.org/wiki/Chip_select - Describes chip-select control enabling devices in memory systems and typical decoding behavior. ↩
Compute how many ROM chips are required for 4096 bytes
- 1Step 1
Assume each ROM chip is 1024 bytes. (A standard ROM capacity used in such problems is bytes.)
- 2Step 2
Total needed is 4096 bytes. So ROM chips.
- 3Step 3
You need 4 ROM chips to produce 4096 bytes.
Compute the number of address lines needed to access 4096 bytes
- 1Step 1
For byte addressing, , so the required address line count is .
- 2Step 2
Because , 12 address lines uniquely select every byte location in the 4096-byte memory.
- 3Step 3
You need 12 address lines to access all 4096 bytes.
Compute how many addresses are common to all chips
- 1Step 1
All chips receive the same address bus lines for the within-chip address portion, while chip select determines which chip is actually enabled.
- 2Step 2
Each chip is 1024 bytes = locations, so it uses 10 address lines to select a location inside that chip.
- 3Step 3
Across 4 chips, the within-chip address combinations are the same set of address values that each chip could be enabled for (only one chip is actually enabled at a time in a typical decoded system).
- 4Step 4
The number of addresses that are common in the sense of 'same within-chip offsets' across all chips is 1024.
Final numeric answers
- ROM chips required:
- Address lines required to access 4096 bytes:
- Addresses common to all these chips (within-chip offsets):
We can also show how the 12 address lines split:
- Let the 12-bit CPU/overall address be .
- Use the lower 10 bits to select a byte within each 1024-byte ROM chip.
- Use the upper 2 bits to decode which of the 4 chips is selected using chip-select lines.
keyword Within-chip offset is common across chips.
Address line split for 4096-byte memory made from 4×1024-byte ROM chips
Overall 12 address lines are partitioned into within-chip selection (10) and chip selection (2).
Rule of thumb
"For byte-addressed memory with capacity bytes, you need exactly address lines. This is the fastest way to get the address-line count." 2
Footnotes
-
"Address lines — Wikipedia" https://en.wikipedia.org/wiki/Address_lines - Explains that addresses correspond to address lines. ↩
-
"Memory organization — Wikipedia" https://en.wikipedia.org/wiki/Memory_addressing - Covers relationships between memory capacity, addressing, and addressable units (bytes/words) and how address selection works. ↩
Common mistake
"“Common addresses” does NOT mean the overall system has 1024 identical byte addresses. In a properly decoded system, each overall address maps to exactly one chip. The 1024 value is the number of within-chip offsets that are common to all chips (the same offset set )."
Footnotes
-
"Chip select — Wikipedia" https://en.wikipedia.org/wiki/Chip_select - Describes chip-select control enabling devices in memory systems and typical decoding behavior. ↩
Concept checks
ROM Addressing Flashcards
Knowledge Check
You have ROM chips of 1024 bytes each. How many chips are required to get 4096 bytes?
Explore Related Topics
Various Addressing Modes of 8051 Microcontroller
The 8051 microcontroller provides multiple addressing modes that define how an instruction identifies the location or value of its operand.
- Immediate (
#data) – constant value encoded in the instruction, used for loading fixed numbers. - Register (
Rn) – operand resides in CPU registers R0‑R7 (or A/B), giving the shortest and fastest code. - Direct (
addr) – 8‑bit address is part of the opcode, accessing internal RAM or SFRs directly. - Register indirect (
@R0,@R1,@DPTR) – a register holds the operand’s address, enabling pointer‑like traversal of memory. - Indexed (
@A+DPTRor@A+PC) – adds the accumulator to DPTR or PC for table look‑ups in code memory; branch modes (relative, absolute, long) extend this concept for short, page‑limited, and full‑range jumps.
Cache Design for a 2-Set-Associative Cache: Address Interpretation
Designing a 32k × 32 RAM Using 128 × 8 Bit RAM Modules