Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Chapter 9
Memory Devices
his chapter is an introduction to computer memory devices. We discuss the random-access memory (RAM), read-only memory (ROM), row and column decoders, memory chip organization, static RAMs (SRAMs) dynamic RAMs (DRAMs), volatile, nonvolatile, programmable ROMs (PROMs), Erasable PROMs (EPROMs), Electrically Erasable PROMs (EEPROMs), flash memories, and cache memory.
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
9-1
D0 D1
RAM
D2 DN
RW
Read Write
R W = 0 Write R W = 1 Read
The bits on a memory device can be either individually addressed, or can be addressed in groups of 4, 16, 64, and so on. Thus, a 64M -bit device in which all bits are individually addressed, is known as 64M 1 , that is, the device is configured as a 26-bit address where 2 26 = 67, 108, 864 , and for convenience it is referred to as 64M words 1 bit memory device. The bulk part of a memory device consists of cells where the bits are stored. We may think of a cell being a D-type flip flop, and the cells are organized in a square matrix. Figure 9.3 shows a block diagram of a 67, 108, 864 (8192 8192) words by 1 bit, referred to as 64M 1 RAM device arranged in a 8192 by 8192 square matrix.
A0 Address inputs Row A 2 decoder A 12 A1 D0
Column decoder A 13 A 14 A 15 A 25
In Figure 9.3, during a read operation, a cell is selected for reading or writing by enabling its row through the row-address decoder, and its column through the column-address decoder. A sense
9-2
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
JJM/IT/IT-Portal/2011/DIL JJM/IT/IT-Portal/2011/DIL
amplifier (not shown) detects the contents of the selected cell and provides it to the data-output terminal of the device. A similar operation is used for a write operation. Example 9.1 We have an abundance of RAM chips each with 4096 rows and 256 columns and we want to construct a 16M bit memory. a. How many RAM chips do we need to form this memory? b. How many row address lines, column address lines, and lines for the RAM chips do we need for this memory? Solution: a. The actual size of a 16M bit memory is 16, 772, 216 and thus we will need
16 , 772, 216 ----------------------------- = 16 of 4096 256 RAM chips 4096 256
b. 4096 = 2 12 so for 12 bits we will need 12 row lines and since 256 = 2 8 , we will need 8 column lines. We will also need one line for each RAM chip for a total of 16 RAM chip select lines. RAMs are classified as static or dynamic. Static RAMs, referred to as SRAMs, use flip flops as the storage cells. Dynamic RAMs, referred to as DRAMs, use capacitors of the storage cells but the charge in the capacitors must be periodically refreshed. The main advantage of DRAMs over SRAMs is that for a given device area, DRAMs provide much higher storage capacity.
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
9-3
X2 ROM inputs
3 to 8 X 1 decoder
ROM outputs
The ROM circuit of Figure 9.4, consists of a decoder, a diode matrix, resistors, and a power supply. For our present discussion, a diode is an electronic device which allows electric current to flow in one direction only. A resistor is an electrical device in which when an electric current flows through, it produces a voltage drop (potential difference) across its terminals. The power supply, denoted as V CC , provides power to the ROM circuit. The input lines X 0 , X 1 , and X 2 , select one of the 8 outputs of the decoder which when active Low, selects the appropriate word appearing at the outputs Y 0 , Y 1 , Y 2 , and Y 3 . These outputs go Low if they are connected to the decoder output lines via a diode and that the decoder output line is Low. This is illustrated with the simplified resistor-diode circuit shown in Figure 9.5.
V CC Y V CC
Y
Y (Low) (a) Y (High) (b)
The output Y is Low (logic 0) whenever the selected decoder output line which is active Low allows electric current to flow through the resistor and through the diode thus developing a volt Same reference as above.
9-4
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
JJM/IT/IT-Portal/2011/DIL JJM/IT/IT-Portal/2011/DIL
age drop (potential difference) equal to V CC as shown in Figure 9.5(a). The output Y is High (logic 1) whenever the selected decoder output line is not active Low, and in this case no current flows and thus resistor-diode forms an open circuit as shown in Figure 9.5(b). Table 9.1 shows the outputs Y of the ROM circuit of Figure 9.4 for each input combination.
TABLE 9.1 Outputs for the ROM circuit of Figure 9.4 Inputs Outputs X2 0 0 0 0 1 1 1 1 X1 0 0 1 1 0 0 1 1 X0 0 1 0 1 0 1 0 1 Y3 0 0 0 0 0 1 1 1 Y2 0 0 0 1 1 1 0 1 Y1 0 1 0 1 0 1 1 0 Y0 0 0 1 0 0 0 1 0
ROMs are used extensively as look up tables for different functions such as trigonometric functions, logarithms, square roots, etc. Table 9.2 is an example of a look up table where a 4-bit input and a 4-bit output is used to convert an angle between 0 and 90 degrees to its cosine. We recall that as 0 90 , the cosine assumes the range of values in the interval 0 90
TABLE 9.2 An example of a lookup table (deg) 0 6 12 18 24 30 36 42 48 54 60 66 72 78 84 90 Binary input 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 Output ( cos ) - Fractional values 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 0 0 1 1 1 1 1 0 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
9-5
= 0.499 0.5
Programming instructions that are stored in a read-only memory unit rather than being implemented through software are known as firmware. ROMs are also used as character generators referred to as CGROMs. For instance, a CGROM device may be designed to produce 128 characters in a 7 by 9 matrix. To select one of the characters, the appropriate binary code is applied at the address inputs of the device. All CGROM devices are capable of shifting the descender characters g , j , p , q , and y , below the baseline. Figure 9.6 shows the non-shifted characters A and a and the shifted character j .
C0 C2 C4 C6 C1 C3 C5
C0 C2 C4 C6 C1 C3 C5
C0 C2 C4 C6 C1 C3 C5
In commercially available PROMs, the open/close switches shown in Figure 9.7 are actually fuses. In a PROM, a charge sent through a column will pass through the fuse in a cell to a grounded row indicating a value of 1. Since all the cells have a fuse, the initial (blank) state of a PROM chip is all logic 0s assuming that the decoder outputs are active Low. To change the value of a cell to logic 1, we use a programmer to send a specific amount of current to the cell and this current burns the fuse. Accordingly, this process is known as burning the PROM. Obviously, PROMs can only be programmed once.
9-6
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
ROM inputs
Y3
Y2 ROM outputs
Y1
Y0
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
9-7
9-8
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
JJM/IT/IT-Portal/2011/DIL JJM/IT/IT-Portal/2011/DIL
Cache Memory
A very popular flash memory device it the SmartMedia developed by Toshiba. SmartMedia cards are available in capacities ranging from 2 MB to 128 MB. The card is very small, approximately 45 mm long, 37 mm wide and less than 1 mm thick. SmartMedia cards can be erased, written onto, and read from memory in small blocks (256- or 512-byte increments). Accordingly, they are fast, reliable, and allows the user to select the data he wishes to keep.
9-9
9-10
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
JJM/IT/IT-Portal/2011/DIL JJM/IT/IT-Portal/2011/DIL
Summary
9.11 Summary
Random access memory (RAM) is the type of memory where the access time is independent of the location of the data within the memory device, in other words, the time required to retrieve data from any location within the memory device is always the same and can be accessed in any order. RAM is volatile, that is, data are lost when power is removed. Serial access memory (SAM) is memory that stores data as a series of memory cells that can only be accessed sequentially. SAM is nonvolatile memory, that is, stored data are retained even though power is removed. The bits on a memory device can be either individually addressed, or can be addressed in groups of 4, 16, 64, and so on. RAMs are classified as static or dynamic. Static RAMs, referred to as SRAMs, use flip flops as the storage cells. Dynamic RAMs, referred to as DRAMs, use capacitors of the storage cells but the charge in the capacitors must be periodically refreshed. The main advantage of DRAMs over SRAMs is that for a given device area, DRAMs provide much higher storage capacity. Read-Only Memories (ROMs) are memories in which the binary information is prewritten by special methods and the contents cannot be changed by the programmer or by any software. ROMs are nonvolatile. ROMs are used extensively as look up tables for different functions such as trigonometric functions, logarithms, square roots, etc. Programming instructions that are stored in a read-only memory unit rather than being implemented through software are known as firmware. ROMs are also used as character generators referred to as CGROMs. A programmable read-only memory (PROM) is a ROM that can be programmed by hardware procedures. PROMs can only be programmed once. Erasable programmable read-only memory (EPROM) can be erased and reprogrammed many times. To rewrite an EPROM, we must erase it first. To erase an EPROM, a special tool that emits an ultraviolet (UV) light at a certain frequency and specified duration. Electrically-erasable PROM (EEPROM) is a variant of the EPROM that can be erased and reprogrammed without the use of ultraviolet light. Flash memory is rewritable memory chip that holds its contents without power. It is used for easy and fast information storage in cell phones, digital cameras, and video game consoles. Flash memory works much faster than traditional EEPROMs A memory stick is a device that uses flash memory. It records various types of digital content, allows sharing of content among a variety of digital products, and it can be used for a broad range of applications. Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
9-11
9-12
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
JJM/IT/IT-Portal/2011/DIL JJM/IT/IT-Portal/2011/DIL
Exercises
9.12 Exercises
1. We can expand the word size of a a RAM by combining two or more RAM chips. For instance, we can use two 32 8 memory chips where the number 32 represents the number of words and 8 represents the number of bits per word, to obtain a 32 16 RAM. In this case the number of words remains the same but the length of each word will two bytes long. Draw a block diagram to show how we can use two 16 4 memory chips to obtain a 16 8 RAM. 2. We can also expand the address size of a RAM by combining two or more RAM chips. Draw a block diagram to show how we can use two 16 4 memory chips to obtain a 32 4 RAM. 3. The outputs of the decoder in the ROM circuit below are active Low. List the words stored in that circuit.
V CC
ROM inputs
Y3
Y2 ROM outputs
Y1
Y0
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
9-13
RW 16 4 RAM ME
RW 16 4 RAM ME
Word size
B7 B6 B5 B4 B3 B2 B1 B0
The address range is from 0000 to 1111 , the same as with the individual RAMs, that is, 16 words, but the word size is now 8 bits, B 0 through B 7 where the four higher order bits of the word are stored in the first 16 4 RAM and the four lower order bits of the word are stored in the second 16 4 RAM. The memory enable ( ME ) input enables or disables the memory chip so that it will or will not respond to other inputs. Thus, when ME is logic 1, the memory chip is disabled and when ME is logic 0, the memory is enabled. The read/write ( R W ) input determines which memory operation is to be performed, that is, when R W is logic 1, a read operation is performed, and when R W is logic 0, a write operation is performed. Similarly, we can use eight 1024 1 RAM chips to form a 1024 8 RAM.
9-14
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
JJM/IT/IT-Portal/2011/DIL JJM/IT/IT-Portal/2011/DIL
2.
Address bus A4 A3 A2 A1 A0 RW
RW 16 4 RAM ME
RW 16 4 RAM ME
Word size
B3 B2 B1 B0
We need five address lines and since each memory chip has only four, we use the ME input as a fifth address shown as line A4 which is connected such that only one of the two RAM chips is enabled at any time. Thus, when A4 = 0 , the ME of the left RAM is enabled, the ME input of the right RAM is disabled, memory locations from 00000 to 01111 are accessed. Likewise, when A4 = 1 , the ME input of the left RAM is disabled, the ME input of the right RAM is enabled, and memory locations from 10000 to 11111 are accessed. Similarly, we can use eight 1024 1 RAM chips to form an 8192 1 RAM. 3.
Row 1 Row 2 Row 3 Row 4 Row 5 Row 6 Row 7 Row 8 1000 0111 0011 1100 0000 1111 1000 0101
Digital Circuit Analysis and Design with an Introduction to CPLDs and FPGAs Orchard Publications
9-15