5.1 Semiconductor Main Memory

COS2621 - Computer Organisation · 5. Internal Memory

5. Internal Memory

5.1 Semiconductor Main Memory

Semiconductor main memory is crucial in computer architecture as it stores data and instructions required by the CPU to perform tasks. This memory type is built from semiconductor materials and is known for its speed and efficiency.

Types of Semiconductor Memory

There are two main types of semiconductor memory: volatile and non-volatile memory. Volatile memory loses its contents when power is turned off, while non-volatile memory retains its data even without power.

Volatile Memory

The most common type of volatile memory is Dynamic Random Access Memory (DRAM). DRAM stores each bit of data in a separate capacitor within an integrated circuit. Because capacitors leak charge, DRAM must be refreshed periodically to maintain data integrity.

Non-Volatile Memory

Non-volatile memory includes Flash memory and Read-Only Memory (ROM). Flash memory is commonly used in USB drives and solid-state drives (SSDs), allowing for data storage without power. ROM is used to store firmware, which is software closely tied to specific hardware.

Memory Organisation

Memory is organised in a hierarchical structure. At the top are the CPU registers, which are the fastest but have limited capacity. Below that is cache memory, which is faster than main memory but smaller. Main memory (DRAM) is larger but slower than cache. The main memory plays a critical role in data storage within a computer system.

Remember: The main memory stores data and instructions.

Accessing Memory

Memory access occurs through a memory address. Each byte in memory has a unique address that the CPU uses to read or write data. The process involves sending the address to the memory unit and receiving the data back.

Example: Memory Access

Consider a scenario where the CPU needs to read data from memory address 0x1A2B. The steps are as follows:

  1. The CPU places the address 0x1A2B on the address bus.
  2. The memory unit receives the address and retrieves the data stored at that location.
  3. The data is sent back to the CPU via the data bus.

Memory Organisation Examples

To understand memory organisation, consider the following scenarios:

  • With a 10-bit address space, the maximum number of unique addresses is 2^10 = 1024. If each cell is 8 bits, this organisation is valid.
  • A 10-bit address with 1024 cells and a 12-bit cell size is also valid, as it can address 1024 cells of 12 bits each.

Watch out: A 9-bit address with 1024 cells and a 10-bit cell size is impossible because the maximum addressable cells would be only 2^9 = 512.

Error Correction in Memory

Errors in memory can occur due to various reasons, such as electrical interference or physical defects. To ensure data integrity, error correction codes (ECC) are used. ECC can detect and correct single-bit errors in memory.

Example: ECC Implementation

Suppose a memory system uses a simple parity bit for error detection. If a byte of data is 1011001, the parity bit is calculated as follows:

Number of 1s = 4 (even) → Parity bit = 0. Thus, the transmitted data is 10110010. If the data received has an odd number of 1s, an error is detected.

Summary

  • Semiconductor main memory is crucial for storing data and instructions.
  • It can be volatile (like DRAM) or non-volatile (like Flash memory).
  • Memory access involves addressing and retrieving data.
  • Error correction codes help maintain data integrity.

Check your understanding

  • What is the main difference between volatile and non-volatile memory?
  • Describe the role of error correction codes in memory.
  • Explain how the CPU accesses a specific memory address.

Test yourself

5 quick questions on this lesson. Pick an answer to see if you're right.

  1. 1. Which one of the following memory organisations is impossible? Explain why the others are possible.

  2. 2. In a memory access operation, what does the CPU place on the address bus?

  3. 3. What is the purpose of error correction codes (ECC) in memory systems?

  4. 4. Which type of semiconductor memory must be refreshed periodically to maintain data integrity?

  5. 5. What type of memory loses its content when the power is turned off?