memory devices - wellesley collegecs240/s16/slides/ram.pdfsram: static random access memory in the...

22
Memory Devices Small: Register file (group of numbered registers) Medium: SRAM (Static Random Access Memory) Large: DRAM (Dynamic Random Access Memory) Future? 1

Upload: others

Post on 10-Aug-2020

10 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

MemoryDevices

Small:Registerfile (groupofnumberedregisters)

Medium:SRAM (StaticRandomAccessMemory)

Large:DRAM (DynamicRandomAccessMemory)

Future?

1

Page 2: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

ALU

Processor:DataPathComponents

Registers MemoryInstructionFetch andDecode

12 3

Page 3: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

SRAM:StaticRandomAccessMemory

In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding to the registers being read are assigned using a continuous assignment, but the register being written is assigned in an always block. Which of the following is the reason?

a. There is no special reason. It was simply convenient.

b. Because Data1 and Data2 are output ports and WriteData is an input port.

c. Because reading is a combinational event, while writing is a sequential event.

C.9 Memory Elements: SRAMs and DRAMs

Registers and register fi les provide the basic building blocks for small memories, but larger amounts of memory are built using either SRAMs (static random access memories) or DRAMs (dynamic random access memories). We fi rst dis cuss SRAMs, which are somewhat simpler, and then turn to DRAMs.

SRAMsSRAMs are simply integrated circuits that are memory arrays with (usually) a single access port that can provide either a read or a write. SRAMs have a fi xed access time to any datum, though the read and write access characteristics often differ. An SRAM chip has a specifi c confi guration in terms of the number of addressable locations, as well as the width of each addressable location. For example, a 4M × 8 SRAM provides 4M entries, each of which is 8 bits wide. Thus it will have 22 address lines (since 4M = 222), an 8-bit data output line, and an 8-bit single data input line. As with ROMs, the number of addressable locations is often called the height, with the number of bits per unit called the width. For a variety of technical reasons, the newest and fastest SRAMs are typically available in narrow confi gurations: × 1 and × 4. Figure C.9.1 shows the input and output signals for a 2M × 16 SRAM.

Check Yourself

static random access mem ory (SRAM) A memory where data is stored statically (as in fl ip-fl ops) rather than dynami cally (as in DRAM). SRAMs are faster than DRAMs, but less dense and more expensive per bit.

FIGURE C.9.1 A 32K × 8 SRAM showing the 21 address lines (32K = 215) and 16 data inputs, the 3 control lines, and the 16 data outputs.

SRAM2M 3 16

Dout[15–0]

Address21

Din[15–0]16

Chip select

Output enable

Write enable

16

C-58 Appendix C The Basics of Logic Design

AppendixC-9780123747501.indd 58AppendixC-9780123747501.indd 58 26/07/11 6:29 PM26/07/11 6:29 PM

3

Page 4: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

SRAMreadport:dataoutLargeregister filesare impractical.BigMUX=significant gatedelay.

Largememories useasharedoutputline.

Nocentralgates/MUX tochooseoutput!

5

Page 5: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

WiredORs

Danger,WillRobinson!

(don'ttrythisathome/inthe lab,kids)

6

Page 6: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

(noninverting) tristate buffers

Control

In Out

In Control Out0 0 Z1 0 Z0 1 01 1 1

7

(activehigh)

Page 7: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

SRAMcell

8

oneoption

QD

CD Latch

QEnable

DataIn

Clock DataOut

TristateBuffer

Page 8: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

SRAMwriteport:

C.9 Memory Elements: SRAMs and DRAMs C-61

FIGURE C.9.3 The basic structure of a 4 × 2 SRAM consists of a decoder that selects which pair of cells to activate. The acti vated cells use a three-state output connected to the vertical bit lines that supply the requested data. The address that selects the cell is sent on one of a set of horizontal address lines, called word lines. For simplicity, the Output enable and Chip select signals have been omitted, but they could easily be added with a few AND gates.

latch

D

C

Enable

Q

D

0

2-to-4decoder

Write enable

Din[1]

latch

D

C

Enable

Q

D

Din[1]

Dout[1] Dout[0]

latch

D

C

Enable

Q

D

1

latch

D

C

Enable

Q

D

latch

D

C

Enable

Q

D

2

latch

D

C

Enable

Q

D

latch

D

C

Enable

Q

D

3

latch

D

C

Enable

Q

D

Address

AppendixC-9780123747501.indd 61AppendixC-9780123747501.indd 61 26/07/11 6:29 PM26/07/11 6:29 PM

Writeenable

Address

Dout[1] Dout[0]

Din[1] Din[0]

2-to-4decod

er

0

1

2

3

Writeenable

Addressselect

Din[i]

C.9 Memory Elements: SRAMs and DRAMs C-61

FIGURE C.9.3 The basic structure of a 4 × 2 SRAM consists of a decoder that selects which pair of cells to activate. The acti vated cells use a three-state output connected to the vertical bit lines that supply the requested data. The address that selects the cell is sent on one of a set of horizontal address lines, called word lines. For simplicity, the Output enable and Chip select signals have been omitted, but they could easily be added with a few AND gates.

latch

D

C

Enable

Q

D

0

2-to-4decoder

Write enable

Din[1]

latch

D

C

Enable

Q

D

Din[1]

Dout[1] Dout[0]

latch

D

C

Enable

Q

D

1

latch

D

C

Enable

Q

D

latch

D

C

Enable

Q

D

2

latch

D

C

Enable

Q

D

latch

D

C

Enable

Q

D

3

latch

D

C

Enable

Q

D

Address

AppendixC-9780123747501.indd 61AppendixC-9780123747501.indd 61 26/07/11 6:29 PM26/07/11 6:29 PM

Dataout:

Datain:

Dout[i]

Page 9: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

Organizationofa16x4SRAM

10

4to16decoder

4-bitaddress

dataout

(oneoption)

Page 10: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

Selecting location1101

4to16decoder

dataout

1101

11

4-bitaddress

Page 11: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

Anotherorganizationofa16x4SRAM

top2bitsaddress

Mux Mux Mux Mux

bottom2bitsaddress

Split-level row/columnaddressing=physicalmultidimensional array!

(row)

(column)

12

2to4decoder

Notice thesmaller decoder...howdoesthisaffecttiming?

Page 12: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

Selecting location0010

top2bitsaddress

Mux Mux Mux Mux

bottom2bitsaddress

(row)

(column)

13

2to4decoder

Nibbles"striped" across4smallermemories.

0010

1000

2

2

4

Page 13: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

Selecting location1101

top2bitsaddress

Mux Mux Mux Mux

bottom2bitsaddress

(row)

(column)

14

2to4decoder

Nibbles "striped"across4smallermemories.

1101

0111

22

4

Page 14: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

Whatvaluedoeslocation1010hold?

0 1 1 11 0 0 01 1 0 00 1 1 0

0 1 0 00 1 1 00 1 0 11 0 0 0

1 0 0 01 0 0 11 1 0 10 0 0 1

0 0 1 10 0 0 11 1 0 11 1 1 1

Mux Mux Mux Mux

15

2to4decoder

1010

22

4

Page 15: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

Organizationofa4Mx8SRAM

FIGURE C.9.4 Typical organization of a 4M × 8 SRAM as an array of 4K × 1024 arrays. The fi rst decoder generates the addresses for eight 4K × 1024 arrays; then a set of multiplexors is used to select 1 bit from each 1024-bit-wide array. This is a much easier design than a single-level decode that would need either an enormous decoder or a gigantic multiplexor. In practice, a modern SRAM of this size would probably use an even larger number of blocks, each somewhat smaller.

12to

4096decoder

Address[21–10]

4096

4K !1024

SRAM

4K !1024

SRAM

4K !1024

SRAM

4K !1024

SRAM

4K !1024

SRAM

4K !1024

SRAM

4K !1024

SRAM

4K !1024

SRAM

Mux

Dout7

Mux

Dout6

Mux

Dout5

Mux

Dout4

Mux

Dout3

Mux

Dout2

Mux

Dout1

Mux

Dout0

1024Address[9–0]

C-62

A

ppendix C

The Basics of Logic D

esign

AppendixC

-9780123747501.indd 62A

ppendixC-9780123747501.indd 62

26/07/11 6:29 PM

26/07/11 6:29 PM

=4MBmemory, sizeofalargecacheformodern laptop

Inpractice,single setofdatalinesoftentime-shared forread(out)/write(in). 16

(oneoption)

Page 16: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

DynamicRAM=DRAMDRAMstoresbitaschargeoncapacitor:

• 1transistor accesses storedcharge.• requires periodic refresh =read-write

(dynamicpower)

SRAM storesbitonpairofinvertinggates:• several transistors• requires continuous (static)power.

Word line

Pass transistor

Capacitor

Bit line

FIGURE C.9.5 A single-transistor DRAM cell contains a capacitor that stores the cell contents and a transistor used to access the cell.

Address[10–0]

Rowdecoder

11-to-2048

2048 ! 2048array

Column latches

Mux

Dout

FIGURE C.9.6 A 4M × 1 DRAM is built with a 2048 × 2048 array. The row access uses 11 bits to select a row, which is then latched in 2048 1-bit latches. A multiplexor chooses the output bit from these 2048 latches. The RAS and CAS signals control whether the address lines are sent to the row decoder or col umn multiplexor.

C-64 Appendix C The Basics of Logic Design

AppendixC-9780123747501.indd 64AppendixC-9780123747501.indd 64 26/07/11 6:29 PM26/07/11 6:29 PM

17

Page 17: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

DRAMdesign

Word line

Pass transistor

Capacitor

Bit line

FIGURE C.9.5 A single-transistor DRAM cell contains a capacitor that stores the cell contents and a transistor used to access the cell.

Address[10–0]

Rowdecoder

11-to-2048

2048 ! 2048array

Column latches

Mux

Dout

FIGURE C.9.6 A 4M × 1 DRAM is built with a 2048 × 2048 array. The row access uses 11 bits to select a row, which is then latched in 2048 1-bit latches. A multiplexor chooses the output bit from these 2048 latches. The RAS and CAS signals control whether the address lines are sent to the row decoder or col umn multiplexor.

C-64 Appendix C The Basics of Logic Design

AppendixC-9780123747501.indd 64AppendixC-9780123747501.indd 64 26/07/11 6:29 PM26/07/11 6:29 PM

Accesses entire row,storesincolumnlatches.Mainlyused forrefreshing entire rowatatime.Accessingothercolumnsinsamerowagaincheaper...?

Singlesetofaddress lines,time-shared forrowaddress, columnaddress.

18

(oneoption)

Page 18: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

64-bitDRAM

3to8row

decoder

Mux

Column latches

19

3-bitaddress

Dataout

Page 19: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

Readingbitataddress1010111.Selectrow

3to8row

decoder

Mux

Column latches

20

3-bitaddress

101

Dataout

Page 20: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

Readingbitataddress1010112.Copyrowtolatches

3to8row

decoder

Mux

Column latches

21

Rowisfading!

3-bitaddress

101

Dataout

Page 21: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

Readingbitataddress1010113.Refreshrowfromlatches

3to8row

decoder

Mux

Column latches

22

Refresh.

3-bitaddress

101

Dataout

Page 22: Memory Devices - Wellesley Collegecs240/s16/slides/ram.pdfSRAM: Static Random Access Memory In the Verilog for the register fi le in Figure C.8.11, the output ports corresponding

Readingbitataddress1010114.Selectcolumnfromlatches

3to8row

decoder

Mux

3-bitaddress

Column latches

23

011

Dataout