23-Mechatronics-A3 Digital Logic and Embedded Systems · Undated paper
Question 6 of 6: Memory-mapping a 64KB space from four 16Kx8 modules
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
Paper format. This paper's cover page prints the exam code
18-Elec-A4, Digital Systems and Computers (National Examinations,
May 2018), a three-hour closed-book exam with one approved calculator model permitted. The cover page states that FIVE of the SIX printed questions constitute a complete exam paper; all six are worked here, each worth 12 marks per the page-1 marking-scheme table.
Reference texts. M.M. Mano & M.D. Ciletti, Digital
Design, 6th ed. (K-map minimisation and static hazards Ch.3; sequential
circuit analysis/design and JK excitation Ch.5–6; PLA/PAL Ch.7); C. Hamacher,
Z. Vranesic, S. Zaky & N. Manjikian, Computer Organization and Embedded
Systems, 6th ed. (address decoding and memory-mapped I/O Ch.1, 8); Motorola/
Freescale, M68HC11 Reference Manual (accumulator-A load/store timing,
port I/O).
Questions are numbered here by matching each question's sub-part count and mark split to the marking scheme on page 1: Q1 (3+3+3+3) is the PoS/SoP K-map question on page 2; Q2 (3+3+3+3) is the JK-flip-flop counter question on page 2, whose printed bullet (c) merges two 3-mark deliverables (K-map and circuit drawing) into one line, split here into (c) and (d) to match the mark count; Q3 (6+6) is the truth-table/PLA question on page 3; Q4 (3+4+3+2) is the RS/T flip-flop question on page 3; Q5 (3+3+3+3) is the question on page 4; Q6 (4.5+4.5+3) is the question on page 5. The flip-flop excitation tables and Boolean identities on page 6 are used throughout as needed.
Question 6: Memory-mapping a 64KB space from four 16Kx8 modules [4.5+4.5+3 = 12]
Given. An 8-bit CPU with a 16-line address bus $A_{15}\ldots A_0$ (so $2^{16}=65536=64\text{K}$ bytes of address space) and an 8-line data bus $D_7\ldots D_0$; memory modules of size $16\text{K}\times 8$ (each needs $\log_2(16\times1024)=14$ address lines and all 8 data lines).
Find. How many modules are needed and how their address/data pins connect to the bus; the chip-select logic; the address range of each module.
Approach. $64\text{K}/16\text{K}=4$ modules exactly fill the space. Since each module only needs 14 of the 16 address lines, connect $A_{13}\ldots A_0$ identically to every module (they select the byte WITHIN a module) and use the 2 remaining high-order lines $A_{15},A_{14}$ to generate 4 mutually-exclusive chip-select signals, one per module — a textbook 2-to-4 decode built from AND gates on $A_{15},A_{14}$ and their complements.
Fig. 6 — 4× 16Kx8 modules sharing $A_{13}$–$A_0$ (14 lines) and $D_7$–$D_0$ (8 lines); $A_{15},A_{14}$ decoded into the 4 chip-selects.
(a) Module count and bus connections. $64\times1024/(16\times1024)=4$ modules. Each module's address pins connect to $A_{13}\ldots A_0$ (14 lines, the "blank box" above each module's address bus = 14) and its data pins connect to all of $D_7\ldots D_0$ (8 lines, shared by every module since only the selected one drives the bus). $$\boxed{4\text{ modules},\ 14\text{ address lines per module},\ 8\text{ shared data lines}}.$$
(b) Chip-select logic. The 2 leftover address lines $A_{15},A_{14}$ give $2^2=4$ combinations, one per module, via 2-input AND gates: $$\boxed{CS_0=\bar A_{15}\bar A_{14},\quad CS_1=\bar A_{15}A_{14},\quad CS_2=A_{15}\bar A_{14},\quad CS_3=A_{15}A_{14}}.$$ Exactly one $CS_i$ is asserted for any address, since the 4 AND-gate outputs are a minterm decode of $A_{15}A_{14}$ and minterms are mutually exclusive by construction.
(c) Address ranges. Each module occupies a contiguous $16\text{K}=0x4000$-byte block, ordered by the value of $A_{15}A_{14}$ (the block that module's 14 shared low address lines then span in full):
Module
$A_{15}A_{14}$
Address range
0
00
0x0000–0x3FFF
1
01
0x4000–0x7FFF
2
10
0x8000–0xBFFF
3
11
0xC000–0xFFFF
Quantity
Result
Modules needed
4 × 16Kx8
Per-module address lines
$A_{13}$–$A_0$ (14, shared)
Chip-select equations
$CS_i$ from a 2-input AND decode of $A_{15},A_{14}$ (4 combinations)