Pseudo-polynomial time: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
No edit summary
 
Line 1: Line 1:
'''Memory refresh''' is the process of periodically reading information from an area of [[computer memory]], and immediately rewriting the read information to the same area without modification, for the purpose of preserving the information.<ref name="Laplante">"refresh cycle" in {{cite book 
Hello. Let me introduce the author. Her name is Refugia Shryock. Puerto Rico is where he's always been living but she requirements to transfer simply because of her family members. To collect cash is what his family and him enjoy. In her professional lifestyle she is a payroll clerk but she's usually needed her own business.<br><br>Take a look at my homepage :: [http://xrambo.com/user/NEme std testing at home]
  | last = Laplante
  | first = Phillip A.
  | authorlink =
  | coauthors =
  | title = Comprehensive Dictionary of Electrical Engineering
  | publisher = Springer
  | year = 1999
  | location =
  | pages = 540
  | url = http://books.google.com/books?id=soSsLATmZnkC&pg=PA540&lpg=PA540&dq=%22memory+refresh%22+dictionary&source=bl&ots=0yuT8r7cBG&sig=dE4lh_ndkANrxa_P6JKb35fij7s&hl=en&sa=X&ei=qk47UKi-FobqiwLY2YDYBA&ved=0CDsQ6AEwAg#v=onepage&q=%22memory%20refresh%22&f=false
  | doi =
  | id =
  | isbn = 3540648356}}</ref>    Memory refresh is required in semiconductor [[dynamic random access memory]] (DRAM), the most widely used type of computer memory, and in fact is the defining characteristic of this class of memory.<ref name="Ganssle">{{cite book 
  | last = Ganssle
  | first = Jack Ganssle
  | authorlink =
  | coauthors = Tammy Noergaard, Fred Eady, Lewin Edwards, David J. Katz
  | title = Embedded Hardware
  | publisher = Newnes
  | year = 2007
  | location =
  | pages = 106
  | url = http://books.google.com/books?id=HLpTtLjEXqcC&pg=PA106&lpg=PA106&dq=refresh+SRAM+DRAM&source=bl&ots=ANCVz6F6JV&sig=-r0FYJk3d5cbVU3epimxCCBSLzQ&hl=en&sa=X&ei=alA7UP7uO-eBiwLCjIHgBg&ved=0CFQQ6AEwBg#v=onepage&q=refresh%20SRAM%20DRAM&f=false
  | doi =
  | id =
  | isbn = 0750685840}}</ref>  In a DRAM chip, each [[binary digit|bit]] of memory data is stored as the presence or absence of an [[electric charge]] on a small [[capacitor]] on the chip.<ref name="Ganssle" /><ref name="Jacob">{{cite book 
  | last = Jacob
  | first = Bruce
  | authorlink =
  | coauthors = Spencer Ng, David Wang
  | title = Memory Systems: Cache, DRAM, Disk
  | publisher = Morgan Kaufmann
  | year = 2007
  | location =
  | pages = 431–432
  | url = http://books.google.com/books?id=SrP3aWed-esC&pg=PA826&lpg=PA826&dq=DRAM+%22refresh+time%22+millisecond&source=bl&ots=4PY6yJIIyE&sig=VowDJ3iFrdWkDa1iDfeHJh_5Q0k&hl=en&sa=X&ei=Yuk5UK2sF-aIiAKFpICQDg&ved=0CDQQ6AEwAA#v=onepage&q=refresh&f=false
  | doi =
  | id =
  | isbn = 0123797519}}</ref>  As time passes, the charges in the memory cells leak away, because even in a "nonconducting" state, a transistor will conduct a small amount, so without being refreshed the stored data would eventually be lost.  To prevent this, external circuitry periodically reads each cell and rewrites it, restoring the charge on the capacitor to its original level.  Each ''memory refresh cycle'' refreshes a succeeding area of memory cells, thus repeatedly refreshing all the cells in a consecutive cycle. This process is conducted automatically, in the background, by the memory circuitry, while the computer is on, and is transparent to the user.<ref name="Ganssle" />  While a refresh cycle is occurring the memory is not available for normal read and write operations, but in modern memory this "overhead" time is not large enough to significantly slow down memory operation.
 
Computer memory that does not require refreshing is available, called [[static random access memory]] (SRAM).<ref name="Ganssle" />  SRAM circuits take up more room on the semiconductor chip, because each SRAM [[Computer data storage|memory cell]] requires 4 - 6 [[transistor]]s, compared to a single transistor and a capacitor for DRAM.  For this reason the storage capacity of SRAM chips is much less than DRAM, so SRAM memory is more costly per bit.  Therefore DRAM is used for the main memory in computers, [[video game]]s, and most other large uses of [[semiconductor memory]].  The need for extra circuitry to perform memory refresh makes DRAM circuits and their timing significantly more complicated than SRAM circuits, but the great advantages of DRAM in density and cost justify this complexity.
 
==How DRAM refresh works==
While the memory is operating, each memory cell must be refreshed repetitively, within the maximum interval between refreshes specified by the manufacturer, which is usually in the millisecond region.  Refreshing does not employ the normal memory operations (read and write cycles) used to access data, but specialized cycles called ''refresh cycles'' which are generated by separate counter circuits in the memory circuitry and interspersed between normal memory accesses.<ref name="Reinhardt">{{cite web
  | last = Reinhardt
  | first = Steven K.
  | authorlink =
  | coauthors =
  | title = Memory, p.9-3
  | work = EECS 373 Design of Microprocessor-based Systems, Lecture Notes, Fall 1999
  | publisher = Electrical Engineering Dept., Univ. of Michigan
  | year = 1999
  | url = http://www.eecs.umich.edu/eecs/courses/eecs373/Lectures/stever_old_lectures/lec9.pdf
  | format =
  | doi =
  | accessdate = August 26, 2012}}</ref><ref name="Heath">{{cite book 
  | last = Heath
  | first = Steve
  | authorlink =
  | coauthors =
  | title = Embedded Systems Design, 2nd Ed.
  | publisher = Newnes
  | year = 2003
  | location =
  | pages = 88–89
  | url = http://books.google.com/books?id=BjNZXwH7HlkC&pg=PA89&lpg=PA89&dq=refresh+dram+cbr+hidden&source=bl&ots=xg3gA1yMnR&sig=c-Tq68aPA6I6or1oai-k25unoaU&hl=en&sa=X&ei=lqs6UJvmNbHtiQLYrID4DQ&ved=0CDkQ6AEwAQ#v=onepage&q=refresh%20dram%20cbr%20hidden&f=false
  | doi =
  | id =
  | isbn = 0750655461}}</ref>
 
The storage cells on a memory chip are laid out in a rectangular array of rows and columns.  The read process in DRAM is ''destructive'' and removes the charge on the memory cells in an entire row, so during a normal read operation the [[sense amplifier]]s on the chip, after reading and latching the data, rewrite the data in the accessed row<ref name="Ganssle" /><ref name="ICE">{{cite paper
  | first =
  | last = 
  | author =
  | authorlink =
  | coauthors =
  | title = Memory 1997
  | version =
  | publisher = Integrated Circuit Engineering
  | year = 1997
  | pages = 7.4
  | url = http://smithsonianchips.si.edu/ice/cd/MEMORY97/SEC07.PDF
  | format =
  | accessdate = }} on [http://smithsonianchips.si.edu/  The Chip Collection, Smithsonian website]</ref> before sending the bit from a single column to output.  So the read electronics has the ability to refresh an entire row of memory in parallel, significantly speeding up the refresh process.  A normal read or write cycle refreshes a row of memory, but normal memory accesses cannot be relied on to hit all the rows within the necessary time, necessitating a separate refresh process.  Rather than use the normal read cycle in the refresh process, to save time an abbreviated cycle called a refresh cycle is used. The refresh cycle is similar to the read cycle, but executes faster for two reasons:
*For a refresh, only the row address is needed, so a column address doesn't have to be applied to the chip address circuits.
*Data read from the cells does not need to be fed into the output buffers or the [[data bus]] to send to the CPU.
The refresh circuitry must perform a refresh cycle on each of the rows on the chip within the refresh time interval, to make sure that each cell gets refreshed.
 
===Types of refresh circuits===
Many different refresh circuits have been used. Although in some early systems the [[microprocessor]] controlled refresh, with a timer triggering a periodic [[interrupt]] that ran a [[subroutine]] that performed the refresh, this meant the microprocessor could not be paused, single-stepped, or put into energy-saving [[hibernation (computing)|hibernation]] without stopping the refresh process and losing the data in memory.<ref name="Heath" />  So in modern systems refresh is handled by circuits in the [[memory controller]],<ref name="Ganssle" /> or increasingly on the chip itself. Some DRAM chips, such as pseudostatic RAM (PSRAM), have all the refresh circuitry on the chip, and function like [[Static random access memory|static RAM]] as far as the rest of the computer is concerned.<ref name="Kumar">{{cite book 
  | last = Kumar
  | first =
  | authorlink =
  | coauthors =
  | title = Fundamentals Of Digital Circuits, 2nd Ed.
  | publisher = PHI Learning Pvt. Ltd
  | year = 2009
  | location = India
  | pages = 819
  | url = http://books.google.com/books?id=P0Q66ULKNR0C&pg=PA820&lpg=PA820&dq=DRAM+refresh&source=bl&ots=xA7iCs319k&sig=THXgt9BMJjYhAGtLEi5yD7luPdM&hl=en&sa=X&ei=4u45UMXjD8OFiAKp_YCAAg&ved=0CGoQ6AEwCQ#v=onepage&q=DRAM%20refresh&f=false
  | doi =
  | id =
  | isbn = 8120336798}}</ref>
 
Usually the refresh circuitry consists of a ''refresh counter'' which contains the address of the row to be refreshed which is applied to the chip's row address lines, and a timer that increments the counter to step through the rows.<ref name="Reinhardt" />  This counter may be part of the memory controller circuitry, or on the memory chip itself.  Two scheduling strategies have been used:<ref name="Heath" />
*''Burst refresh'' - a series of refresh cycles are performed one after another until all the rows have been refreshed, after which normal memory accesses occur until the next refresh is required
*''Distributed refresh'' - refresh cycles are performed at regular intervals, interspersed with memory accesses. 
Burst refresh results in long periods when the memory is unavailable, so distributed refresh has been used in most modern systems,<ref name="Reinhardt" /> particularly in [[Real-time computing|real time]] systems.  In distributed refresh, the interval between refresh cycles is
:<math>\text{refresh cycle interval} = \text{refresh time}\, / \,\text{number of rows}  \,</math>
For example, the current generation of chips (DDR SDRAM) has a refresh time of 64 ms and 8,192 rows, so the refresh cycle interval is 7.8 μs.<ref name="Reinhardt" /><ref name="JEDEC DDR">{{cite paper
  | first =
  | last = 
  | author =
  | authorlink =
  | coauthors =
  | title = JEDEC Double Data Rate (DDR) SDRAM Specification
  | version = JESD79C
  | publisher = JEDEC Solid State Technology Assoc.
  | date = March 2003
  | url = http://cs.ecs.baylor.edu/~maurer/CSI5338/JEDEC79R2.pdf
  | format =
  | accessdate = August 27, 2012}}, p.20, on  [http://www.ecs.baylor.edu/ School of Engineering and Computer Science, Baylor Univ. website]</ref>
 
Recent generations of DRAM chips contain an integral refresh counter, and the memory control circuitry can either use this counter or provide a row address from an external counter.  These chips have three standard ways to provide refresh, selected by different patterns of signals on the "column select" (CAS) and "row select" (RAS) lines:<ref name="Heath" />
*"''RAS only refresh''" - In this mode the address of the row to refresh is provided by the address bus lines, so it is used with external counters in the memory controller.
*"''CAS before RAS refresh''" (CBR) - In this mode the on-chip counter keeps track of the row to be refreshed and the external circuit merely initiates the refresh cycles.<ref name="Reinhardt" />  This mode uses less power because the memory address bus buffers don't have to be powered up.  It is used in most modern computers.
*"''Hidden refresh''" - This is an alternate version of the CBR refresh cycle which can be combined with a preceding read or write cycle.<ref name="Reinhardt" />  The refresh is done in parallel during the data transfer, saving time.
 
In the latest (2012) generation of chips the "RAS only" mode has been eliminated, and the internal counter is used to generate refresh.  The chip has an additional "sleep mode", for use when the computer is in [[hibernation (computing)|hibernation]], in which an on-chip oscillator generates internal refresh cycles so that the external clock can be shut down.
 
===Refresh overhead===
The fraction of time the memory spends on refresh, the refresh overhead, can be calculated from the system timing:<ref name="Godse">{{cite book 
  | last = Godse
  | first = D.A.
  | authorlink =
  | coauthors = A.P.Godse
  | title = Computer Organization
  | publisher = Technical Publications
  | year = 2008
  | location = India
  | pages = 4.23
  | url = http://books.google.com/books?id=vWCAtElfzr8C&pg=SA4-PA23&lpg=SA4-PA23&dq=DRAM+refresh&source=bl&ots=3xsMwBTMYI&sig=V0FY6zIDAXfHAlNyS69gVu5fu_g&hl=en&sa=X&ei=BPw5UIrAJomciQKOxoGgCQ&ved=0CDcQ6AEwATgK#v=onepage&q=DRAM%20refresh&f=false
  | doi =
  | id =
  | isbn = 818431356X}}</ref> 
:<math>\text{refresh overhead} = \frac {\text{time required for refresh, ms}} {\text{refresh interval, ms}} \,</math>
For example, a recent [[SDRAM]] chip has 2<sup>13</sup> = 8 192 rows, a refresh time of 64 ms, the memory bus runs at 133&nbsp;MHz, and the refresh cycle takes 4 clock cycles.<ref name="Godse" />  The time for a refresh cycle is<ref name="Godse" />
:<math>\text{length of refresh cycle} = 4/f = \frac {4}{1.33(10^8)\,\text{Hz}} = 30\, \text{ns} \,</math>
:<math>\text{time required for refresh} = (\text{length of refresh cycle})(\text{rows}) = (30\, \text{ns})(8192) = 0.246\,\text{ms} \,</math>
:<math>\text{refresh overhead} = \frac {0.246\,\text{ms}}{64\, \text{ms}} =.0038 \,</math>
So less than 0.4% of the memory chip's time will be taken by refresh cycles. 
In SDRAM chips, the memory in each chip is divided into banks which are refreshed in parallel, saving further time.  So the number of refresh cycles needed is the number of rows in a single bank, given in the specifications, which in recent (2012) generations of chips has been frozen at 8 192.
 
==Refresh interval==
The maximum time interval between refreshes is standardized by [[JEDEC]] for each DRAM technology, and is specified in the manufacturer's chip specifications.  It is usually in the range of milliseconds.  For current (2012) DDR2 SDRAM chips it is 64 ms.<ref name="JEDEC DDR2">{{cite paper
  | first =
  | last = 
  | author =
  | authorlink =
  | coauthors =
  | title = JEDEC DDR2 SDRAM Specification
  | version = JESD79-2b
  | publisher = JEDEC Solid State Technology Assoc.
  | date = January 2005
  | url = http://cs.ecs.baylor.edu/~maurer/CSI5338/JESD79-2B.pdf
  | format =
  | accessdate = August 27, 2012}}, p.20, on  [http://www.ecs.baylor.edu/ School of Engineering and Computer Science, Baylor Univ. website]</ref>   It depends on the ratio of charge stored in the memory cell capacitors to leakage currents.  Despite the fact that the geometry of the capacitors has been shrinking with each new generation of memory chips, refresh times for DRAM have been improving; from 8 ms for 1M chips, 32 ms for 16M chips, to 64 ms for 256M chips. This improvement is achieved partly by developing transistors that leak significantly less. Longer refresh time means a smaller fraction of the device's time is occupied with refresh, leaving more time for memory accesses.  Although refresh overhead occupied up to 10% of chip time in earlier DRAMs, in modern chips this fraction is less than 1%.    Because the leakage currents in semiconductors increase with temperature, refresh times must be decreased at high temperature.  The current generation of DDR2 SDRAM chips has a temperature-compensated refresh structure; refresh cycle time must be halved when chip case temperature exceeds 85°C (185°F).<ref>[http://cs.ecs.baylor.edu/~maurer/CSI5338/JESD79-2B.pdf  JEDEC DDR2 SDRAM Specification, p.49]</ref>
 
The actual persistence of readable charge values and thus data in most DRAM memory cells is much longer than the refresh time, up to 1–10 seconds.<ref>[http://books.google.com/books?id=SrP3aWed-esC&pg=PA356&lpg=PA356&dq=DRAM+%22refresh+time%22+millisecond&source=bl&ots=4PY6yJIIyE&sig=VowDJ3iFrdWkDa1iDfeHJh_5Q0k&hl=en&sa=X&ei=Yuk5UK2sF-aIiAKFpICQDg&ved=0CDQQ6AEwAA#v=onepage&q=refresh&f=false  Jacob, 2007, p.356]</ref>  However transistor leakage currents vary widely between different memory cells on the same chip.  In order to make sure that all the memory cells are refreshed before a single bit is lost, manufacturers must set their refresh times conservatively short.
 
This frequent DRAM refresh consumes a third of the total power drawn by [[low-power electronics]] devices in standby mode.
Researchers have proposed several approaches to extending battery run-time between charges by reducing the refresh rate, including temperature-compensated refresh (TCR) and retention-aware placement in DRAM (RAPID).
Experiments show that in a typical off-the-shelf DRAM chip, only a few weak cells really require the worst-case 64 ms refresh interval, and even then only at the high end of its specified temperature range.
At room temperature (24°C), those same weak cells need to be refreshed once every 500 ms for correct operation.
If the system can avoid using the weakest 1% of pages,
a typical DRAM only needs to be refreshed once a second, even at 70°C, for correct operation of the remaining 99% of the pages.
Some experiments combine these two complementary techniques, giving correct operation at room temperature at refresh intervals of 10 seconds.<ref>
Ravi K. Venkatesan, Stephen Herr, Eric Rotenberg.
[http://people.engr.ncsu.edu/ericro/publications/conference_HPCA-12.pdf "Retention-Aware Placement in DRAM (RAPID): Software Methods for Quasi-Non-Volatile DRAM"].
2006.
</ref>
 
==Comparison of static and dynamic RAM==
 
===SRAM===
In [[static random access memory]] (SRAM), the other type of semiconductor memory, the data is not stored as charge on a capacitor but in a pair of [[transistor]]s called a [[Flip-flop (electronics)|flip-flop]], so SRAM does not require refreshing.  The two basic types of memory have advantages and disadvantages. Static memory can be considered permanent while powered on, i.e. once written the memory stays until specifically changed and thus its use tends to be simple in terms of system design. However the internal construction of each static memory cell requires six transistors, compared to the single transistor required for a dynamic RAM cell, so the density of SRAM is much lower and price-per-bit much higher than DRAM. The complexity of the static memory cell is also relatively slow to operate thus static memory tends to have lower bandwidths than equivalent dynamic storage.  Writing the capacitor of the dynamic cell is very rapid and write-access times on modern dynamic storage can be in single digit nano-seconds.
 
===DRAM===
Modern DRAM modules provide the refresh circuitry on board with no requirement for motherboard circuitry, almost to the point where, at a module level, they may be thought of as static - requiring the CPU to do nothing to preserve their content
 
====CPU based refresh====
Some early [[microprocessor]]s (e.g. the [[Zilog Z80]]) provided special internal registers that could provide the Row-Address Strobe (RAS) to refresh dynamic memory cells, the register being incremented on each refresh cycle. This could also be accomplished by other [[integrated circuit]]s already being used in the system, if these already generated cycling accesses across RAM (''e.g.'' the [[Motorola 6845]]). In CPUs such as the Z80, the availability of a RAS refresh was a big selling-point due to its simplifying hardware design. Here, RAS refresh is signalled by a unique combination of address and control wires during operationally redundant clock cycles (T-States), i.e. during instruction decode/execution when the buses may not be required. Instead of the bus being inactive during such T-states, the refresh register would be presented on the address bus along with a combination of control wires to indicate to the refresh circuitry.
 
In early versions of the Z80, the ubiquity of 16 kB RAM chips (''i.e.'' having 128 rows) and something of a lack of foresight resulted in the R register only incrementing over a 7 bit-wide range (0–127, ''i.e.'' 128 rows); the 8th bit could be set by the user, but would be left unchanged by the internal cycling. With the rapid advent of 64 kbit+ DRAM chips (with an 8 bit RAS), extra circuitry or logic had to be built around the refresh signal to synthesize the missing 8th bit and prevent blocks of memory being lost after a few milliseconds. In some contexts, it was possible to utilise [[interrupt]]s to flip the 8th bit at the appropriate time and thus cover the entire range of the R register (256 rows). Another method, perhaps more universal but also more complex in terms of hardware, was to use an 8-bit counter chip, whose output would provide the refresh RAS address instead of the R register: the refresh signal from the CPU was used as the clock for this counter, resulting in the memory row to be refreshed being incremented with each refresh cycle. Later versions and licensed "work-alikes" of the Z80 core remedied the non-inclusion of the 8th bit in automatic cycling, and modern CPUs have greatly expanded on such basic provisioning to provide rich all-in-one solutions for DRAM refresh.
 
==Other memory technologies using refresh==
Several early computer memory technologies also required periodical processes similar in purpose. These technologies include [[delay line memory]] and [[Williams tube]].  In [[magnetic core memory]], another historical early memory technology, reading the data erased the memory cell, so each memory cell needed to be rewritten after being read.
 
==References==
{{reflist}}
 
{{DEFAULTSORT:Memory Refresh}}
[[Category:Computer memory]]

Latest revision as of 16:49, 22 May 2014

Hello. Let me introduce the author. Her name is Refugia Shryock. Puerto Rico is where he's always been living but she requirements to transfer simply because of her family members. To collect cash is what his family and him enjoy. In her professional lifestyle she is a payroll clerk but she's usually needed her own business.

Take a look at my homepage :: std testing at home