Document Details

VersatileUranus

Uploaded by VersatileUranus

Tags

computer memory cache memory data storage computer components

Full Transcript

COMPUTER COMPONENTS GROUP 1 GROUP 1 MEMBERS Alfred Giranyutha 670159 Alex Matindi Githinji 669169 Gideon Mutuku 670278 Daniella Chege 668832 Naggayi Shifrah Kasujja 669061 Nathaniel William Mwabili 670698 Christopher Mbugua 67...

COMPUTER COMPONENTS GROUP 1 GROUP 1 MEMBERS Alfred Giranyutha 670159 Alex Matindi Githinji 669169 Gideon Mutuku 670278 Daniella Chege 668832 Naggayi Shifrah Kasujja 669061 Nathaniel William Mwabili 670698 Christopher Mbugua 670920 TOPICS OF DISCUSSION 01 CACHE MEMORY 02 INTERNAL MEMORY 03 EXTERNAL MEMORY 04 INPUT/OUTPUT 01 MEMORY o Computer memory is a storage unit with numerous cells for storing data and instructions for processing, often referred to as RAM, main memory, or primary storage for the computer (Computer Memory, 2021). o Computer memory is crucial for device functionality, storing data and instructions, determining processing speed, enabling multitasking, optimizing CPU performance, and temporarily storing data, ensuring the computer operates as intended (Crucial, 2022) A. CACHE MEMORY o Cache memory is a small, high-speed storage area in a computer. The cache is a smaller and faster memory that stores copies of the data from frequently used main memory locations. o Cache memory combines the speed of fast memory with the large size of slower, cheaper memory. HOW DOES CACHE MEMORY WORK? There is a large, slow main memory and a small, fast cache memory. The cache holds copies of parts of the main memory. When the processor needs to read data, it first checks the cache. If the data is in the cache (a "cache hit"), it's delivered to the processor quickly. If the data isn’t in the cache (a "cache miss"), a block of data from the main memory is loaded into the cache and then delivered to the processor. Due to locality of reference, data fetched into the cache is likely to be used again soon. LEVELS OF CACHE Level 1 Cache / Primary Cache / L1 o This is the fastest smallest and closest to the CPU. It is often embedded into the processor chip as CPU Cache. o This level of cache transfers data and instructions in form of words, thus its extremely fast speed. Level 2 Cache / Secondary Cache / L2 o This is fast but slightly slower that primary cache. Its also more capacious that primary cache. L2 cache may be embedded on the CPU, or it can be on a separate chip. o This level of cache transfers data and instructions inform of blocks. Level 3 Cache / L3 o This is the slowest of the three levels of cache but it has the most capacity. o This level of cache also transfers data and instructions inform of blocks. CACHE ORGANIZATIONS TYPES OF CACHE I. Logical (Virtual) Cache Almost all processors, both non-embedded and many embedded, support virtual memory. Virtual memory allows programs to use memory without worrying about the physical memory size. Here's how it works: o Programs use virtual addresses in their instructions. o A hardware memory management unit (MMU) translates these virtual addresses into physical addresses in the main memory. o The cache can be placed either between the processor and the MMU (logical/virtual cache) or between the MMU and main memory (physical cache). TYPES OF CACHE I. Logical (Virtual) Cache TYPES OF CACHE II. Physical Cache Physical cache uses physical memory addresses but the accesses are slower since they go through the memory management unit (MMU). MAPPING FUNCTIONS o Cache mapping refers to a technique used the content present in the main memory is brought into the memory of the cache. o The process of cache mapping helps us define how a certain block that is present in the main memory gets mapped to the memory of a cache in the case of any cache miss. o Since there are fewer cache lines than main memory blocks, a mapping algorithm is needed. o There are three methods of cache mapping: i. Direct Mapping ii. Associative Mapping iii. Set Associative Mapping I. Direct Mapping o This is the simplest mapping method where each main memory block maps to one specific cache line. o Formula: i = j % m, where: i = cache line number j = main memory block number m = number of cache lines o The main memory address is divided into: A tag (most significant bits) A line field (next significant bits) A word/byte identifier (least significant bits) o This setup ensures efficient cache organization and helps in deciding which main memory blocks should occupy which cache lines. II. Associative Mapping o In fully associative type of cache memory, each location in cache stores both memory address as well as data. o Whenever a data is requested, the incoming memory address a simultaneously compared with all stored addresses using the internal logic the associative memory. o If a match is found, the corresponding is read out. Otherwise, the main memory is accessed if address is not found in cache. o This method is known as fully associative mapping approach because cached data is related to the main memory by storing both memory address and data in the cache. III. Set Associative Mapping o Set- associative mapping is a compromise that exhibits the strengths of both the direct and associative approaches while reducing their disadvantages. In this case, the cache consists of number sets FOR MORE INFORMATION, CHECK OUT THE LINK BELOW: https://youtu.be/V_QS1HzJ8Bc?si=XyRyJTHCDR5G-26b – Direct Mapping https://youtu.be/uwnsMaH-iV0?si=19RTHrADEkKBUKRV – Associative Mapping https://youtu.be/KhAh6thw_TI?si=4YVTXTwXRKld3oQw – Set Associative Mapping B. INTERNAL MEMORY (PRIMARY MEMORY) o Internal memory, also known as primary or main memory, is a computer's memory directly accessible by the CPU, storing data and instructions. It's typically volatile and faster than secondary memory, allowing quick retrieval of data and instructions. o Types of internal memory: i. Read- Only Memory (ROM) ii. Random Access Memory (RAM) iii. Cache Memory I. Read-only Memory o ROM is a non-volatile memory where the data and instructions are permanently stored and cannot be modified or erased. (Understanding RAM and DRAM Computer Memory Types, 2018) o ROM contains the basic instructions needed to start up the computer when it is powered on. o There are four types of ROM: 1.PROM (Programmable read-only memory): It can be programmed by the user. Once programmed, the data and instructions in it cannot be changed. 2. EPROM (Erasable Programmable read-only memory): It can be reprogrammed. To erase data from it, expose it to ultraviolet light. To reprogram it, erase all the previous data. I. Read-only Memory cont. 3. EEPROM (Electrically erasable programmable read-only memory): The data can be erased by applying an electric field, with no need for ultraviolet light. We can erase only portions of the chip. 4. MROM(Mask ROM): Mask ROM is a kind of read-only memory, that is masked off at the time of production. Like other types of ROM, mask ROM cannot enable the user to change the data stored in it. If it can, the process would be difficult or slow. II. Random Access Memory (RAM) o RAM is a volatile memory that can be read from and written to by the CPU. o RAM temporarily stores the data and instructions that the CPU is currently working on. o There are different types of RAM, including: 1. Dynamic RAM (DRAM): The most common type of RAM, which requires periodic refreshing to retain data. 2. Static RAM (SRAM): Faster than DRAM but more expensive, does not require refreshing. 3. Synchronous DRAM (SDRAM): Synchronizes memory speed with CPU clock speed. II. Random Access Memory (RAM) cont. 4. Double Data Rate SDRAM (DDR SDRAM): Doubles the bandwidth of SDRAM by transferring data on both clock edges. FUNCTIONS AND USES OF INTERNAL MEMORY 1. Storing Data and Instructions RAM stores CPU data and instructions, enabling quick retrieval and processing of information for running programs and applications. 2. Enabling Multitasking RAM provides temporary storage, enabling computers to switch between tasks and applications simultaneously, improving multitasking performance by allowing immediate access to more data. 3. Optimizing CPU Performance. Internal memory optimizes microprocessor performance by providing high- speed storage for quick data access, enhancing system responsiveness and performance compared to external storage. FUNCTIONS AND USES OF INTERNAL MEMORY (cont.) 4. Storing Temporary Data RAM stores data that is lost when power is turned off, ensuring efficient CPU performance by temporarily storing the data being processed. 5. Booting and Initializing the System ROM stores the necessary instructions and firmware for a computer to boot and load the operating system upon powering on. B. EXTERNAL MEMORY (SECONDARY MEMORY) o External memory, also known as secondary or auxiliary memory, is a non-volatile storage device that permanently stores data and programs, unlike primary memory (RAM) (Marget, 2022) o External memory devices offer non-volatile storage, large capacity, and slower access times compared to primary memory. They can be magnetic or solid-state, and can be portable or non-removable. They are commonly used for data backup, archiving, disaster recovery, and long-term storage of programs and files (Marget, 2022) o Types of external memory: i. Magnetic Storage Devices ii. Optical Storage Devices iii. Solid-State Storage Devices I. Magnetic Storage Devices o Hard Disk Drives (HDDs). Consist of circular magnetic disks (platters) that store data magnetically. Offer large storage capacities. o Tape Drives. Store data on magnetic tape, allowing for large volumes of data to be stored and accessed. o Floppy Disk Drives. Use flexible magnetic disks enclosed in a protective plastic casing, though not as commonly used today (Marget, 2022) II. Optical Storage Devices o CD Drives. Use laser technology to read and write data on compact discs (CDs). o DVD Drives. Can store 15 times more data than CDs, used for high- capacity multimedia storage. o Blu-ray Drives. Use a shorter wavelength laser than CDs/DVDs to store even more data, suitable for high-definition video. III. Solid-state Storage Devices o Solid-State Drives (SSDs). Use flash memory chips to provide faster data access and retrieval compared to HDDs, with no moving parts. o USB Flash Drives. Portable, removable solid-state storage devices that connect via USB. o Memory Cards. Removable solid-state storage cards used in devices like cameras, smartphones, and tablets (Marget, 2022) FUNCTIONS AND USES OF EXTERNAL MEMORY 1. Storage Expansion This refers to a storage system that extends beyond a computer's internal hard drive, enabling users to store large files, media collections, backups, and other unfitted data. 2. Data Backup and Archiving Regular backups of crucial files, documents, and system data protect against data loss, while long-term archiving of historical records and completed projects ensures data retention. 3. Data Transfer and Sharing This software facilitates file transfer between various devices and enables easy sharing of data, photos, videos, and other content. FUNCTIONS AND USES OF EXTERNAL MEMORY cont. 4. Entertainment and Gaming This offers storage for large media files like movies, music, and games, enabling users to conveniently carry their digital entertainment libraries. 5. Portable and Mobile Storage This product provides a portable, removable storage solution suitable for professionals, travelers, and those who need to access their data on the go. COMPUTER MEMORY COMPARISON BETWEEN INTERNAL AND EXTERNAL MEMORY CHARACTERISTIC INTERNAL MEMORY EXTERNAL MEMORY ACCESS SPEED Faster access times Slower access times VOLATILITY Volatile (loses data when Non-volatile (retains data when powered off) powered off) STORAGE TYPE Semiconductor memory (RAM, Magnetic (HDDs), optical ROM) (CDs/DVDs), solid-state (SSDs, flash drives) STORAGE CAPACITY Smaller storage capacities Larger storage capacities POWER Lower power consumption Higher power consumption CONSUMPTION COST More expensive per GB Less expensive per GB EXAMPLES RAM, ROM HDDs, SSDs, CDs, DVDs, USB drives PRIMARY FUNCTION Stores data and instructions for Stores data and programs for immediate use by CPU long-term retention and archiving INTERACTION WITH Directly accessible by CPU Not directly accessible by CPU CPU PORTABILITY Embedded within computer Slower access times FOR MORE INFORMATION, CHECK OUT THE LINK BELOW: How computer Memory works. https://www.youtube.com/watch?v=p3q5zWCw8J4 (TED-Ed, 2016) 02 INPUT / OUTPUT INTRO. TO INPUT / OUTPUT MODULES I/O modules are essential parts of the computer and industrial control and act as an interface between a computer or controller and other gadgets. These modules are the channels through which data is transmitted and received with different peripherals inclusive of sensors, actuators, display and other I/O devices. Some types of I/O modules are: i. Digital I/O Modules ii. Analog I/O Modules iii. Specialty I/O Modules TYPES OF I/O MODULES I. Digital I/O Modules Digital Input Modules: These modules entail inputs from other external equipments like switches and or sensors encompassing a form that can be understood by the computer or controller. Digital Output Modules: These modules convert digital information and supply operational signals to exterior devices including LEDs and relays. II. Analog I/O Modules Analog Input Modules: These modules are involved in the process of converting the analog input which may be in form of voltage or currents from the sensors into digital format. Analog Output Modules: These modules take the data from the computer or controller in digital format and supply it in analog form to control gears such as, actuator and variable speed drives. III. Speciality I/O Modules These modules exercise definite tasks like networking with other network like Profibus, Modbus, temperature control, etc. FUNCTIONS AND FEATURES 1. Signal Conversion: I/O modules enable signal into another form of signal (for instance, analog to digital and; digital to analog) with a purposed of making it easier for the devices to communicate. 2. Isolation: For the prevention of the computer or the controller’s interference by the electrical noise or its damage, the I/O module happens to have an electrical isolation between the input/output and the processing unit. 3. Signal Conditioning: This relates to the manipulation of measures to qualify the signals in the right form and in the right range that can be processed. 4. Multiplexing: Certain I/O modules are expandable wherein several input or output signals can be managed by a single module there by minimizing on the use of modules in a system. FUNCTIONS AND FEATURES cont. 5. Error Detection and Reporting: Additional features of the advanced I/O modules are in the detection of errors occurring in the transmission of signals and reporting of the same in matters concerning data integrity. INPUT / OUTPUT PROCESSES o Three methods can be used for input-output processes: i. Direct memory access ii. Programmed input output iii. Interrupt input output o For this case we shall talk about the programmed I/O. Under this method, a computer program's instructions aid the data transfer process. The I/O module and the processor communicate via data. A program that grants the Central Processing unit (CPU) direct control over the I/O operation is executed by the processor. The processor has to wait until the I/O operation is finished before sending an instruction to the I/O module. This is a waste of processing time if the processor is quicker than the I/O module. The processor is in charge of taking data out or extracting data from the main memory for output and putting data in main memory for input when it comes to programmed I/O. I. PROGRAMMED INPUT / OUTPUT o When the CPU is running a program and comes across an instruction that has to do with input/output, it sends a command to the relevant input/output module to carry out the instruction. When I/O is programmed, the required action is carried out by the I/O module, which subsequently sets the relevant bits in the I/O register. This is shown in the figure 7.4 below. I. PROGRAMMED I/O cont. o Since the I/O module does not interrupt the processor, the processor must periodically check the I/O module until it determines that the operation is finished. To understand the programmed, I/O technique, we must first consider it from the perspectives of the I/O commands that the processor issues to the I/O module and the I/O instructions that the processor actually executes. Input / Output Commands o When an I/O module is addressed by the processor, it can receive one of four types of I/O instructions. The address provided by the processor specifies the specific I/O module, external device, and I/O command that must be executed in order to carry out an I/O activity. o These commands the following: i. Control: Used to instruct and activate peripheral devices. These instructions are specific to a given class of peripheral device. ii. Test: Utilized for testing different I/O module and peripheral state circumstances. iii. Read: Causes a piece of data to be pulled from the peripheral by the I/O module and stored in an internal buffer. iv. Write: Causes a data item to be taken from the data bus by the I/O module and then sent to the peripheral. Input / Output Instructions o When I/O is programmed, the instructions relating to I/O that the processor retrieves from memory and the commands it gives to an I/O module to carry out the instructions are closely matched. That is, there is frequently a straightforward one-to-one correspondence and the instructions are simply mapped into the I/O commands. Instruction format is dependent on how external devices are addressed. o Usually, the system is connected to a large number of I/O devices via I/O modules. An address or unique identifier is assigned to each device. The address of the desired device is included in the I/O command that the processor issues. As a result, in order to ascertain if a command is for itself, each I/O module must parse the address lines. o Two modes of addressing are possible when the processor, main memory and I/O share a common bus and they include Memory-mapped and Isolated. II. DIRECT MEMORY ACCESS o Used when large quantities of data are to be moved. It acts like the processor and can take over control of the system from the processor to transfer data to and from the memory through the system bus. It uses the bus if the processor does not need it, or it forces the processor to suspend operation temporarily through a technique called Cycle stealing. When the processor wishes to read/write data it gives the DMA some instructions including: o If the read/write is requested using the read/write control line between the processor and the DMA module, the address of the I/O device involved communicated on the data lines, the starting location in memory to read from or write to communicated on data lines and stored by DMA module in its address register, The number of words to be read or written, again communicated via the data lines and stored in the data count register II. DIRECT MEMORY ACCESS cont. o The CPU assigns the I/O operation to the DMA module. The DMA transfers data one word at a time directly from memory without going through the processor after transfer completion it sends interrupt signals to the CPU thereby only involving it at the start and end of the transfer. III. INTERRUPT-DRIVEN I/O o Programmed I/O can lower a system’s performance, due to the constant waiting involved; the processor gets stuck in a loop of checking the status of the I/O device, wasting valuable CPU cycles (Stallings, 2016). Therefore, alternative I/O techniques, such as the Interrupt-driven I/O, were developed. o In the interrupt-driven I/O technique, the processor issues an I/O command to a module and proceeds with useful tasks. The I/O module, when ready for data transfer, interrupts the CPU. The CPU then pauses its current task, handles the data transfer, and resumes its work. o The figure below shows the use of interrupt I/O for reading in a block of data, compared with programmed I/O (figure 2) (Nafas). It is more efficient since it gets rid of unnecessary waiting. However, it still consumes a lot of processor time, as every word of data that goes from memory to I/O module or vice versa must pass through the processor. III. INTERRUPT-DRIVEN I/O cont. THANK YOU FOR LISTENING ANY QUESTIONS? REFERENCES Stallings, W. (2013). Computer organization and architecture: Designing for performance (9th international ed.). Boston, MA: Pearson Computer Memory. (2021, June 1). GeeksforGeeks. https://www.geeksforgeeks.org/computer-memory/ Crucial. (2022). What Does Computer Memory (RAM) Do? Crucial. https://www.crucial.com/articles/about- memory/support-what-does-computer-memory-do Marget, A. (2022, November 15). Secondary Storage: Definition, Devices and How It Can Support Your Backup Strategy. Unitrends. https://www.unitrends.com/blog/secondary-storage TED-Ed. (2016). How computer memory works - Kanawat Senanan [YouTube Video]. In YouTube. https://www.youtube.com/watch?v=p3q5zWCw8J4 Understanding RAM and DRAM Computer Memory Types. (2018). Atpinc.com. https://www.atpinc.com/blog/computer-memory-types-dram-ram-module Nafas, M. (n.d.). Computer Architecture Input/Output System. Stallings, W. (2016). Computer Organization and Architecture 10th edition. New Jersey: Pearson Education.

Use Quizgecko on...
Browser
Browser