What Every Programmer Should Know About Memory

This forum is aimed at students with little or no programming experience. It aims to provide students with an understanding of the role computation can play in solving problems.
Forum rules
This forum aims to provide material related to computer programming languages, tools and designs.

Re: What Every Programmer Should Know About Memory

Unread postby Danyal Ijaz » Fri May 15, 2015 10:24 pm

:SALAM:
Name:Danyal Ijaz
CMS: 14046
Section: A
What Every Programmer Should know about Memory
Abstract:
In the early days computers were much simpler. The various components of a system, such as the CPU, memory, mass storage, and network interfaces, were developed together and, as a result, were quite balanced in their performance. For example, the memory and network interfaces were not (much) faster than the CPU at providing data. In the field of Computer when we heard about the word memory the first thing that came in our mind is the memory of our computer i.e. RAM or ROM. As we all know that the cores of modern CPU has become so fast and efficient and the factor of limitation has become very small because of the vast ability of our CPU. The designers have come up with even more complicated memory control and the techniques of acceleration i.e. the crashes of CPU, but it also has a drawback that it cannot work properly without the help of a computer programmer. It’s our hard luck that neither the price of using the subsystem of memory nor the caches or its structure is fully understandable by the programmers of this generation.

Introduction:
Now-a-days has become a very importing yet effective tool in everybody’s life. If we see around us almost 80% things are working on the principles of programming. It has made our life very easy & it has also compressed our big problems in the form of short coding so one can say that without programming it’s very difficult to survive in this age of modern technology. So for a programmer like its compulsory for him to learn the programming techniques it’s also has become very important to learn about the memory, and to learn about the memory the 1st thing that comes in my mind is every software developer should know about the Character Sets and The Unicodes. As the programmers of modern era we must also fully aware about the DRAM (Dynamic random access memory), SRAM (Static random access memory) and DMA (Direct memory access) because they all play a very important role in our programming. A programmer should also have the knowledge about hardware design of Ram and Memory controller designs. So if you want to become a successful programmer you just not know but you have to professionally learn and should know each and every thing about the memory.
User avatar
Danyal Ijaz
 
Posts: 4
Joined: Fri May 15, 2015 9:39 pm
Has thanked: 0 time
Been thanked: 0 time

Re: What Every Programmer Should Know About Memory

Unread postby MUHAMMAD IBRAHIM » Sat May 16, 2015 11:58 am

MUHAMMAD IBRAHIM
CMS#14040


What Every Programmer Should Know About Memory:
As CPU cores become both faster and more numerous, the limiting factor for most programs is now, and will be for some time, memory access. Hardware designers have come up with ever more sophisticated memory handling and acceleration techniques–such as CPU caches–but these cannot work optimally without some help from the programmer. Unfortunately, neither the structure nor the cost of using the memory subsystem of a computer or the caches on CPUs is well understood by most programmers. This paper explains the structure of memory sub-systems in use on modern commodity hardware, illustrating why CPU caches were developed, how they work, and what programs should do to achieve optimal performance by utilizing them.

COMPUTER MEMORY :
• The CPU contains the basic instructions needed to operate the computer; but it cannot store entire programs or large sets of data permanently. The CPU needs to have millions (or even trillions, in some computers) of bytes of space where it can quickly read or write programs and data while they are being used. This area is called memory, and it consists of chips either on the motherboard or on a small circuit board attached to the motherboard. This electronic memory allows the CPU to store and retrieve data quickly.
TYPES OF COMPUTER MEMORY:
There are two types of built-in memory.
1, VOLATILE MEMORY(Non-permanent)
2, NON VOLATILE MEMORY.(permanent)
VOLATILE MEMORY • Volatile memory is a type of storage whose contents are lost when the system's power is turned off or interrupted . For example, RAM is volatile; meaning users will lose a document if they do not save their task to a non-volatile memory, such as a hard drive, before unplugging the computer. This type of memory need power to store data.
• There are several types of volatile memory:
• Ram, cache, register and virtual memory.
3. RAM (Random Access Memory) :
• Ram is stands for "random access memory". It stores temporarily information and it is also known as memory for short term. RAM simply holds data for the processor.
TYPES OF RAM:
There are four types of Ram which are shown below:
• SDRAM
• DDR SDRAM
• DDR2 SDRAM
• DDR3 SDRAM
SDRAM :
SDRAM stands for synchronous dynamic random access memory. SDRAM is a single data rate meaning that SDRAM can accept one command and transfer one word of data per clock cycle, typical speeds of SDRAM are 100 and 133 mhz.
DDR RAM:
DDR SDRAM stands for double data rate synchronous dynamic random access memory. DDR RAM transfers data twice per clock cycle, hence the name double data rate. DDR clock speeds range between 200 MHz (DDR-200) and 400 MHz (DDR- 400). DDR-200 transfers 1600 MB/s, while DDR-400 transfers 3200 MB/s.
DDR2 SDRAM:
DDR2 SDRAM stands for double data rate 2 synchronous dynamic random access memory.DDR2 is twice as fast as DDR which means twice as much data is carried to the module for each clock cycle. DDR2 speeds range between 400 MHz (DDR2-400) and 800 MHz (DDR2-800). DDR2-400 transfers 3200 MB/s. DDR2-800 transfers 6400 MB/s. DDR3 SDRAM:
DDR3 SDRAM stands for, double data rate 3 synchronous dynamic random access memory. In theory DDR3 is supposed to act twice as fast as DDR2 memories. Thus DDR3 speeds range between 800 MHz (DDR3-800) and 1600 MHz (DDR3-1600). DDR3-800 transfers 6400 MB/s; DDR3-1600 transfers 12800 MB/s.
4. CACHE:
• Cache memory, also called CPU memory a computer microprocessor can access more quickly than it can access regular RAM as the microprocessor processes data, it looks first in the cache memory and if it finds the data there (from a previous reading of data), it does not have to do the more time-consuming reading of data from larger memory. It is small amount of memory and expensive too.
5. REGISTERS:
• In computer architecture, a processor register is a small amount of storage available as part of a digital processor, such as a CPU. Such registers are (typically) addressed by mechanisms other than main memory and can be accessed faster. It is more expensive and fastest than cache.



TYPES OF REGISTER:
There are two types of registers.
1. MEMORY BUFFER REGISTER
2. MEMORY ADDRESS REGISTER
• MAR:
MAR STAND FOR MEMORY ADDRESS REGISTER .This register holds the memory addresses of data and instructions. This register is used to access data and instructions from memory during the execution phase of an instruction. For example, CPU wants to store some data in the memory or to read the data from the memory. It places the address of the-required memory location in the MAR.
• MEMORY BUFFER REGISTER :
MBR stand for memory buffer register. This register holds the contents of data or instruction read from, or written in memory. It means that this register is used to store data/instructions coming from the memory or going towards the memory.
6. VIRTUAL MEMORY :
• An imaginary memory area supported by some operating systems (for example, windows but not DOS) in conjunction with the hardware. You can think of virtual memory as an alternate set of memory addresses. Programs use these virtual addresses rather than real addresses to store instructions and data. When the program is actually executed, the virtual addresses are converted into real memory addresses.

7. NON VOLATILE MEMORY :
• Non-volatile memory is computer memory that can get back stored information even when not powered. • There are several type of non-volatile memory.
1. Rom memory
2. Flash memory.
3. ROM( READ ONLY MEMORY):
• Rom is stand for “read only memory”. It stores permanently information. It is known as long term memory. Rom contains the programming that allows your computer to be "booted up" or regenerated each time you turn it on



8. FLASH MEMORY
• Flash memory is an electronic computer storage medium that can be electrically erased and reprogrammed it is introduced by Toshiba in 1984, flash memory was developed from EEPROM (electrically erasable programmable read-only memory).


9. TYPES OF ROM(READ ONLINE MEMORY)
THERE ARE THREE TYPES OF ROM…
1. PROM
2. EPROM
3. EEPROM
10. PROM,EPROM AND EEPROM:
• PROM:
This type of ROM can be re-programmed by using a special device called a PROM programmer. Generally, a PROM can only be changed/updated once.
• EPROM:
This type of ROM can have its contents erased by ultraviolet light and then reprogrammed by an RPROM programmer. This procedure can be carried out many times; however, the constant erasing and rewriting will eventually render the chip useless.

• EEPROM:
This type of ROM works in a similar way to flash memory in that it can its contents can be 'flashed' for erasure ad then written to without having to remove the chip from its environment. EEPROM are used to store a computer system's BIOS, and can be updated without returning the unit to the factory. In many cases, BIOS updates can be carried out by computer users wishing a BIOS update.
User avatar
MUHAMMAD IBRAHIM
 
Posts: 3
Joined: Sat May 16, 2015 11:15 am
Has thanked: 0 time
Been thanked: 0 time

Re: What Every Programmer Should Know About Memory

Unread postby hassaan » Mon May 18, 2015 1:18 pm

In the early days computers were much simpler and due to that the various components of a system such as the CPU,memory,mass storage,and networks were developed together and in the result were quite balanced in their performance. For eg the memory and network interfaces were not much faster than the CPU at providing data.This situation changed once the basic structure of computers and hardware developers worked on optimizing individual systems.Suddenly the performance of some components of the computer fell significantly behind and sucess developed. This was specially true for mass storage and memory subsystems which for cost reasons improved more slowly relative to other components.
Unlike storage subsystems removing the main memory has proven much more difficult and almost all solutions require changes to the hardware. Today these changes mainly come in the following forms.RAM hardware design,Memory controller designs,CPU caches,Direct memory access for devices.
When it came to operating system specific details and solutions.The text described Linux.At no time will it contain any information about other OS's.
The technology discussed here exists in many, many variations in the real world and this paper only addresses the most common, mainstream versions. It is rare that absolute statements can be made about this technology thus the qualifiers. SO that every programmer should know about the memory else he can not play with the computer.
hassaan
 
Posts: 2
Joined: Mon May 18, 2015 12:43 pm
Has thanked: 0 time
Been thanked: 0 time

Re: What Every Programmer Should Know About Memory

Unread postby qandeel.malik » Sat May 23, 2015 2:30 pm

What Every Programmer Should Know About Memory
Qandeel Ahmad
CMS 14045
Abstract:

A memory is just like a human brain. It stores data and instructions. Computer memory is the storage space in computer where data is to be processed and instructions are required for processing. The memory is divided into large number of small parts called cells. Each location or cell has a unique address which varies from zero to memory size minus one. For example if computer has 64k words, then this memory unit has 64 * 1024=65536 memory locations. The address of these locations varies from 0 to 65535.
Memory is primarily of three types
Cache Memory
Primary Memory/Main Memory
Secondary Memory
Introduction:
In the early days computers were much simpler. The various components of a system, such as the CPU, memory, mass storage, and network interfaces, were developed together and, as a result, were quite balanced in their performance. For example, the memory and network interfaces were not much faster than the CPU at providing data.
This situation changed once the basic structure of computers stabilized and hardware developers concentrated on optimizing individual subsystems. Suddenly the performance of some components of the computer fell significantly behind and bottlenecks developed. This was especially true for mass storage and memory subsystems which, for cost reasons, improved more slowly relative to other components.
The slowness of mass storage has mostly been dealt with using software techniques: operating systems keep most often used (and most likely to be used) data in main memory, which can be accessed at rate orders of magnitude faster than the hard disk. Cache storage was added to the storage devices themselves, which requires no changes in the operating system to increase performance.
Unlike storage subsystems, removing the main memory as a bottleneck has proven much more difficult and almost all solutions require changes to the hardware. Today these changes mainly come in the following forms:
• RAM hardware design (speed and parallelism).
• Memory controller designs.
• CPU caches.
• Direct memory access (DMA) for devices.
When it comes to operating-system-specific details and solutions, the text exclusively describes Linux. At no time will it contain any information about other OSes. The author has no interest in discussing the implications for other OSes. If the reader thinks s/he has to use a different OS they have to go to their vendors and demand they write documents similar to this one.
User avatar
qandeel.malik
 
Posts: 3
Joined: Sat May 23, 2015 9:24 am
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to Computer Sciences & Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron