RAM

RAM

Advanced signal_cellular_alt Advanced schedule 35 min

RAM (Random Access Memory)

Overview

  • Purpose: RAM (Random Access Memory) is a volatile digital storage component that allows data to be read from or written to any memory location with equal access time. It temporarily stores data and instructions that are actively used by digital systems.
  • Symbol: RAM is represented by a rectangular block with address inputs, bidirectional data lines, and control signals (WE, OE, CS).
  • DigiSim.io Role: Provides essential memory functionality for digital system designs, enabling data storage, lookup tables, and temporary variables in simulated circuits.

RAM component

Functional Description

Logic Behavior

RAM stores and retrieves data from specified memory addresses. Its operation is controlled by address inputs, data lines, and control signals.

Operation Modes:

  1. Read Operation: When CS=1, WE=0, and OE=1, the data stored at the specified address appears on the data lines.
  2. Write Operation: When CS=1 and WE=1, the data present on the data lines is stored at the specified address.
  3. Inactive State: When CS=0, data lines are in high-impedance state and no operations occur.

Control Signal Truth Table:

CS WE OE Operation
0 X X Inactive (no operation)
1 0 0 Inactive output (high-impedance)
1 0 1 Read operation
1 1 X Write operation

Note: X means "don't care"

Inputs and Outputs

  • Inputs:

    • A[7:0]: 8-bit address input specifying the memory location to access (up to 256 locations).
    • D[7:0]: 8-bit bidirectional data lines for writing data (input) and reading data (output).
    • WE (Write Enable): 1-bit control input; activates write operation when HIGH.
    • OE (Output Enable): 1-bit control input; enables data output during read operations when HIGH.
    • CS (Chip Select): 1-bit control input; activates the RAM when HIGH.
  • Outputs:

    • D[7:0]: During read operations (CS=1, WE=0, OE=1), the data lines output the value stored at the specified address.

Configurable Parameters

  • Memory Size: The RAM capacity in DigiSim.io, with a default of 256×8 (256 addresses, 8 bits per address).
  • Initial Memory Contents: Optional preloaded values for simulation purposes.
  • Propagation Delay: The time delay between address/control signal changes and data output.

Visual Representation in DigiSim.io

The RAM is displayed as a rectangular block with clearly labeled inputs and outputs. Address inputs are typically on the left side, with data lines and control signals arranged for clarity. When connected in a circuit, the component visually indicates active operations and data flow through color changes on connecting wires. Some implementations may include a memory contents display for educational purposes.

Educational Value

Key Concepts

  • Memory Systems: Demonstrates how computers store and retrieve data.
  • Address Decoding: Illustrates the relationship between binary addresses and specific memory locations.
  • Data Storage: Shows how binary information is organized in computer memory.
  • Read/Write Timing: Explains the coordination of control signals for memory operations.
  • Memory Hierarchy: Introduces the concept of different types of memory in computer systems.

Learning Objectives

  • Understand the fundamental principles of random access memory.
  • Learn how to perform read and write operations using control signals.
  • Recognize the importance of memory in digital computing systems.
  • Apply RAM components to build data storage solutions in digital designs.
  • Comprehend the relationship between memory addresses and stored data.

Usage Examples/Scenarios

  • Data Storage: Storing variables and intermediate results in digital systems.
  • Lookup Tables: Implementing predefined data tables for function approximation or code conversion.
  • Buffer Memory: Creating temporary storage between digital system components with different speeds.
  • Program Storage: When preloaded, storing instructions for a processor to execute.
  • Memory-Mapped I/O: Implementing memory-addressed peripherals in computer systems.

Technical Notes

  • The RAM in DigiSim.io simulates the volatile nature of physical RAM, where data is lost when power is removed or the simulation is reset.
  • For proper operation, control signals must be properly sequenced according to the truth table.
  • Memory access requires consideration of timing parameters including address setup time and data hold time.
  • When not selected (CS=0) or when output is disabled (OE=0), the data lines enter a high-impedance state, allowing bus sharing with other devices.

Circuit Implementation Detail

Memory Cell Structure

SRAM Cell (6T):

6-Transistor SRAM cell structure:

  • T1, T2: Cross-coupled inverters forming bistable latch
  • T3, T4: Access transistors controlled by Word Line (WL)
  • T5, T6: Pull-down transistors
  • Bistable Storage: Cross-coupled inverters maintain state without refresh
  • Bit Lines (BL, BL̅): Differential sensing for noise immunity

DRAM Cell (1T1C):

1-Transistor, 1-Capacitor DRAM cell structure:

  • T: Access transistor controlled by Word Line (WL)
  • C: Storage capacitor holds charge representing data bit
  • Bit Line (BL): Reads/writes data through access transistor
  • Requires Refresh: Capacitor charge leaks, needs periodic refresh cycles
  • Higher Density: Simpler structure allows more memory per chip area

Address Decoding

Row and column decoders convert the address inputs into row and column select signals:

graph LR
    A03[Address A0-A3] --> RDEC[Row Decoder]
    A47[Address A4-A7] --> CDEC[Column Decoder]
    
    RDEC --> RS[Row Select 0-15]
    CDEC --> CS[Column Select 0-15]
    
    RS --> ARRAY[Memory Cell Array]
    CS --> ARRAY

Data Path

graph LR
    subgraph Read Operation
        CELL1[Memory Cell] --> SA[Sense Amplifier]
        SA --> OBUF[Output Buffer]
        OBUF --> DOUT[Data Output]
    end
    
    subgraph Write Operation
        DIN[Data Input] --> IBUF[Input Buffer]
        IBUF --> WD[Write Driver]
        WD --> CELL2[Memory Cell]
    end

Related Components

  • ROM (Read-Only Memory): Non-volatile memory that can only be read
  • PROM (Programmable ROM): One-time programmable memory
  • EPROM (Erasable PROM): Erasable using ultraviolet light
  • EEPROM/Flash Memory: Electrically erasable non-volatile memory
  • Register: Small, fast memory used for temporary data storage
  • Shift Register: Sequential memory with shifting capability
  • Memory Controller: Circuit that manages memory operations
  • Cache Memory: High-speed buffer memory between CPU and main memory
  • Address Decoder: Converts binary addresses to individual select lines
  • FIFO/LIFO Buffer: Special-purpose memory with first-in-first-out or last-in-first-out access

school Learning Path

arrow_back Prerequisites

arrow_forward Next Steps

help_outline Frequently Asked Questions

What is RAM?

RAM is volatile memory that can be read and written at any address. It stores both programs and data in computers, losing contents when power is removed.

How does RAM addressing work?

Address lines select which memory cell to access. With n address lines, RAM can have 2^n locations. Each location stores one word (8 bits in DigiSim).

play_arrow Run Live Circuit

See Other Components