Channels ▼

Al Williams

Dr. Dobb's Bloggers

Electronic Legos

November 04, 2011

Last week, I started talking about how programmable logic devices have become accessible enough that they are finding their way into all sorts of embedded systems. There are actually quite a few types of programmable devices. You can think of these chips like a child's construction kit: There are a lot of pieces. You can build an airplane, or a truck, or a house, or anything else by snapping pieces together in different ways. However, each type of device has its own peculiarities, and this time I wanted to look at what's available.

Regardless of the type of device, they all have some similarities. Perhaps the simplest programmable logic device is a memory chip (like an EPROM or a flash memory). Suppose you have a memory chip that has 256 bytes of memory (that is, it has 8 address lines and 8 data lines). You could think of that chip as an 8-input "truth table." It could emulate any combination of AND, OR, and NOT logic that had 8 inputs and 8 outputs. A stupid example would be if you wanted to program the chip to be an inverter. You'd simply program the following into the chip:

00000000 -> 11111111
00000001 -> 11111110
. . .
11111111 -> 00000000

With that program, any 8 bits you put in, get inverted at the output. You could just as easily build, say, a 2-bit full adder (a binary adder that has both a sum and carry output). To make it simple, assume the memory device only has two address bits (4 words) and 2-bit words. Otherwise, I'll have to make a big table. The adder would look like this:

00 -> 00
01 -> 10
10 -> 10
11 -> 01

The leftmost output bit is the sum and the rightmost is the carry. If you notice, the sum bit is really an exclusive or (one bit or the other but not both). In general, anything you can describe as combinatorial (or combinational) logic. That is, a combination of and, or, and invert operations. The real key is that the outputs of a combinatorial circuit depend only on the state of the inputs. If the output depends on previous outputs, that's a different kind of logic.

In theory, you could represent logic that has previous output dependency (sequential logic) using a memory chip, but in practice it's usually done differently. But for now, the key idea is that a memory device can simulate an arbitrarily complex combinatorial logic equation.

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 


Video