ROM Memory and Lookup Tables in Logisim-evolution: Hex Loading, Control Stores, and FPGA Mapping

Direct Answer: Using ROM Memory and Lookup Tables in Logisim-evolution

The ROM component in Logisim-evolution (Memory → ROM) models non-volatile Read-Only Memory configurable from 1 to 24 address bits (up to $2^{24}$ words) and 1 to 32 data bits per word. Unlike RAM, ROM preserves its programmed hexadecimal contents inside the .circ project file across simulation resets and software restarts. Engineers use Logisim ROMs in three primary roles: as Instruction Memory storing machine code for 8-bit and 32-bit MIPS CPUs, as Combinational Lookup Tables (LUTs) replacing complex gate networks for 7-segment decoders or math tables, and as Microcode Control Stores for FSMs.

Recommended Computer Architecture Textbooks and FPGA Memory Hardware

When exporting Logisim circuits to physical FPGAs, ROMs synthesize directly into FPGA Lookup Tables (LUTs) or dedicated Block RAM (BRAM) primitives. Reference these proven resources:

Memory Architecture Guide

Digital Design & Computer Architecture

By David Harris & Sarah Harris. Covers ROM-based combinational logic synthesis, instruction memory organization, and HDL $readmemh initialization.

Publisher: Morgan Kaufmann • Standard University Text
View Textbook on Amazon →
Physical Silicon Target

Digilent Basys 3 Artix-7 FPGA

Includes 1,800 Kbits of fast Xilinx Block RAM (BRAM) and 16MB Quad-SPI Flash, allowing your exported Logisim ROMs and CPU programs to run at 100MHz.

Price: ~$165 USD • Silicon: Xilinx Artix-7 XC7A35T
Check Basys 3 on Amazon →

Comparing ROM, RAM, and Discrete Gate Networks in Logisim

Deciding between a ROM lookup table, RAM block, or combinational gates depends on mutability, size, and hardware synthesis goals:

Memory / Logic Type Persistence on Save Runtime Writes Read Timing Best Use Case
Logisim ROM Yes (Stored in .circ) Read-Only Asynchronous combinational lookup CPU Instruction Memory, 7-Segment LUTs
Logisim RAM Volatile (Cleared on Reset) Synchronous or Async Async or Clocked (Configurable) Data Memory (Stack, Heap, Arrays)
Discrete Logic Gates Hardwired in schematic Immutable Gate propagation delay Small 2-to-4 decoders, simple adders

Loading External Hex Files into Logisim ROM Images

Rather than typing machine code byte-by-byte in the GUI, you can generate plain-text hex files from Python assemblers or MARS/RARS and load them via Right-Click ROM → Load Image…. Logisim-evolution requires a strict header line on line 1:

v2.0 raw
# Comments start with #
20080005 20090003 01095020 ac0a0000
16*00000000
08000007

# Modern Logisim-evolution v3.0 addressed format (optional):
# v3.0 hex words addressed
# 00: 20080005 20090003 01095020 ac0a0000

Configuring and Wiring ROM Memory in Your Schematic

Follow this clean procedure to configure a ROM for either a CPU program memory or a combinational lookup table:

  1. Place the Component: Select Memory → ROM and place it on the canvas.
  2. Set Address & Data Widths: In the Properties panel, set Address Bit Width (e.g., 4 for 16 entries, 8 for 256 words) and Data Bit Width (e.g., 7 for 7-segment outputs, 32 for MIPS instructions).
  3. Wire Address & Chip Select: Connect your address bus (or Program Counter) to the upper-left A port. Leave the lower-left sel (Chip Select) pin unconnected (defaults to 1) or tie it to constant 1.
  4. Populate Contents: Right-click the ROM and choose Edit Contents to type hex values directly, or choose Load Image… to import a v2.0 raw file.

Frequent Traps When Using ROMs in Logisim-evolution

Avoid these four common ROM configuration errors:

Trap 1: Disabled sel Pin Outputs High-Z (XXXX)

Problem: Connecting an uninitialized or 0 signal to the ROM’s bottom-left sel pin places the data output bus into floating blue/error state.
The Fix: Tie sel to constant 1 (active-high) or leave it disconnected so the ROM remains continuously enabled.

Trap 2: Missing v2.0 raw Header in Hex Files

Problem: Importing a raw hex dump from a text editor without the magic header causes Logisim to throw an invalid memory image format error.
The Fix: Always ensure the very first line of your text file reads exactly v2.0 raw (or v3.0 hex words plain).

Trap 3: Word-Addressed ROM vs Byte-Addressed PC

Problem: Connecting a 32-bit MIPS PC that increments by 4 directly to a 32-bit-wide ROM skips 3 out of every 4 instructions.
The Fix: Use a Splitter to drop the bottom 2 bits of the PC, feeding PC[9:2] into an 8-bit ROM address port.

Trap 4: Large Address Widths Slowing Down Save Files

Problem: Setting Address Bit Width = 24 (16 million words) even when only 50 instructions are used bloats XML .circ file parsing.
The Fix: Size your ROM address width tightly to your program’s actual needs (typically 8 to 12 bits for coursework CPUs).

Curriculum Progression from ROM Memory to Full Processors

Put ROM lookup tables and instruction memories to work inside complete Logisim architectures:

Frequently Asked Questions About Logisim ROMs

Does Logisim-evolution save ROM contents inside the .circ file?

Yes. Unlike RAM (which resets to zeros when you close or reset the simulation), any hex data entered or loaded into a ROM component is saved permanently inside the .circ XML project file.

Can I export a Logisim ROM to Verilog or VHDL for FPGA synthesis?

Yes. When you export HDL from Logisim-evolution, ROM contents are translated into initialized Verilog case lookup statements or VHDL constant arrays, which AMD Vivado and Intel Quartus synthesize directly into FPGA LUTs or initialized Block RAM.

How do I write a repeating pattern in a v2.0 raw hex file?

Logisim supports run-length encoding using an asterisk: writing 16*00 fills 16 consecutive memory addresses with 0x00.

Why does my ROM output turn blue (unknown) when I connect a control signal to sel?

When sel is driven to 0, the ROM tristates its output bus to high-impedance (blue wire in Logisim). Ensure sel is driven to 1 during read operations or leave the pin disconnected.

Affiliate Disclosure: Logisim-evolution Community is an independent educational resource. Some links in this guide are affiliate links. If you purchase textbooks or FPGA hardware through these links, we may earn an affiliate commission at no extra cost to you.

Similar Posts