Файл: Digital design with CPLD applications and VHDL (R. Dueck, 2000).pdf

ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 13.06.2025

Просмотров: 8032

Скачиваний: 6

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

13.4 • Sequential Memory: FIFO and LIFO

645

13.4 Sequential Memory: FIFO and LIFO

K E Y T E R M S

Sequential memory Memory in which the stored data cannot be read or written in random order, but must be addressed in a specific sequence.

FIFO First-in first-out. A sequential memory in which the stored data can be read only in the order in which it was written.

Queue A FIFO memory.

LIFO Last-in first-out. A sequential memory in which the last data written are the first data read.

Stack A LIFO memory.

The RAM and ROM devices we have examined up until now have all been random access devices. That is, any data could be read from or written to any sequence of addresses in any order. There is another class of memory in which the data must be accessed in a particular order. Such devices are called sequential memory.

There are two main ways of organizing a sequential memory—as a queue or as a stack. Figure 13.21 shows the arrangement of data in each of these types of memory.

A queue is a first-in first-out (FIFO) memory, meaning that the data can be read only in the same order they are written, much as railway cars always come out of a tunnel in the same order they go in.

One common use for FIFO memory is to connect two devices that have different data rates. For instance, a computer can send data to a printer much faster than the printer can use it. To keep the computer from either waiting for the printer to print everything or periodically interrupting the computer’s operation to continue the print task, data can be sent in a burst to a FIFO, where the printer can read them as needed. The only proviso is that there

FIGURE 13.21

Sequential Memory

646 C H A P T E R 1 3 • Memory Devices and Systems

must be some logic signal to the computer telling it when the queue is full and not to send more data and another signal to the printer letting it know that there are some data to read from the queue.

The last-in-first-out (LIFO), or stack, memory configuration, also shown in Figure 13.21, is not available as a special chip, but rather is a way of organizing RAM in a memory system.

The term “stack” is analogous to the idea of a spring-loaded stack of plates in a cafeteria line. When you put a bunch of plates on the stack, they settle into the recessed storage area. When a plate is removed, the stack springs back slightly and brings the second plate to the top level. (The other plates, of course, all move up a notch.) The top plate is the only one available for removal from the stack, and plates are always removed in reverse order from that in which they were loaded.

Figure 13.21b shows how data are transferred to and from a LIFO memory. A block of addresses in a RAM is designated as a stack, and one or two bytes of data in the RAM store a number called the stack pointer, which is the current address of the top of the stack.

In Figure 13.21, the value of the stack pointer changes with every change of data in the stack, pointing to the last-in data in every case. When data are removed from the stack, the stack pointer is used to locate the data that must be read first. After the read, the stack pointer is modified to point to the next-out data. Some stack configurations have the stack pointer painting to the next empty location on the stack.

The most common application for LIFO memory is in a computer system. If a program is interrupted during its execution by a demand from the program or some piece of hardware that needs attention, the status of various registers within the computer are stored on a stack and the computer can pay attention to the new demand, which will certainly change its operating state. After the interrupting task is finished, the original operating state of the computer can be taken from the top of the stack and reloaded into the appropriate registers, and the program can resume where it left off.

SECTION 13.4 REVIEW PROBLEM

13.4 State the main difference between a stack and a queue.

13.5Dynamic RAM Modules

K E Y T E R M S

Memory module A small circuit board containing several dynamic RAM chips.

Single in-line memory module (SIMM)

A memory module with DRAMs and

connector pins on one side of the board only.

Dual in-line memory module (DIMM)

A memory module with DRAMs and

connector pins on both sides of the board.

Dynamic RAM chips are often combined on a small circuit board to make a memory module. This is because the data bus widths of systems requiring the DRAMs are not always the same as the DRAMs themselves. For example, Figure 13.22 shows how four 64M8 DRAMs are combined to make a 64M 32 memory module. The block diagram of the module is shown in Figure 13.22, and the mechanical outline is shown in Figure 13.23. The data input/output lines are separate from one another so that there are 32 data I/Os (DQ). The address lines (ADDR[12..0]) for the module are parallel on all chips. With address multiplexing, this 13-bit address bus yields a 26-bit address, giving a 64M address range. Chip selects (CS) for all devices are connected together so that selecting the module selects all chips on the module.

This particular memory module is configured as a single in-line memory module (SIMM), which has the DRAM chips and pin connections on one side of the board only. A


13.5 • Dynamic RAM Modules

647

FIGURE 13.22

64M 8

SIMM Block Diagram

Addres bus

DQ[0..7]

ADDR [12..0]

RAS

CAS

CS

64M 8

DQ[8..15]

RAS

CAS

CS

64M 8

DQ[16..23]

RAS

CAS

CS

64M 8

DQ[24..32]

RAS

CAS

CS

FIGURE 13.23

SIMM Layout

1

72

dual in-line memory module (DIMM) has the DRAMs mounted on both sides of the circuit board and pin connections on both sides of the board as well.

SECTION 13.5 REVIEW PROBLEM

13.5A SIMM has a capacity of 16M 32. How many 16M 8 DRAMs are required to make this SIMM? How many address lines does the SIMM require? How should the DRAMs be connected?


648C H A P T E R 1 3 • Memory Devices and Systems

13.6Memory Systems

K E Y T E R M S

Address decoder A circuit enabling a particular memory device to be selected by the address bus of a larger memory system.

Address space A block of addresses in a memory system.

Bus contention The condition that results when two or more devices try to send data to a bus at the same time. Bus contention can damage the output buffers of the devices involved.

Memory map A diagram showing the total address space of a memory system and the placement of various memory devices within that space.

In the section on memory modules, we saw how multiple memory devices can be combined to make a system that has the same number of addressable locations as the individual devices making up the system, but with a wider data bus. We can also create memory systems where the data I/O width of the system is the same as the individual chips, but where the system has more addressable locations than any chip within the system.

In such a system, the data I/O and control lines from the individual memory chips

www.electronictech.com

are connected in parallel, as are the lower bits of an address bus connecting the chips.

However, it is important that only one memory device be enabled at any given time, in or-

der to avoid bus contention, the condition that results when more than one output at-

tempts to drive a common bus line. To avoid bus contention, one or more additional ad-

dress lines must be decoded by an address decoder that allows only one chip to be

selected at a time.

Figure 13.24 shows two 32K 8 SRAMs connected to make a 64K 8 memory sys-

tem. A single 32K 8 SRAM, as shown in Figure 13.24a, requires 15 address lines, 8 data

lines, a write enable (WE), and chip select (CS) line. To make a 64K 8 SRAM system,

all of these lines are connected in parallel, except the CS lines. In order to enable only one

at a time, we use one more address line, A15, and enable the top SRAM when A15 0 and

the bottom SRAM when A15 1.

The address range of one 32K 8 SRAM is given by the range of states of the address

lines A[14..0]:

Lowest single-chip address:

000 0000 0000 0000 0000H

Highest single-chip address:

111 1111 1111 1111 7FFFH

The address range of the whole system must also account for the A15 bit:

Lowest system address:

0000 0000 0000 0000

0000H

Highest system address:

1111 1111 1111 1111

FFFFH

Within the context of the system, each individual SRAM chip has a range of ad-

dresses, depending on the state of A15. Assume SRAM0 is selected when A15 0 and

SRAM1 is selected when A15 1.

Lowest SRAM0 address:

0000 0000 0000 0000

0000H

Highest SRAM0 address:

0111 1111 1111 1111

7FFFH

Lowest SRAM1 address:

1000 0000 0000 0000

8000H

Highest SRAM1 address:

1111 1111 1111 1111

FFFFH

Figure 13.25 shows a memory map of the 64K 8 SRAM system, indicating the range of addresses for each device in the system. The total range of addresses in the system is called the address space.


13.6 • Memory Systems

649

32 K 8 SRAM

A[14..0]

A[14..0]

DQ[ 7 ..0]

DQ[ 7 ..0]

WE

CS

a. Single 32 K 8 SRAM

32 K 8 SRAM

A[14..0]

DQ[7 ..0]

DQ[7 ..0]

WE

WE

A15

CS0

32 K 8 SRAM

A[14..0]

DQ[7 ..0]

WE

CS1

b. Two 32 K 8 SRAMS connected to make 64 K 8 SRAM system

FIGURE 13.24

Expanding Memory Space

FIGURE 13.25 0000H

Memory Map

SRAM0

8000H

SRAM1

FFFFH


650 C H A P T E R 1 3 • Memory Devices and Systems

EXAMPLE 13.3

0000H

SRAM1

4000H

8000H

SRAM2

C000H

FFFFH

Figure 13.26 shows a memory map for a system with an address space of 64K (16 address lines). Two 16K 8 blocks of SRAM are located at start addresses of 0000H and 8000H, respectively. Sketch a memory system that implements the memory map of Figure 13.26.

Solution A 16K address block requires 14 address lines, since

16K 16 1024 24 210 214

The entire 64K address space requires 16 address lines, since

64K 64 1024 26 210 216

The highest address in a block is the start address plus the block size.

16K block size:

11 1111 1111 1111

3FFFH

SRAM0:

Lowest address:

0000 0000 0000 0000 0000H

Highest address:

0011 1111 1111 1111

3FFFH

SRAM2:

Lowest Address:

1000 0000 0000 0000 8000H

Highest Address:

1011 1111 1111 1111 BFFFH

FIGURE 13.26

Memory Map Showing Noncontiguous Decoded Blocks.

A15A14 00 for the entire range of the SRAM0 block. A15A14 10 for the entire SRAM2 range. These can be decoded by the gates shown in Figure 13.27.

16 K 8

SRAM0

A[13..0]

A[13..0]

DQ[7..0]

DQ[7..0]

A15

WE

A14

CS0

16 K 8

SRAM2

A[13..0]

DQ[7..0]

WE

WE

CS1

FIGURE 13.27

Example 13.3

32K 8 SRAM with non-continguous blocks.

Address Decoding with n-line-to-m-line Decoders

Figure 13.28 shows a 64K memory system with four 16K chips: one EPROM at 0000H and three SRAMs at 4000H, 8000H, and C000H, respectively. In this circuit, the address decoding is done by a 2-line-to-4-line decoder, which can be an off-the-shelf MSI decoder, such as a 74HC139 decoder or a PLD-based design.

Table 13.2 shows the address ranges decoded by each decoder output. The first two address bits are the same throughout any given address range. Figure 13.29 shows the memory map for the system.