22-Elec-A4 Digital Systems and Computers · December 2016
Question 5 of 6: Memory-mapped chip-select decoding
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
Paper format. National Exams, December 2016 — 07-Elec-A4 Digital Systems & Computers. Three hours, closed book, one approved Casio or Sharp calculator. Six questions are printed and any five constitute a complete exam; every question is worth 12 points with the per-part breakdown printed on page 1. A flip-flop excitation table and a sheet of Boolean identities are attached as page 6. All six questions are solved below so the set works as a complete study resource.
Reference texts.
M. M. Mano and M. D. Ciletti, Digital Design, 6th ed. — Ch. 2-3 (Boolean algebra, K-maps, hazards, NAND/NOR-only synthesis), Ch. 5-6 (synchronous sequential logic, state tables, counters), Ch. 7 (memory and programmable logic: PAL/PLA).
J. F. Wakerly, Digital Design: Principles and Practices, 5th ed. — Ch. 4 (hazards and combinational practices), Ch. 7-8 (latches, flip-flops, excitation tables and counter design).
C. Hamacher, Z. Vranesic, S. Zaky and N. Manjikian, Computer Organization and Embedded Systems, 6th ed. — Ch. 3 and Ch. 8 (address decoding, chip-select generation, memory-mapped I/O).
Given. RAM 4 KB at 0x8800; EPROM 2 KB at 0xB800; forbidden windows 0x9800–0x9FFF, 0xB600–0xB7FF, 0xC000–0xFFFF; a 74HC138 decoding $A_{15}A_{14}A_{13}$ into 8 KB pages $Y_0\ldots Y_7$. Find. bus widths and the active-low selects $E1,E2$.
Approach. Size each chip's internal address bus from its capacity, place its range in the decoder's 8 KB page, then add the minimum gating on $A_{12},A_{11}$ to carve the exact window and exclude the forbidden regions.
Address-decode block diagram. The 74HC138 selects 8 KB pages; $Y_4$ (0x8000-0x9FFF) gates the RAM and $Y_5$ (0xA000-0xBFFF) the EPROM, with $A_{12},A_{11}$ trimming each to its exact window.
Bus widths (part a). A 4 Kbyte RAM has $4096=2^{12}$ locations → 12 address lines $A_0\!-\!A_{11}$ and 8 data lines $D_0\!-\!D_7$. A 2 Kbyte EPROM has $2048=2^{11}$ → 11 address lines $A_0\!-\!A_{10}$ and 8 data lines. The 74HC138 takes 3 select lines $A_{13},A_{14},A_{15}$.
Locate the RAM range. RAM occupies $0\text{x}8800$ to $0\text{x}8800+0\text{x}0FFF=0\text{x}97FF$. Its top three address bits $A_{15}A_{14}A_{13}=100$ select $\boxed{Y_4}$ (the 8 KB page 0x8000-0x9FFF).
Trim the RAM window with $A_{12},A_{11}$. Inside $Y_4$ the four 2 KB sub-pages are 00:0x8000-0x87FF, 01:0x8800-0x8FFF, 10:0x9000-0x97FF, 11:0x9800-0x9FFF. The RAM needs the middle two ($A_{12}A_{11}=01$ or $10$), which is exactly $A_{12}\oplus A_{11}$; this also excludes the forbidden 0x9800-0x9FFF ($11$). With the active-low $Y_4$: $$\boxed{E1=Y_4+\overline{A_{12}\oplus A_{11}}=Y_4+(A_{12}\odot A_{11})}$$ i.e. $E1$ is low only when $Y_4=0$ and $A_{12}\ne A_{11}$.
Locate the EPROM range. EPROM occupies $0\text{x}B800$ to $0\text{x}BFFF$ (2 KB). Its top bits $A_{15}A_{14}A_{13}=101$ select $\boxed{Y_5}$ (page 0xA000-0xBFFF).
Trim the EPROM window. 0xB800-0xBFFF is the top sub-page $A_{12}A_{11}=11$, which excludes the forbidden 0xB600-0xB7FF ($A_{12}A_{11}=10$). Hence $$\boxed{E2=Y_5+\overline{A_{12}\cdot A_{11}}=Y_5+(\overline{A_{12}}+\overline{A_{11}})}$$ low only when $Y_5=0$ and both $A_{12}=A_{11}=1$.