- 2073 Magh · 8 marks
Interface circuit with 2 RAMs and 2 ROMs
Short answer
Use a 2-to-4 decoder with A15 enabling, A14 and A13 as selects. ROM1 is selected at 0000H–1FFFH, ROM2 at 2000H–3FFFH, RAM1 at 4000H–5FFFH, RAM2 at 6000H–7FFFH. All chips share A12–A0, RD, and the data bus; WR strobes only the RAMs.
Design an interface circuit of a microprocessor with 16-bit address with 2 RAMs and 2 ROMs of 8 Kbyte each.
Given: a processor with a 16-bit address bus (64 KB space) and an 8-bit data bus, and four chips of 8 KB each: ROM1, ROM2, RAM1, RAM2.
Address lines
8 KB = 2^13 bytes, so each chip needs 13 address lines (A12-A0), connected in parallel to all chips. The remaining lines A15, A14 and A13 are used for chip selection. With four chips (32 KB in total), A14 and A13 select one chip, and A15 enables the decoder (the memory occupies the lower 32 KB).
Chip-select logic
A 2-to-4 decoder (e.g. 74LS139) is used, with its active-low enable input G' driven by A15.
| A15 | A14 | A13 | Chip selected | Address range |
|---|---|---|---|---|
| 0 | 0 | 0 | ROM1 | 0000H - 1FFFH |
| 0 | 0 | 1 | ROM2 | 2000H - 3FFFH |
| 0 | 1 | 0 | RAM1 | 4000H - 5FFFH |
| 0 | 1 | 1 | RAM2 | 6000H - 7FFFH |
| 1 | x | x | none | 8000H - FFFFH (free) |
Circuit
+-------------------------------+
A12..A0 -----+--> A of ROM1, ROM2, RAM1, RAM2 |
+-------------------------------+
A15 ------> G' +-----------+
A14 ------> B | 2-to-4 |--Y0'--> CS' ROM1
A13 ------> A | decoder |--Y1'--> CS' ROM2
| |--Y2'--> CS' RAM1
+-----------+--Y3'--> CS' RAM2
RD' -------> OE' of all four chips
WR' -------> WE' of RAM1 and RAM2 only (ROMs are read-only)
D7..D0 <===> data pins of every chip (tri-state, shared)
Operation: when the processor outputs an address, A15 = 0 enables the decoder, and A14A13 activates the chip select of exactly one chip. Only that chip drives the data bus (read) or latches it (RAM write), using A12-A0 for the location within the chip. RD' and WR' act as the read and write strobes. The ROMs hold the program (booting from 0000H) and the RAMs hold data and the stack.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Compose 1K x 8 ROMs into 2K x 16 · Embedded System, chapter 4 · asked 2×
- How interrupts interface with microprocessor · Embedded System, chapter 5
- Compose 2K x 16 ROM using 1K x 4 · Embedded System, chapter 4
- Compose 4K x 16 ROM using 1K x 8 · Embedded System, chapter 4
- Structural modelling; 3-bit up counter · Embedded System, chapter 9
- 8085 ALP: compare two tables of 16-bit data · Microprocessor, chapter 2
- 8086 ALP: max and min of 16-bit list · Microprocessor, chapter 3
- Circuit giving 2's complement of a 4-bit number · Digital Logic, chapter 5
- Interface two 8K x 8 ROM at 4000H · Microprocessor, chapter 4