NivaarExam PrepOfficial exam papers ↗

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.

Question 5 (12 marks) — Memory-mapped chip-select decoding

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

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.

74HC1383:8 decA15A14A13Y0Y1Y2Y3Y4Y5Y6Y74K x 8 RAM0x8800-0x97FFA0-A11 (12)E1' = Y4 + (A12 XNOR A11)E1'2K x 8 EPROM0xB800-0xBFFFA0-A10 (11)E2' = Y5 + (A12 . A11)'E2'-> data bus D0-D7-> data bus D0-D7
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.
  1. 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}$.
  2. 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).
  3. 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}$.
  4. 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).
  5. 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$.
ItemResult
RAM bus12 address ($A_0$-$A_{11}$), 8 data
EPROM bus11 address ($A_0$-$A_{10}$), 8 data
RAM page / EPROM page$Y_4$ / $Y_5$
$E1$ (RAM, active low)$Y_4+(A_{12}\odot A_{11})$
$E2$ (EPROM, active low)$Y_5+\overline{A_{12}A_{11}}$