Skip to main content
Engineering LibreTexts

9.2: Background Material

  • Page ID
    27003
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Memory is perhaps the hardest concept that is covered up to this time in the text. Therefore there is a lot of basic material and background concepts which need to be covered before moving into how memory works directly. The concepts which will be covered in this section are:

    • State
    • Static and dynamic memory
    • Square wave oscillation

    \(\PageIndex{1}\) State

    It is easy to confuse state and memory, and this is often a problem for programmers at all levels of experience. The two are very different, and it is important to understand this difference to understand how a computer works. Memory is a place to store values; state is the value of all memory.

    For example a 2-bit counter would have 2 bits of memory which would be used to store the current value in the counter (002..112) in the 2-bits. In a large computer state is the value of all memory accessible in that computer. State is important because in hardware computers are most easily seen as simply machines that transition from one state to another using large black-boxes of circuits (called combinational logic) to determine the computer's next state.

    To apply this to a computer, consider two numbers are to be added together. These numbers would be stored in two memory locations. These two memory locations would be used as input to a combinational circuit (an adder), and stored back to (possibly the same) memory location. Hence the operation can be thought of as a state transition where the initial state of the computer (S0, the two memory values) are added in a black block (combination logic implementing an adder), and the result is a new state (S1, with the value of a memory location changed).

    \(\PageIndex{2}\) Static and dynamic memory

    The second important memory concept is the difference between the static and dynamic memory8. Dynamic memory, called DRAM, is implemented using a capacitor and a transistor, and so is simple and cheap. However, the capacitor leaks current, so it is necessary to recharge it every other clock cycle, making dynamic memory slow. Static memory, called SRAM, does not have to be recharged, so it is faster, but requires at least 5 gates to implement. This makes static memory both faster and more expensive. Both types of memory exist in a computer, but for now we will discuss memory in the CPU, so speed is the most important requirement and only static memory will be used. Dynamic memory will not be covered.

    \(\PageIndex{3}\) Square Wave

    Contained in every computer is a system clock, which regulates how fast the computer executes instructions. This is often called the clock speed or clock rate of the computer. One of the functions of the system clock is to generate a signal called a square wave. A square wave is a pulse of current which alternates over time from a low voltage (0) to a high voltage (1). This is illustrated in Figure \(\PageIndex{1}\). In this figure the voltage is low from time t0 to t1, t2 to t3, t4 to t5, etc. The voltage is high from time t1 to t2, t3 to t4, etc. This oscillation of voltage can be used to send a 0 or 1 value into a circuit, and be used to control the changing of the state in the circuit. A square wave will be used to implement state, and will be illustrated in the next section.

    Figure \(\PageIndex{1}\): Square Wave

    Screen Shot 2020-06-26 at 9.49.55 PM.png


    8 Computer science often reuses terms with very different meanings in different contexts. This happens here where static and dynamic memory mean how memory is allocated at a programming level, and how memory is implemented at a hardware level. Realize that there is no connection between the terms at the different levels of implementation (programming and hardware). Static and dynamic programming memory can exist in static or dynamic hardware memory.


    This page titled 9.2: Background Material is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Charles W. Kann III via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.