CSE 2317 W5 · Class 2 Memory systems and PLAs
Sakeef Sani ↗ ↓ PDF

CSE 2317Week 5Class 2Sunday · 11:00 AM – 12:20 PM80 min

Memory systems and PLAs

A memory is a decoder, a grid and something at every crosspoint: a diode, a latch, a capacitor or a floating gate. Program the grid instead of storing data in it and you get a PLA.

S present · L lecturer notes · → next step · F full screen · P presenter window
01 Cold open 0–4 min

One byte out of 137 billion

Your phone has 128 GB of storage: about 137 billion bytes.

To read one particular byte, the processor has to name it. How many wires (address bits) does it need? And what, physically, is a stored 1?

Pop culture

Today's four cells: the diode from Week 1, the latch from Week 4, a capacitor, and a MOSFET from Week 2 with a trapped charge.

02 Concept 4–9 min

Every memory: decoder, word lines, bit lines

  • 2k words × n bits. k address bits go into a decoder that raises exactly one word line.
  • The cells on that line put their bits on the n bit lines (read) or take them from there (write).
  • Control: CS̄ (chip select), OE̅ (output enable, drives the data bus), WE̅ or R/W̄.
capacity=2k×n bits64K×8: k=16, n=8, 512 Kbit\text{capacity} = 2^{k} \times n\ \text{bits}\qquad 64\text{K}\times 8:\ k = 16,\ n = 8,\ 512\ \text{Kbit}
TypeCellVolatileWrite
Mask ROMdiode / transistor present or notnoat the factory
PROMfusenoonce
EPROMfloating gatenoUV erase
EEPROM / Flashfloating gatenoelectrically
SRAM6-transistor latchyesany time, fast
DRAM1 transistor + 1 capacitoryesany time, refresh
03 Worked example 9–14 min

Worked example: building 256K × 16 from 64K × 8 chips

Given

64K × 8 memory chips with active-low CS̄. Any decoders.

Find

How many chips, how the address lines are connected, and which addresses row 2 answers.

2-to-4A17 A1664K×8 · D15–D864K×8 · D7–D064K×8 · D15–D864K×8 · D7–D064K×8 · D15–D864K×8 · D7–D064K×8 · D15–D864K×8 · D7–D0A15–A0, OE̅, WE̅ to all eight chips

Method: memory expansion: width and depth (Mano)

Solution

Predict the answer first. Then reveal one step at a time.

04 Concept 14–19 min

ROM: a grid of diodes

  • Word lines run across, bit lines run down; each bit line has a pull-down resistor.
  • The decoder drives the selected word line HIGH (all others LOW). Where a diode joins that word line to a bit line, it conducts: the bit line rises to ≈ VH − 0.7 V, a 1. No diode: the resistor holds it at 0.
  • Each bit line is a diode OR (Week 1!) of the word lines that have a diode on it. A ROM is a decoder (all minterms) followed by OR gates.
Programming = choosing the diodes

Mask ROM: the factory leaves diodes (today: transistors) in or out. PROM: every crosspoint has a diode in series with a fuse; you blow the fuses of the 0s. EPROM / flash: the switch is a MOSFET whose threshold is set by charge on a floating gate.

Gotcha

Diodes are essential: a plain wire at a crosspoint would short the selected word line to every other word line through the bit lines.

05 Live lab 19–25 min

Live lab: read and program a diode ROM

A diode-matrix ROM Pick an address: the decoder raises one word line, and each diode on it pulls its bit line to 1. Click any crosspoint to add or remove a diode.
Address
3-to-8decoderA2A1A00D50D41D30D20D11D0W0W1W2W3W4W5W6W7
Address011 = 3
Data D5…D0001001 = 9
AD5…D0
0000000000
0010000011
0100001004
0110010019
10001000016
10101100125
11010010036
11111000149

13 diodes = 13 stored 1s out of 48 bits.

06 Worked example 25–29 min

Worked example: a full adder in an 8 × 2 ROM

Given

A ROM with 3 address inputs and 2 outputs (8 words × 2 bits), diode matrix.

Find

Its contents for a full adder (S, Cout) and the number of diodes.

Method: combinational logic with ROM (Mano)

Solution

Predict the answer first. Then reveal one step at a time.

07 Concept 29–35 min

RAM: a latch or a capacitor at every crosspoint

SRAM: 6 transistors

Two cross-coupled CMOS inverters (the bistable latch of Week 4) hold the bit; two nMOS access transistors connect it to BL and BL̄ when the word line is high. Holds as long as power is on, no refresh, fast (cache memory).

BLBL̄word line

DRAM: 1 transistor + 1 capacitor

A charged capacitor (≈ 25 fF) is a 1. Reading connects it to the bit line, whose sense amplifier sees a tiny voltage change: the read is destructive, so the row is written back. Leakage drains it, so every row is refreshed every 64 ms. Tiny cell: main memory.

BLword lineC ≈ 25 fF
08 Live lab 35–40 min

Live lab: refresh, or lose the bit

DRAM: a bit that leaks away Each cell is a tiny capacitor holding charge for a 1. It leaks. Refresh reads every row and writes it back before any cell drops below the sense threshold (V_DD/2).
0.00.51.10100200300400500600sense threshold V_DD/2time (ms)cell voltage (V)
Bits lost0 of 4
Weakest cell holds100 ms
Refresh overhead0.64 %

Overhead = 8192 rows × 50 ns ÷ 64 ms: the fraction of time the memory is busy refreshing instead of answering the processor.

09 Worked example 40–44 min

Worked example: how often must DRAM refresh?

Given

Cell capacitance C = 25 fF, written to 1.2 V, sensed correctly while above 0.6 V. Worst-case leakage I = 0.1 pA. The chip has 8192 rows; refreshing one row takes 50 ns.

Find

The retention time, the margin over the 64 ms standard, and the refresh overhead.

Method: DRAM retention and refresh (Taub & Schilling)

Solution

Predict the answer first. Then reveal one step at a time.

10 Your turn 44–49 min

Your turn · 1: 32K × 8 from 8K × 4

05:00
1 Exam CQ

Build a 32K × 8 memory from 8K × 4 chips.

(a) How many chips? (b) How many address lines, and how are they connected? (c) Which row of chips answers address 5A3Ch?

Work it out first.
Press Solve when the class has an answer.

11 Concept 49–54 min

PLA: program the logic, not the data

  • A ROM generates every minterm (2n of them) and ORs the ones you want. Most functions need only a few product terms.
  • A PLA has a programmable AND array (make only the product terms you need, from inputs and their complements) and a programmable OR array (sum them into each output). Shared terms are made once.
  • Size: n inputs, k product terms, m outputs:
crosspoints=2n⋅k (AND)+k⋅m (OR)\text{crosspoints} = 2n \cdot k\ (\text{AND}) + k \cdot m\ (\text{OR})
DeviceAND arrayOR array
PROMfixed (full decoder)programmable
PLAprogrammableprogrammable
PAL / GALprogrammablefixed
Pro tip

Write the functions as minimised sums of products first, and look for product terms the outputs can share.

12 Live lab 54–60 min

Live lab: program a PLA

Programmable logic array Click a crosspoint in the AND array (left) to put that literal into the product term; click one in the OR array (right) to add the product to an output. Set A, B, C and watch the lines.
AND array (programmable)OR array (programmable)AĀBB̄CC̄P1P2P3P4P5P6P7P8F1 = 1F2 = 1

F₁ = AC + BC

F₂ = AC + AB̄

ABCF₁F₂
00000
00100
01000
01110
10001
10111
11000
11111

3 of 8 product terms used · 10 connections.

13 Worked example 60–64 min

Worked example: a PLA programming table

Given

F₁(A, B, C) = Σm(3, 5, 7) and F₂(A, B, C) = Σm(4, 5, 7).

Find

The minimised functions and the PLA programming table with the fewest product terms.

Method: PLA programming table (Mano)

Solution

Predict the answer first. Then reveal one step at a time.

14 Your turn 64–68 min

Your turn · 2: PLA or ROM?

04:00
2 Exam CQ

The classic 82S100 PLA has 16 inputs, 48 product terms and 8 outputs.

(a) How many programmable crosspoints does it have? (b) How many bits would a ROM need to implement any 8 functions of the same 16 inputs? (c) When would you choose each?

Work it out first.
Press Solve when the class has an answer.

15 Think deeper 68–71 min

Critical thinking · the seven-segment decoder

Think deeper

A BCD to 7-segment decoder: 4 inputs, 7 outputs. ROM or PLA?

Argue it in pairs for two minutes. There may be more than one defensible answer.

Think deeper

Why did FPGAs replace PLAs and PALs for big designs?

Argue it in pairs for two minutes. There may be more than one defensible answer.

16 Real world 71–74 min

Real world: memories you carry

  • Phone: SRAM caches inside the processor, a few GB of DRAM refreshed every 64 ms (32 ms when hot), and 128 GB of 3D NAND flash, each cell holding 3–4 bits as different amounts of trapped charge.
  • Cards: bank cards, SIM cards and smart ID cards keep keys and records in EEPROM on the chip: non-volatile, rewritable byte by byte, no battery.
  • Every microcontroller: flash for the program, SRAM for variables, a little EEPROM for settings.
BME corner

A pacemaker stores its pacing settings and an event log in EEPROM and its firmware in flash: they must survive a battery change and years of use. Flash endurance (≈ 10⁴–10⁵ erase cycles) is a design limit for medical loggers.

17 Pop quiz 74–78 min

Pop quiz

Score 0

Question 1 / 5

A memory chip has 12 address lines and 8 data lines. Its capacity is…

18 Recap 78–80 min

Three things to remember

01

Memory = decoder + word lines + bit lines. 2k × n. Width: chips side by side; depth: decode the top address bits into CS̄.

02

Cells: diode/fuse (ROM, PROM), floating gate (EPROM, flash), 6T latch (SRAM), 1T1C (DRAM, refresh every 64 ms).

03

PLA: programmable AND + OR, share product terms; PAL fixes the OR, PROM fixes the AND. ROM for tables, PLA for many inputs and few terms.

HW Before next class

Implement F₁ = Σm(0, 1, 2, 3, 7) and F₂ = Σm(0, 1, 2, 3, 4) in a PLA with the fewest product terms. Give the programming table, and verify it in the PLA lab.

Work it out first.
Press Solve when the class has an answer.