Logo
All chapters
Volume II: Digital Logic  ›  Memory & Programmable Logic

Read-Only Memory (ROM)

A memory programmed once; reading an address returns fixed stored bits — also a truth-table machine.

PrevError Detection & Correction
NextProgrammable Logic Array

Description

A ROM holds fixed data: an n-input address drives a full decoder (all 2^n minterms), and a programmable OR array selects which minterms appear on each output. That makes a ROM a direct truth-table implementation: store the output column for every input combination and you have realized any combinational function.

  • n address lines → 2^n decoder outputs (every minterm).
  • Each output bit ORs a programmed subset of minterms.
  • So a 2^n × m ROM realizes any m functions of n variables.
  • The AND array (decoder) is fixed; only the OR array is programmed.
  • Programming = storing the truth-table output columns.
  • Mask ROM: programmed at fabrication (cheap in volume).
  • PROM: user-programmed once via fuses.
  • EPROM: UV-erasable and reprogrammable.
  • EEPROM / Flash: electrically erasable, byte/block reprogrammable.
  • All are non-volatile (retain data without power).

At a glance

What

Non-volatile memory whose contents are fixed at programming time; structurally a fixed AND (decoder) + programmable OR.

Why

It stores firmware and implements arbitrary combinational logic by table lookup.

How

Address = inputs → decoder makes all minterms → OR array picks ones per output.

Where

Boot firmware, microcode, lookup tables, code converters.

When

When the function/data is fixed and read frequently.

Think of it like…

A ROM is a printed answer key: every possible question (address) already has its answer (data) written down; you just look it up.

ROM = decoder + OR array

  • n address lines → 2^n decoder outputs (every minterm).
  • Each output bit ORs a programmed subset of minterms.
  • So a 2^n × m ROM realizes any m functions of n variables.
  • The AND array (decoder) is fixed; only the OR array is programmed.
  • Programming = storing the truth-table output columns.

ROM types

  • Mask ROM: programmed at fabrication (cheap in volume).
  • PROM: user-programmed once via fuses.
  • EPROM: UV-erasable and reprogrammable.
  • EEPROM / Flash: electrically erasable, byte/block reprogrammable.
  • All are non-volatile (retain data without power).

ROM as logic

PartArrayProgrammable?
DecoderAND (all minterms)fixed
OutputORprogrammable

Black-box view

Address / inputsROM 2^n × mblack boxData / f(inputs)

Inputs on the left → outputs on the right · particles show signal direction

Functional / block diagram

Inputs
Fixed AND (decoder)
Programmable OR
Outputs

Functional blocks · arrows animate in the direction data flows

ROM-style lookup (read-only use)

▶ live simulator
addr
decoder
→ row 0
000
0000
= 0selected
001
0011
= 3
010
0110
= 6
011
1001
= 9
100
1100
= 12
101
1111
= 15
110
0010
= 2
111
0101
= 5

8×4 RAM · address decoder selects one word · Write stores, Read fetches

Real-world applications

Boot firmware/BIOSMicrocodeCharacter/font tablesCode converters

The 5 Whys

  1. 1

    Why ROM? Fixed data/logic that's read often, kept without power.

  2. 2

    Why is it a truth-table machine? Decoder makes all minterms; OR selects them.

  3. 3

    Why fixed AND, programmable OR? Minterms are universal; only the selection varies.

  4. 4

    Why EPROM/Flash? Reprogrammability for updates.

  5. 5

    Root cause: storing every output column realizes any function by lookup.

Cheat sheet

Working principle

  • Address = inputs → decoder makes all minterms → OR array picks ones per output.
  • Non-volatile memory whose contents are fixed at programming time; structurally a fixed AND (decoder) + programmable OR.

Formulas & Boolean expressions

  • ROM size = 2^n × m
  • Each output = OR of selected minterms
  • n address lines → 2^n decoder outputs (every minterm).
  • So a 2^n × m ROM realizes any m functions of n variables.
  • Programming = storing the truth-table output columns.

Key facts

  • n address lines → 2^n decoder outputs (every minterm).
  • Mask ROM: programmed at fabrication (cheap in volume).

Why it exists

  • Root cause: storing every output column realizes any function by lookup.
PrevError Detection & Correction
NextProgrammable Logic Array