Docsity

Introduction to Electrical and Computer Engineering - Final Notes | ENGIN 112, Exams of Engineering

Partial preview of the text

Download Introduction to Electrical and Computer Engineering - Final Notes | ENGIN 112 and more Exams Engineering in PDF only on Docsity!

College of Engineering University of Massachusetts Amherst

ENGIN 112

Introduction to Electrical and

Computer Engineering

Fall 2008

Discussion A

14. ROM and Programmable Logic

Final Exam Friday, December 19, 1:30 โ€“ 3:30 PM, Marcus 131 (Auditorium). Exam is comprehensive (that is, will cover the entire course). Practice exam (2006 final exam) and solutions are on the web site. Lecture tomorrow will be devoted to Exam Q&A. My office hours before exam: (all in Marcus 215B) Friday, Dec. 12, 2:30 โ€“ 3:30 PM Tuesday, Dec. 16, 4:00 โ€“ 5:00 PM Friday, Dec. 19, 10:00 โ€“ 11:00 AM

  • In a typical ROM construction: the address lines are fed into a k x 2 k decoder. Each decoder output line corresponds to one stored n-bit word. There is a set of n OR gates, each corresponding to one output bit position. Initially (before data are stored in the ROM), each decoder output line is connected to every OR gate.

Example: Consider an 8 x 4 ROM: 4 3 x 8 Decoder

A 0 A 1 A 2 address lines B 0 B 1 B 2 B 3 output lines


  • Note that each crossing (connection) of a decoder output line and OR gate input line represents a single bit position. To store a 1 at that position: the connection is preserved (indicated with a ๏‚Ÿ or an x at the line crossing). To store a 0: the connection is broken (indicated by no symbol at the line crossing).
  • This is an example of programmable hardware (in fact, it is a programmable ROM (PROM) ) - words are written into the ROM by physically altering the device (breaking connections). Once connections are broken they cannot be restored, so the words in memory are permanent.

Example: In the 8 x 4 ROM of the previous example, suppose we want to store the words: 1101, 1001, 1001, 1001, 0101, 1010, 0111 and 1010. We can set up an input (address) - output (stored words) truth table for the ROM as follows:

3 x 8 Decoder

A 20 1 2 3 4 5 6

A 1 A 0 address lines B 3 B 2 B 1 B 0 output lines For example: If the address lines are (A 2 A 1 A 0 )=010, then line 2 out of the decoder carries a 1; all other lines are at 0. Line 2 is disconnected from the OR gates for B 1 and B 2 and remains connected to the OR gates for B 0 and B 3. So, the output (stored word) for address 010 is (B 3 B 2 B 1 B 0 )=1001.


  • Recall that a decoder with OR gates can be used to implement any logical function expressed as a sum of minterms. Since a ROM includes both a decoder and OR gates, it can also be interpreted as implementing logic functions that are expressed as sums of minterms.

Example: The 8 x 4 ROM of the previous example can be interpreted as implementing the logic functions: B 0 = ฮฃ {0,1,2,3,4,6} = A 2 โ€™ A 1 โ€™ A 0 โ€™ + A 2 โ€™ A 1 โ€™ A 0 + A 2 โ€™ A 1 A 0 โ€™ + A 2 โ€™ A 1 A 0 + A 2 A 1 โ€™ A 0 โ€™ + A 2 A 1 A 0 โ€™ B 1 = ฮฃ {5,6,7} = A 2 A 1 โ€™ A 0 + A 2 A 1 A 0 โ€™ + A 2 A 1 A 0 B 2 = ฮฃ {0,4,6} = A 2 โ€™ A 1 โ€™ A 0 โ€™ + A 2 A 1 โ€™ A 0 โ€™ + A 2 A 1 A 0 โ€™ B 3 = ฮฃ {0,1,2,3,5,7} = A 2 โ€™ A 1 โ€™ A 0 โ€™ + A 2 โ€™ A 1 โ€™ A 0 + A 2 โ€™ A 1 A 0 โ€™ + A 2 โ€™ A 1 A 0 + A 2 A 1 โ€™ A 0 + A 2 A 1 A 0


____________________________________________________________

Example: In the previous PROM example, we wanted to generate four functions (B 0 ,โ€ฆ,B 3 ). Now letโ€™s generate these with a PLA. First, use the truth table and Karnaugh maps to find simplified expressions for each function and its inverse. B 0 = ฮฃ {0,1,2,3,4,6} = A 2 โ€™ A 1 โ€™ A 0 โ€™ + A 2 โ€™ A 1 โ€™ A 0 + A 2 โ€™ A 1 A 0 โ€™ + A 2 โ€™ A 1 A 0 + A 2 A 1 โ€™ A 0 โ€™

  • A 2 A 1 A 0 โ€™ 1 1 1 1 1 1

A 2

A 1 ,A 0

B 0 = A 2 โ€™ + A 0 โ€™ B 0 โ€™ = A 2 A 0

B 1 = ฮฃ {5,6,7} = A 2 A 1 โ€™ A 0 + A 2 A 1 A 0 โ€™ + A 2 A 1 A 0

1 1 1

A 2

A 1 ,A 0

B 1 = A 2 A 0 + A 2 A 1 B 1 โ€™ = A 2 โ€™ + A 1 โ€™A 0 โ€™

B 2 = ฮฃ {0,4,6} = A 2 โ€™ A 1 โ€™ A 0 โ€™ + A 2 A 1 โ€™ A 0 โ€™ + A 2 A 1 A 0 โ€™

1 1 1

A 2

A 1 ,A 0

B 2 = A 1 โ€™ A 0 โ€™ + A 2 A 0 โ€™ B 2 โ€™ = A 0 + A 2 โ€™A 1

____________________________________________________________

Example: In our example we have: B 0 = A 2 โ€™ + A 0 โ€™ B 0 โ€™ = A 2 A 0 B 1 = A 2 A 0 + A 2 A 1 B 1 โ€™ = A 2 โ€™ + A 1 โ€™A 0 โ€™ B 2 = A 1 โ€™ A 0 โ€™ + A 2 A 0 โ€™ B 2 โ€™ = A 0 + A 2 โ€™A 1 B 3 = A 2 โ€™ + A 0 B 3 โ€™ = A 2 A 0 โ€™ We see that in order to generate B 0 โ€™, B 1 , B 2 , and B 3 โ€™, we need a total of four product terms: A 2 A 0 A 2 A 1 A 1 โ€™ A 0 โ€™ A 2 A 0 โ€™ So: Our PLA will require a total of four AND gates.


  • Step 3 in PLA design: Construct a programming table that shows which product terms are used to construct each function (or its complement).

Product Term Inputs A 2 A 1 A 0 Outputs B 3 B 2 B 1 B 0 A 2 A 0 1 - 1 - - 1 1 A 2 A 1 1 1 - - - 1 - A 1 โ€™ A 0 โ€™ - 0 0 - 1 - - A 2 A 0 โ€™ 1 - 0 1 1 - - C T T C 1 indicates input is in term; 0 indicates input is in term in complement form; - indicates input is not in term. 1 indicates term is in function; - indicates term is not in function. T indicates function itself is generated; C indicates complement of function is generated.


  • A PLA has pre-built AND, OR and XOR gates and connections. As in a PROM, we modify the hardware by breaking the connections that are not needed for our application.
  • Note that in the programming table: The inputs column determines the AND gate connections; the outputs column determines the OR gate connections; and the bottom row (that indicates whether each function is implemented in regular or complemented form) determines which output XOR gates are connected to 1 (inverting) or 0 (non- inverting).
  • So in a PLA: we โ€œprogramโ€ (through hardware modification) the connections to AND, OR and XOR gates. An alternative, called programmable array logic (PAL) has programmable AND gate connections but fixed OR gate connections. PAL is simpler to design than PLA, but not as flexible.
  • When programmable logic circuits are combined with flip-flops, we have a sequential programming device. One important device of this type is a field programmable gate array (FPGA) โ€“ these devices consist of thousands of logic blocks with programmable interconnections that can be set by the user.