Docsity

Timing and Random Access Memory - Lecture Notes | ENGIN 112, Study notes of Engineering

Partial preview of the text

Download Timing and Random Access Memory - Lecture Notes | ENGIN 112 and more Study notes Engineering in PDF only on Docsity!

College of Engineering University of Massachusetts Amherst

ENGIN 112

Introduction to Electrical and

Computer Engineering

Fall 2008

Discussion A

13. Timing and Random Access Memory

I. Timing

  • In circuits, data are transferred from input to output via electrical currents that cause changes in voltage levels. It takes some small, but not zero, time for currents to propagate through the devices that make up the circuits, which causes some delay between the time a voltage change is applied at the input (indicating new input data) and the resulting change starts and is completed at the output. That delay determines how rapidly the circuit is able to process data.
  • In combinational circuits (with no clock), two types of delay are important: contamination delay (denoted tcd ) and propagation delay (denoted tpd ).
  • Contamination delay is the time it takes from the a change in the input to start to cause a change in the output (so: a change in the output does not start until tcd seconds after the input change). Propagation delay is the time it takes from a change in the input to the completion of the change in the output (so: after tpd seconds the output will not further change in response to the input change).

____________________________________________________________

Example: Suppose that we have AND gates with contamination delays = 5 nsec (= 5 nanoseconds = 5 x 10

  • sec.) and propagation delays = 10 nsec, and OR gates with contamination delays = 3 nsec and propagation delays = 8 nsec. Find the overall contamination and propagation delays for the circuit shown below: _x y z output tcd = 3 nsec + 3 nsec = 6 nsec. tpd = 10 nsec + 8 nsec = 18 nsec.

tpd path tcd path_

  • In sequential circuits , the delays are defined with respect to the clock pulse edge that triggers a transition (since an input change can’t affect the output until the next triggering clock pulse edge).
  • Similar to combinational circuits, we define contamination delay tcd to be the time it takes from the a triggering clock pulse edge change to the start of a transition in the output (so: a change in the output does not start until tcd seconds after the clock edge). Propagation delay tCLK-Q is the time it takes from the triggering clock pulse edge to the completion of the transition in the output (so: after tClk-Q seconds the output will not further change in response to the clock edge). tClk-Q tcd Clock Output tClk-Q tcd
  • Propagation delays and setup times determine the minimum required clock period (that is, the time from one triggering clock edge to the next) – the period must be long enough to allow the desired input to propagate through all circuits leading to the output flip-flop, plus allow for enough setup time at the output.
  • The clock frequency is defined to be 1/(period) – this is a measure of how fast the overall system is able to operate. Frequency is expressed in units of Hertz (Hz) = (sec) - . So, for example, a clock having a period of 100 nsec. = 1 x 10 - sec. has a frequency of 1/(1 x 10 - ) = 1 x 10 7 Hz = 10 x 10 6 Hz = 10 megahertz = 10 MHz. Note that the maximum allowed clock frequency is 1/( minimum allowed clock period).
  • In circuits with multiple paths from input to output: it is the path with the largest sum of propagation delays and output setup time that determines the maximum clock frequency.

____________________________________________________________

Example: In the circuit shown below, each flip-flop has propagation delay tClk-Q = 10 nsec. and setup time tS = 2 nsec. Combinational circuit 1 has a propagation delay tpd1 = 5 nsec., combinational circuit 2 has propagation delay tpd2 = 8 nsec., and the AND gate has propagation delay tpd3 = 1 nsec. What is the maximum possible clock frequency for the circuit? _D

C_

Q1 D

> C

Q

Comb. Circuit 1 Comb. Circuit 2 Input Output Clock

  • One last issue in timing: We must insure that there are no hold time violations at flip-flop inputs – that is, we must make sure that the input into a flip-flop does not change for at least th seconds after a triggering clock pulse edge.
  • Recall that contamination delays determine when a change will first appear at a circuit’s output. So, we must make sure that contamination delays are such that no change will start to appear in a flip-flop input for at least th seconds – that is, the smallest sum of contamination delays along paths into a flip-flop must be ≥ th.

Example: In our previous example, suppose that each flip-flop has contamination delay tcd = 2 nsec. and hold time th = 5 nsec. Combinational circuit 1 has tcd = 3 nsec., combinational circuit 2 has tcd = 4 nsec., and the AND gate has tcd = 0.5 nsec. Does the circuit satisfy the hold time requirements? The time from when a transfer is initiated at the first flip-flop (on a clock pulse edge) until the effects begin to appear at D2 is (2+3+0.5) = 5. nsec. (path through combinational circuit 1). This is > th = 5 nsec., so hold time requirements are satisfied.


II. Memory

  • A memory unit is a collection of cells (registers) that are used to store binary data. During processing, selected data are transferred from the memory unit where they are stored to registers in the particular processor. The processing results are then transferred back into the memory unit. The transfer of data out of a memory unit is called a read , while the transfer of data in is called a write.
  • One type of memory unit, called Random Access Memory (RAM) , allows for both read and write operations. Another type, called Read- Only Memory (ROM) , allows data to be written in only once; after that, only read operations are allowed. (So: data in ROM are stored permanently.)
  • One note on logic symbols: In memory operations, it is common for a logic gate to have many inputs. For graphical simplicity, instead of drawing many lines going into the gate we usually draw a single line in, with the actual input lines drawn perpendicular to that ingoing line.
  • So: A RAM that stores 2 k m -byte words needs to have: (1) n = 8m data input lines (so that a new word can be written into memory); (2) n = 8m data output lines (so that a word can be read from memory); (3) A read/write line (to specify which operation is to be performed); (4) k address lines (to specify which of the 2 k words is to be written/read); (5) Usually: a memory enable line that enables/disables operations on the memory unit.
  • Block symbol: RAM 2 k^ words n bits/word k address lines

n data input lines

n data output lines

Read/Write Memory enable

  • ( Note : Word locations are indexed by k -bit binary numbers 000…0 to 111…1; so the bits on the address lines tell which word location is to be accessed.)
  • Steps for a Write operation: (1) Put the binary code for the desired word location on the address lines; (2) Put the bits to be written in on the data input lines; (3) Activate Write and Memory Enable inputs. The bits from the data input lines will then be transferred into the register (that is, word location) specified by the address bits.
  • Steps for a Read operation: (1) Put the binary code for the desired word location on the address lines; (2) Activate Read and Memory Enable inputs. The bits stored in the register (word location) specified by the address bits are then transferred to the data output lines.
  • Action of Read/Write and Memory Enable inputs: Memory Enable Read/Write Operation 0 X no operation 1 0 Write 1 1 Read
  • For a read operation, the address lines, Memory Enable = 1 , and Read/Write = 1 must all be held stable for a period of time at least equal to the access time.
  • One type of RAM is called static RAM (SRAM) - it uses latches to store the data (one latch per bit).
  • The basic binary cell (BC) for storing one bit can be represented using a D latch as follows:
  • Idea: When Select =1 and Read/Write=0 : the input bit is written into the latch, the output bit is fixed at 0. When Select=1 and Read/Write=1: The latch is disabled (so the stored bit is unchanged), the output bit = the stored bit Q. When Select=0: the latch is disabled and the output bit is fixed at 0. D En Q Read/Write Select Input (^) Output
  • A key concern in memory design is to reduce the number of electronic devices (gates or transistors) required in the implementation – this allows for more cells to be constructed on a given chip (greater memory capacity) and for faster operation.
  • One way to reduce the number of required devices is to replace the single decoder used for word selection with a pair of decoders. Idea: recall that building a k x 2 k decoder requires 2 k AND gates, each having k inputs. If k is an even number, we can equivalently use two k/2 x 2 k/ decoders, which require only 2 x 2 k/ AND gates, each having only k/2 inputs. To do this, we simply divide the k -bit address into two k/2 bit pieces, say X and Y. The desired word having address (X,Y) is placed in a square at row position X and column position Y.

Example: Suppose we have a memory that contains 2 20 =1.05 x 10 6 words

  • then if addressing is done with a single 20 x 2 20 decoder, we need approx. one million AND gates, each with 20 inputs. If we instead use two 10 x 2 10 decoders, we need 2 x 2 10 = 2048 AND gates, each with 10 inputs. To access the word having address 10001011111000111001, we place the word at row address X = 1000101111 and column address Y = 1000111001._______________________________________________
  • Another way to reduce the number of electronic devices that make up a memory unit is to replace SRAM with dynamic RAM (DRAM). DRAM cells store bits as charges on capacitors, instead of in latches – this allows each cell to be constructed from a single transistor (instead of six as in SRAM). This allows DRAM to store approximately four times as many bits in a given chip area than is possible with SRAM.
  • The large capacity of DRAMs means that they require large decoders for word selection. As in SRAM, to save on decoder complexity the single k x 2 k decoder needed for a k-bit address is usually replaced by two k/2 x 2 k/ decoders (one for the row address and the other for the column address). To save on the number of address input lines, the operations of the two decoders are multiplexed – that is, the row address and column address are sent at different times along a single set of k/2 address lines.