47. Read-Only Memory (ROM) and Look-up Tables
ROM is not just for firmware; its structure makes it an incredibly versatile combinational logic element, acting as a universal function generator via a look-up table (LUT).
ROM Structure
- Address Decoder: An N-to-$2^N$ decoder takes the N address inputs and activates exactly one row (word line) in the memory array.
- Memory Array: A grid of fuses or programmable connections storing the data.
- Output Buffers: Connect the selected word line data to the output data lines.
ROM as a Universal Combinational Circuit
Any combinational circuit (any truth table) can be implemented using a ROM.
- Inputs: The variables of the Boolean function are connected to the ROM address lines.
- Outputs: The outputs of the function are connected to the ROM data lines.
- Programming: The ROM is 'programmed' by storing the truth table output values at the corresponding memory addresses.
Example: Implementing a Full Adder
- Inputs (A, B, $C_{in}$) become 3 address lines (8 addresses total).
- Outputs (S, $C_{out}$) become 2 data lines.
- The ROM array stores the S and $C_{out}$ values for all 8 input combinations. Simpler design, but often less efficient than minimized gates.