23
ENGR 303 – Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

  • Upload
    others

  • View
    3

  • Download
    1

Embed Size (px)

Citation preview

Page 1: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

ENGR 303 – Introduction to Logic Design Lecture 10

Dr. Chuck BrownEngineering and Computer Information Science

Folsom Lake College

Page 2: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<2>

• Introduction to Memory Array

• Types of Memory

• Logic Design with Memory Arrays

Outline for Todays Lecture

ENGR 303

Page 3: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<3>

Address

Data

ArrayN

M

• Efficiently store large amounts of data

• 3 common types:

– Dynamic random access memory (DRAM)

– Static random access memory (SRAM)

– Read only memory (ROM)

• M-bit data value read/ written at each unique N-bit address

Memory Arrays

ENGR 303

Page 4: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<4>

Address

Data

ArrayN

M

Address Data

11

10

01

00

depth

0 1 0

1 0 0

1 1 0

0 1 1

width

Address

Data

Array2

3

• 2-dimensional array of bit cells

• Each bit cell stores one bit

• 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

Memory Arrays

ENGR 303

Page 5: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<5>

Address Data

11

10

01

00

depth

0 1 0

1 0 0

1 1 0

0 1 1

width

Address

Data

Array2

3

• 22 × 3-bit array

• Number of words: 4

• Word size: 3-bits

• For example, the 3-bit word stored at address 10 is 100

Memory Array Example

ENGR 303

Page 6: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<6>

Address

Data

1024-word x

32-bit

Array

10

32

Memory Arrays

ENGR 303

Array size: depth × width = 2N × M = 210 × 32 = 32Kbit (4KByte)

Modern DRAM memory chip size is 4-64Gbit

The Cyclone IV FGPA used in lab contains 6.5Mbits of embedded memory in

8Kbit (9Kbit with parity) blocks

Page 7: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<7>

stored

bit

wordline

bitline

stored

bit = 0

wordline = 1

stored

bit = 1

stored

bit = 0

stored

bit = 1

bitline =

(a) (b)

wordline = 1

wordline = 0

wordline = 0

bitline =

bitline =

bitline =

Memory Array Bit Cells

ENGR 303

Page 8: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<8>

stored

bit

wordline

bitline

stored

bit = 0

wordline = 1

stored

bit = 1

stored

bit = 0

stored

bit = 1

bitline =

(a) (b)

wordline = 1

wordline = 0

wordline = 0

bitline =

bitline =

bitline = 0

1

Z

Z

Memory Array Bit Cells

ENGR 303

Page 9: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<9>

wordline311

10

2:4

Decoder

Address

01

00

stored

bit = 0wordline

2

wordline1

wordline0

stored

bit = 1

stored

bit = 0

stored

bit = 1

stored

bit = 0

stored

bit = 0

stored

bit = 1

stored

bit = 1

stored

bit = 0

stored

bit = 0

stored

bit = 1

stored

bit = 1

bitline2

bitline1

bitline0

Data2

Data1

Data0

2

• Wordline: – like an enable

– single row in memory array read/written

– corresponds to unique address

– only one wordline HIGH at once

Memory Array

ENGR 303

Page 10: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<10>

• Random access memory (RAM): volatile

• Read only memory (ROM): nonvolatile

Types of Memory

ENGR 303

Page 11: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<11>

• Volatile: loses its data when power off

• Read and written quickly

• Main memory in your computer is RAM

(DRAM)

Historically called random access memory because any data

word accessed as easily as any other (in contrast to sequential

access memories such as a tape recorder)

RAM: Random Access Memory

ENGR 303

Page 12: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<12>

• Nonvolatile: retains data when power off

• Read quickly, but writing is impossible or slow

• NOR Flash memory used in embedded electronics

for code storage, and are byte addressable

• NAND Flash memory in thumb drives and digital

cameras for data storage, are page addressable

ROM: Read Only Memory

ENGR 303

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 that can be re-written.

Page 13: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<13>

• DRAM (Dynamic random access memory)

• SRAM (Static random access memory)

• Differ in how they store data:

– DRAM uses a capacitor

– SRAM uses cross-coupled inverters

Types of RAM

ENGR 303

Page 14: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<14>

wordline311

10

2:4

Decoder

Address

01

00

stored

bit = 0wordline

2

wordline1

wordline0

stored

bit = 1

stored

bit = 0

stored

bit = 1

stored

bit = 0

stored

bit = 0

stored

bit = 1

stored

bit = 1

stored

bit = 0

stored

bit = 0

stored

bit = 1

stored

bit = 1

bitline2

bitline1

bitline0

Data2

Data1

Data0

2

wordline

bitline bitline

wordline

bitline

DRAM bit cell: SRAM bit cell:

Memory Arrays Review

ENGR 303

Page 15: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<15>

11

10

2:4

Decoder

Address

Data0Data1Data2

01

00

2

wordline

bitline

wordline

bitline

bit cell

containing 0

bit cell

containing 1

ROM: Dot Notation

ENGR 303

A Dot equates to a stored logic 1

Page 16: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<16>

11

10

2:4

Decoder

Address

Data0Data1Data2

01

00

2

Address Data

11

10

01

00

depth

0 1 0

1 0 0

1 1 0

0 1 1

width

ROM Storage

ENGR 303

Page 17: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<17>

11

10

2:4

Decoder

Address

Data0Data1Data2

01

00

2 Data2 = A1 A0

Data1 = A1’ + A0

Data0 = A1’A0’

ROM Logic

ENGR 303

Page 18: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<18>

11

10

2:4

Decoder

A, B

ZYX

01

00

2

Implement the following logic functions using a 22 × 3-bit

ROM:

– X = AB

– Y = A + B

– Z = A B’

Example: Logic with ROMs

ENGR 303

Page 19: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<19>

11

10

2:4

Decoder

A, B

ZYX

01

00

2

Implement the following logic functions using a 22 × 3-bit

ROM:

– X = AB

– Y = A + B

– Z = A B’

Example: Logic with ROMs

ENGR 303

A B X Y Z

1 1 1 1 0

1 0 0 1 1

0 1 0 1 0

0 0 0 0 0

2. Map each logic 1 in the truth table as a

Dot in the memory array

1. Map each logic expression

Reversed table to match decoder

Page 20: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<20>

wordline311

10

2:4

Decoder

Address

01

00

stored

bit = 0wordline

2

wordline1

wordline0

stored

bit = 1

stored

bit = 0

stored

bit = 1

stored

bit = 0

stored

bit = 0

stored

bit = 1

stored

bit = 1

stored

bit = 0

stored

bit = 0

stored

bit = 1

stored

bit = 1

bitline2

bitline1

bitline0

Data2

Data1

Data0

2

Logic with Any Memory Array

ENGR 303

Data2 = A1 A0

Data1 = A1’ + A0

Data0 = A1’A0’

Page 21: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<21>

Implement the following logic functions using a 22 × 3-bit

memory array:

– X = AB

– Y = A + B

– Z = A B’

Logic with Memory Arrays

ENGR 303

Page 22: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<22>

wordline311

10

2:4

Decoder

A, B

01

00

stored

bit = 1wordline

2

wordline1

wordline0

stored

bit = 1

stored

bit = 0

stored

bit = 0

stored

bit = 1

stored

bit = 1

stored

bit = 0

stored

bit = 1

stored

bit = 0

stored

bit = 0

stored

bit = 0

stored

bit = 0

bitline2

bitline1

bitline0

X Y Z

2

Implement the following logic functions using a 22 × 3-bit

memory array:

– X = AB

– Y = A + B

– Z = A B’

Logic with Memory Arrays

ENGR 303

A Dot equates to a stored logic 1

Page 23: ENGR 303 Introduction to Logic Design Lecture 10...ENGR 303 –Introduction to Logic Design Lecture 10 Dr. Chuck Brown Engineering and Computer Information Science Folsom Lake College

<23>

stored

bit = 1

stored

bit = 0

00

01

2:4

Decoder

A

stored

bit = 0

bitline

stored

bit = 0

Y

B

10

11

4-word x 1-bit Array

A B Y

0 0

0 1

1 0

1 1

0

0

0

1

Truth

Table

A1

A0

Called lookup tables (LUTs): look up output at each input

combination (address)

Logic with Memory Arrays

ENGR 303