Presentation is loading. Please wait.

Presentation is loading. Please wait.

Memory Taken from Digital Design and Computer Architecture by Harris and Harris and Computer Organization and Architecture by Null and Lobur.

Similar presentations


Presentation on theme: "Memory Taken from Digital Design and Computer Architecture by Harris and Harris and Computer Organization and Architecture by Null and Lobur."— Presentation transcript:

1 Memory Taken from Digital Design and Computer Architecture by Harris and Harris and Computer Organization and Architecture by Null and Lobur

2 Single-Cycle Processor
Copyright © 2007 Elsevier

3 Memory Arrays Efficiently store large amounts of data
Three common types: Dynamic random access memory (DRAM) Static random access memory (SRAM) Read only memory (ROM) An M-bit data value can be read or written at each unique N-bit address. Copyright © 2007 Elsevier

4 Memory Arrays Two-dimensional array of bit cells
Each bit cell stores one bit An array with N address bits and M data bits: 2N rows and M columns Depth: number of rows (number of words) Width: number of columns (size of word) Array size: depth × width = 2N × M Copyright © 2007 Elsevier

5 Memory Array: Example 22 × 3-bit array Number of words: 4
Word size: 3-bits For example, the 3-bit word stored at address 10 is 100 Example: Copyright © 2007 Elsevier

6 Memory Arrays Copyright © 2007 Elsevier

7 Memory Array Bit Cells Example: Copyright © 2007 Elsevier

8 Memory Array Bit Cells Example: Z 1 Z Copyright © 2007 Elsevier

9 Memory Array Wordline: similar to an enable
allows a single row in the memory array to be read or written corresponds to a unique address only one wordline is HIGH at any given time Copyright © 2007 Elsevier

10 Types of Memory Random access memory (RAM): volatile
Read only memory (ROM): nonvolatile Copyright © 2007 Elsevier

11 RAM: Random Access Memory
Volatile: loses its data when the power is turned off Read and written quickly Main memory in your computer is RAM (DRAM) Historically called random access memory because any data word can be accessed as easily as any other (in contrast to sequential access memories such as a tape recorder) Copyright © 2007 Elsevier

12 ROM: Read Only Memory Nonvolatile: retains data when power is turned off Read quickly, but writing is impossible or slow Flash memory in cameras, thumb drives, and digital cameras are all ROMs Historically called read only memory because ROMs were written at manufacturing time or by burning fuses. Once ROM was configured, it could not be written again. This is no longer the case for Flash memory and other types of ROMs. Copyright © 2007 Elsevier

13 Types of RAM Two main types of RAM:
Dynamic random access memory (DRAM) Static random access memory (SRAM) Differ in how they store data: DRAM uses a capacitor SRAM uses cross-coupled inverters Copyright © 2007 Elsevier

14 Robert Dennard, 1932 - Invented DRAM in 1966 at IBM
Others were skeptical that the idea would work By the mid-1970’s DRAM was in virtually all computers Copyright © 2007 Elsevier

15 DRAM Data bits stored on a capacitor
Called dynamic because the value needs to be refreshed (rewritten) periodically and after being read: Charge leakage from the capacitor degrades the value Reading destroys the stored value Copyright © 2007 Elsevier

16 DRAM Copyright © 2007 Elsevier

17 SRAM Copyright © 2007 Elsevier

18 Memory Arrays DRAM bit cell: SRAM bit cell: Copyright © 2007 Elsevier

19 ROMs: Dot Notation To read the cell the bitline is weakly pulled high.
Copyright © 2007 Elsevier

20 ROM Storage Copyright © 2007 Elsevier

21 ROM Logic Data2 = A1 Å A0 Data1 = A1 + A0 Data0 = A1A0
Copyright © 2007 Elsevier

22 Example: Logic with ROMs
Implement the following logic functions using a 22 × 3-bit ROM: X = AB Y = A + B Z = A B A, B X Y z Copyright © 2007 Elsevier

23 Example: Logic with ROMs
Implement the following logic functions using a 22 × 3-bit ROM: X = AB Y = A + B Z = A B Copyright © 2007 Elsevier

24 Logic with Memory Arrays
Called lookup tables (LUTs): look up output at each input combination (address) Copyright © 2007 Elsevier

25 Fujio Masuoka, 1944- Developed memories and high speed circuits at Toshiba from Invented Flash memory as an unauthorized project pursued during nights and weekends in the late 1970’s. The process of erasing the memory reminded him of the flash of a camera Toshiba slow to commercialize the idea; Intel was first to market in 1988 Flash has grown into a $25 billion per year market. Copyright © 2007 Elsevier

26 Reprogrammable ROM Electronically erasable PROM (EEPROM)
Flash memory is similar Programmable ROM (PROM)

27 Multi-ported Memories
Port: address/data pair 3-ported memory 2 read ports (A1/RD1, A2/RD2) 1 write port (A3/WD3, WE3 enables writing) Small multi-ported memories are called register files Copyright © 2007 Elsevier

28 Verilog Memory Arrays // 256 x 3 memory module with one read/write port module mem( input clk, we, input [7:0] a input [2:0] wd, output [2:0] rd); reg [2:0] RAM[255:0]; assign rd = RAM[a]; clk) if (we) RAM[a] <= wd; endmodule Copyright © 2007 Elsevier

29 Initializing Memory module mem(input clk, we, input [7:0] a input [2:0] wd, output [2:0] rd); reg [2:0] RAM[255:0]; assign rd = RAM[a]; clk) if (we) RAM[a] <= wd; initial begin $readmemb("memVectors.txt", RAM); end endmodule

30 Parameterized memory module
module ram # (parameter N = 6, M = 32) ( input clk, we, input [N-1:0] adr, input [M-1:0] din, output [M-1:0] dout); reg [M-1:0] mem[2**N-1:0]; clk) if (we) mem[adr] <= din; assign dout = mem[adr]; endmodule module bigRam (input clk, we, input [9:0] adr, input [31:0] din, output [31:0] dout); // instantiate the ram ram #(10,32) memory(clk, we, adr, din, dout); endmodule Copyright © 2007 Elsevier

31 Memory Organization Memory can be byte-addressable, or word-addressable, where a word typically consists of two or more bytes. Memory is constructed of RAM chips, often referred to in terms of length  width.

32 4.6 Memory Organization Physical memory usually consists of more than one RAM chip. Access is more efficient when memory is organized into banks of chips with the addresses interleaved across the chips With low-order interleaving, the low order bits of the address specify which memory bank contains the address of interest. Accordingly, in high-order interleaving, the high order address bits specify the memory bank. The next slide illustrates these two ideas.

33 Low-Order Interleaving High-Order Interleaving
4.6 Memory Organization Low-Order Interleaving High-Order Interleaving

34 4.6 Memory Organization Example: Suppose we have a memory consisting of 16 2K x 8 bit chips. Memory is 32K = 25  210 = 215 15 bits are needed for each address. We need 4 bits to select the chip, and 11 bits for the offset into the chip that selects the byte.

35 4.6 Memory Organization In high-order interleaving the high-order 4 bits select the chip. In low-order interleaving the low-order 4 bits select the chip.


Download ppt "Memory Taken from Digital Design and Computer Architecture by Harris and Harris and Computer Organization and Architecture by Null and Lobur."

Similar presentations


Ads by Google