ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP3137Introduction Usage Ram
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP3137

    Computer Organization and Assembly Language

    Progress0 / 73 done
    Topics73
    1Introduction to Computer Organization2Assembly Language3Comparison of Low-Level and High-Level Languages
    4General Purpose and Special Purpose Registers5Introduction and Usage of RAM6Processor7Registers8System Bus9Instruction Execution Cycle10Assembly and Machine Language11Assembler12Linker and Link Libraries13Programmer's View of a Computer System14RISC and CISC Architecture15Physical Address Calculation16Basic Memory Organization17CPU Organization18Top Level View of Computer Function and Interconnection19Assembler Instruction Cycle20Execute Cycle21Interrupts22Interrupt Cycle23Memory Connection24Input/Output Connection25CPU Connection26MASM27MIPS28Defining Data in MASM Assembler29Elements of Assembly Language30Integer Constants31Integer Expressions32Real Number Constants33Character Constants34String Constants35Reserved Words36Identifiers37Directives38Instructions39The NOP (No Operation) Instruction40Adding and Subtracting Integer41INC and DEC Instructions42NEG Instruction43How to Move Integer Number in Register44Adding and Subtracting Numbers in Registers45Declaration and Initialization of Variables46Moving Data from Variable to Register47Data Definition Statement48BYTE and SBYTE Data49WORD and SWORD Data50Defining DWORD and SDWORD Data51Knowledge about Different Data Types52Operations, Array & Loops53Division and Multiplication in Assembly54Jumps Based on Specific Flags55Jumps Based on Equality56Simple Jump Statements57Jumps Based on Specific Condition58Code Examples59Practice on MASM60Procedures61File Operations Procedures62Labels in Procedures63Stack64Runtime Stack65Conditional Control Flow Directives66Compound Expressions67Data Representation & Conversion68Architecture69Data Path70Control Unit71Critical Path72General Principles of Pipelining73Pipelined Y86 Implementations
    8 min read
    Topic 5 of 73
    Topic Study Note Illustration
    05

    Introduction and Usage of RAM

    RAM (Random Access Memory) is a type of volatile memory used by computers and other devices to store data that is actively being used or processed. It...

    Introduction to RAM (Random Access Memory)

    RAM (Random Access Memory) is a type of volatile memory used by computers and other devices to store data that is actively being used or processed. It is called random access because the CPU can access any byte of memory directly, without having to go through other bytes sequentially. This makes RAM incredibly fast compared to other forms of storage like hard drives or solid-state drives (SSDs).

    RAM is essential for the overall speed and performance of a computer, as it temporarily holds data that the CPU needs in real-time. When you run an application or open a file, the data is loaded from storage (like an SSD or HDD) into RAM, so the CPU can access and process it quickly.


    Types of RAM

    There are two main types of RAM used in modern computers:

    1. DRAM (Dynamic RAM):

      • Most Common: DRAM is the most common type of RAM found in personal computers. It stores each bit of data in a separate capacitor within an integrated circuit, which needs to be refreshed periodically (hence the term "dynamic").
      • Slower than SRAM: DRAM is slower than SRAM (another type of RAM) but is less expensive to manufacture, making it ideal for use as the main memory in computers.
      • Volatile: Like all RAM, DRAM is volatile, meaning it loses all stored data when the power is turned off.
    2. SRAM (Static RAM):

      • Faster, More Expensive: SRAM is faster and more reliable than DRAM because it doesn't need to be refreshed. It stores data using flip-flops (bistable latches), which makes it quicker to access. However, it's more expensive and less dense, so it is typically used for cache memory or in small amounts where speed is critical.
      • Uses: SRAM is commonly used in CPU caches (L1, L2, and L3 caches) to provide fast access to frequently used data.

    Key Characteristics of RAM

    1. Volatility:

      • Volatile Memory: RAM is volatile, meaning it requires constant power to retain data. When the computer is turned off or loses power, all data stored in RAM is lost.
    2. Speed:

      • Fast Access: RAM is much faster than other storage devices like hard drives (HDDs) and solid-state drives (SSDs). The CPU can directly read and write data to RAM in nanoseconds, which is why it is used to store data that needs to be accessed frequently.
      • Latency: RAM has low latency, which means the time it takes to access a specific piece of data is minimal.
    3. Capacity:

      • Limited Size: RAM is typically limited in size compared to storage devices. Computers generally have a few gigabytes (GB) to tens of gigabytes of RAM, depending on the system's requirements.
      • Expandable: On desktop computers, you can often add more RAM to increase capacity. Mobile devices and laptops have less flexibility, though.
    4. Temporary Storage:

      • Temporary Data: RAM is used for storing temporary data while applications are running. It can store active program data, operating system data, and recently accessed files.

    Usage of RAM in a Computer

    1. Running Programs and Applications

    When you launch a program (like a web browser, word processor, or game), the data related to that program is loaded from the hard drive or SSD into RAM. This allows the CPU to access the program's data quickly. Since RAM is much faster than a storage device, it speeds up program execution by providing fast access to the instructions and data the CPU needs.

    For example:

    • When you open a document in a word processor, the file is loaded from your hard drive into RAM. The processor can then quickly modify the file and display it to you.

    2. Operating System (OS) Management

    The operating system (OS) also resides in RAM while the computer is running. The OS manages memory allocation for different processes and coordinates the use of resources by the CPU. The OS needs to access its data quickly in order to function smoothly and keep everything running efficiently.

    For example:

    • The OS stores system processes like the kernel, system drivers, and other essential functions in RAM. The OS constantly manages memory allocation by moving data in and out of RAM as needed, ensuring that there’s enough memory for active tasks.

    3. Data Caching

    Modern CPUs often use caches (which are small, fast memory areas) to store frequently accessed data. However, when the CPU cache is full or data is not available in the cache, it accesses RAM for further data.

    For example:

    • When playing a video, some frames are cached in RAM, so that the CPU can quickly retrieve and process the next frame without having to read it from the slower storage device.

    4. Temporary Storage for Files

    Whenever you edit a file or work with data, it is loaded into RAM from your storage device. For instance, if you are working on an image, video, or text document, the changes you make are reflected in RAM before being saved back to disk.

    For example:

    • Text Editing: As you type in a word processor, the text is stored in RAM temporarily. When you save the document, it is written to your hard drive or SSD.

    5. Virtual Memory (Paging)

    If your system runs out of RAM, it can use a portion of the hard drive or SSD as "virtual memory" through a process called paging. This allows the computer to temporarily move less-used data from RAM to storage, freeing up space for more critical data. While this extends memory capacity, it is much slower than using RAM.

    For example:

    • When running multiple programs at once, and RAM becomes full, the operating system might move parts of data from RAM to a file on the hard disk (called swap space), allowing the system to continue running without crashing.

    Factors Affecting RAM Performance

    Several factors can influence the performance of RAM:

    1. Clock Speed: RAM has a clock speed (measured in MHz or GHz), which determines how fast it can transfer data. Faster RAM improves the overall speed of the system.

    2. Capacity (Size): More RAM means more data can be stored for immediate access by the CPU. Having more RAM allows for running more applications simultaneously or processing larger datasets.

    3. Latency (CAS Latency): CAS Latency (Column Address Strobe Latency) is a measure of how many clock cycles it takes to retrieve data from RAM once a request has been made. Lower latency is better for performance.

    4. Memory Channels: RAM can operate in single, dual, or quad-channel configurations. Multi-channel RAM improves data transfer speeds between the CPU and RAM by allowing multiple data streams.


    RAM vs. Other Types of Memory

    Feature RAM Hard Drive (HDD) Solid-State Drive (SSD)
    Speed Very fast (nanoseconds) Slow (milliseconds) Faster than HDD, but slower than RAM
    Volatility Volatile (data is lost when power is off) Non-volatile (data is saved when off) Non-volatile (data is saved when off)
    Capacity Small (GBs to tens of GBs) Large (hundreds of GBs or TBs) Large (hundreds of GBs or TBs)
    Usage Active program data, OS, system processes Permanent storage for files and apps Permanent storage for files and apps
    Cost More expensive per GB Less expensive per GB More expensive than HDD, but cheaper than RAM

    Summary

    • RAM (Random Access Memory) is critical for the functioning of any computing device, providing fast, temporary storage for data and instructions that the CPU is currently using.
    • General Usage: RAM is used for running programs, storing operating system data, caching frequently used data, and holding temporary files that you are working on.
    • Types of RAM: The two main types are DRAM (more common, slower, cheaper) and SRAM (faster, used in cache).
    • Performance Factors: RAM performance is affected by factors like clock speed, capacity, and latency.
    • Memory Hierarchy: While RAM is faster than storage devices like HDDs and SSDs, it is still limited in size. Virtual memory helps extend RAM usage by swapping data to storage when necessary, but it’s much slower than using physical RAM.

    Understanding how RAM works and its role in your computer can help you appreciate why having sufficient memory is essential for smooth and efficient performance, especially when running multiple applications or working with large files.

    ← Previous topic 4
    Register Types (16-bit): General Purpose and Special Purpose Registers
    Next topic 6 →
    Processor

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    8mremaining
    1.4kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Computer Organization and Assembly Language