ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Computer Organization and Assembly Language
    COMP3137
    Progress0 / 73 topics
    Topics
    1. Introduction to Computer Organization2. Assembly Language3. Comparison of Low-Level and High-Level Languages4. Register Types (16-bit): General Purpose and Special Purpose Registers5. Introduction and Usage of RAM6. Processor7. Registers8. System Bus9. Instruction Execution Cycle10. Assembly and Machine Language11. Assembler12. Linker and Link Libraries13. Programmer's View of a Computer System14. RISC and CISC Architecture15. Physical Address Calculation16. Basic Memory Organization17. CPU Organization18. Top Level View of Computer Function and Interconnection19. Assembler Instruction Cycle20. Execute Cycle21. Interrupts22. Interrupt Cycle23. Memory Connection24. Input/Output Connection25. CPU Connection26. MASM27. MIPS28. Defining Data in MASM Assembler29. Elements of Assembly Language30. Integer Constants31. Integer Expressions32. Real Number Constants33. Character Constants34. String Constants35. Reserved Words36. Identifiers37. Directives38. Instructions39. The NOP (No Operation) Instruction40. Adding and Subtracting Integer41. INC and DEC Instructions42. NEG Instruction43. How to Move Integer Number in Register44. Adding and Subtracting Numbers in Registers45. Declaration and Initialization of Variables46. Moving Data from Variable to Register47. Data Definition Statement48. BYTE and SBYTE Data49. WORD and SWORD Data50. Defining DWORD and SDWORD Data51. Knowledge about Different Data Types52. Operations, Array & Loops53. Division and Multiplication in Assembly54. Jumps Based on Specific Flags55. Jumps Based on Equality56. Simple Jump Statements57. Jumps Based on Specific Condition58. Code Examples59. Practice on MASM60. Procedures61. File Operations Procedures62. Labels in Procedures63. Stack64. Runtime Stack65. Conditional Control Flow Directives66. Compound Expressions67. Data Representation & Conversion68. Architecture69. Data Path70. Control Unit71. Critical Path72. General Principles of Pipelining73. Pipelined Y86 Implementations
    COMP3137›Introduction and Usage of RAM
    Computer Organization and Assembly LanguageTopic 5 of 73

    Introduction and Usage of RAM

    8 minread
    1,353words
    Intermediatelevel

    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 load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time8 min
      Word count1,353
      Code examples0
      DifficultyIntermediate