Programmable logic Devices: Practical ,common applications of .

takao21203

Joined Apr 28, 2012
3,702
I think you mean to write PLD, a PLA is a very specific technology, where a PLD can be implemented using many types of technologies.


A MCU has a specific architecture, not-programmable(you cannot exchange the 8-bit ALU with a 16-bit ALU), though it can be done in a PLD. The programming of the microcontroller is simply writing RTL opcodes in a certain location in memory in order to produce a desired output within an existing architecture.
So, yes, it does implement a PLD functionality because it has only one implementation, which cannot be changed. Ever.

At the risk of fanning the fire, you cannot program a PLD. You describe it in a HDL(Verilog, VHDL, etc.), and burn the configuration to the PLD(technology specific). No program runs on the PLD, it has a specific configuration which is created in the translation from HDL to implementation.
It's kinda like of this korean ying-yang.

A PLD does not run a program if you take it literally. However, the way it iterates through it's state machine logic, it is certainly possible to work on a large data tables.

The content...well it could be a primitive opcode language with only 2 or 3 different opcodes. So after that, you actually have a program.

Such a state machine with only a very few opcodes really existed- the Amiga "Copper".

Everything that processes a set of data in a delta-time manner is "programable"- if you can change this data set.

The problem with giving literal explanations about these technologies is these explanations might suggest some kind of education or instruction, in the end it is more a ballast than a helping. And it might be wrong. If you disregard execution speed, and take granted unlimited memory, you can really implement nearly anything using any kind of electric devices. The technologies are interchangeable, they can be mixed, they can emulate each other.

At first you really need to know what you want to do, build or program. Then you need to understand existing technology.

Without creativity, working in the field of programming and digital logic only will result in some trivial kind of solution or re-use of something that already exists.

Not that this would be totally wrong. But it is actually most helpful if you take let say a handful of PALs, or small microcontrollers, and really think about it- what could be built with these? What if I connect 3 of these controllers? How can they work and communicate in a way it makes sense? Is there more than one solution?
 

tshuck

Joined Oct 18, 2012
3,534
A PLD does not run a program if you take it literally
A PLD does not run a program if you take it to be a PLD. A state machine is a series of flip flops with output forming logic and input forming logic in order to determine the next state. A state machine forces a PLD into a Turing machine. That is one application where there are many others. Some require no state machine.

Everything that processes a set of data in a delta-time manner is "programable"- if you can change this data set.
You misunderstand. I do not mean to say that a program cannot be run on a PLD, just that the logic is programmable: you may change the implementation of a PLD, whereas you cannot on a μC.

A microcontroller is programmable, but that does not make it programmable logic.
 

takao21203

Joined Apr 28, 2012
3,702
A PLD does not run a program if you take it to be a PLD. A state machine is a series of flip flops with output forming logic and input forming logic in order to determine the next state. A state machine forces a PLD into a Turing machine. That is one application where there are many others. Some require no state machine.



You misunderstand. I do not mean to say that a program cannot be run on a PLD, just that the logic is programmable: you may change the implementation of a PLD, whereas you cannot on a μC.

A microcontroller is programmable, but that does not make it programmable logic.
If you want, the fusemap on the PLD is "the program". The registers are the "RAM". It is of course true a PLD works on a lower level than a MCU.

The program on a PLD is based on the concept of individual gates (or macro cells etc.), and a fusemap.

On a MCU you also have kind of a fusemap as program memory, but there are basic concepts which apply, such a reset vector, program counter, ALU, registers, opcodes. And that is hardwired into that MCU.

While on the PLD, the "hardwired" level is that of the individual gates or macrocells.

As I say the user base for PLDs is much smaller than the user base for MCUs. If you don't plan to do things which you can not do with an MCU (or not reasonably), you don't really need PLDs.

Smaller PLDs are not very flexible, so except for address decoding and other specialized purposes, they were actually not used much. Even if you really could build a large computer from PLDs.

OP also mentioned relay based circuits. They are still built sometimes if you really simply need a flip-flop. Even if you could do this on a FPGA, a 1000 MHz MCU and all the like.

What is built or how things are built is mainly dictated by economics. Uneconomic technology will fall into disuse from one day to the other. While there will always be some people who continue to use it for research, education, or hobby.

It is also true you can call almost any program sequence a state machine (or a FSM). But, it does not always make too much sense, or has advantage. Typically you only want a few state machines (or let say, you apply the FSM concept to a few sections of your program).
 

tshuck

Joined Oct 18, 2012
3,534
If you want, the fusemap on the PLD is "the program". The registers are the "RAM". It is of course true a PLD works on a lower level than a MCU.

The program on a PLD is based on the concept of individual gates (or macro cells etc.), and a fusemap.

On a MCU you also have kind of a fusemap as program memory, but there are basic concepts which apply, such a reset vector, program counter, ALU, registers, opcodes. And that is hardwired into that MCU.

While on the PLD, the "hardwired" level is that of the individual gates or macrocells.
While your analogy might help explain the process, it is just that, an analogy. By the same logic, if I wire up a purely combinational logic circuit and change one input, I have reprogrammed the circuit, when all i have done is change the input configuration of the a predefined circuit.


As I say the user base for PLDs is much smaller than the user base for MCUs. If you don't plan to do things which you can not do with an MCU (or not reasonably), you don't really need PLDs.
Whoa, whoa! let's not make erroneous and wayyyyyyy over generalizations here. You forget the people that drive cars! Lots of cars have a FPGA in them! Even NASA uses FPGAs!

Now, you might say the majority of hobbyists do not use PLDs, and I would not argue with that. Let's stick to things we can discuss.


It is also true you can call almost any program sequence a state machine (or a FSM). But, it does not always make too much sense, or has advantage. Typically you only want a few state machines (or let say, you apply the FSM concept to a few sections of your program).
Almost? It is a property of the Turing machine from which computers are based...

A computer with a PC is a state machine. Next state = this state +1, unless branch
 

takao21203

Joined Apr 28, 2012
3,702
While your analogy might help explain the process, it is just that, an analogy. By the same logic, if I wire up a purely combinational logic circuit and change one input, I have reprogrammed the circuit, when all i have done is change the input configuration of the a predefined circuit.
Yes I agree the "program" you maintain in a PLD is not neccessarily including or requiring a program counter, ALU, or a fixed way of branching. It can be kind of a program. It really depends. If you flash a decoding pattern for a LED display to a GAL, it is not really a program.

Whoa, whoa! let's not make erroneous and wayyyyyyy over generalizations here. You forget the people that drive cars! Lots of cars have a FPGA in them! Even NASA uses FPGAs!

Now, you might say the majority of hobbyists do not use PLDs, and I would not argue with that. Let's stick to things we can discuss.
Yes but I mean "using" in terms of "programming" them, or interacting with them professionally. And yes I saw one inside a large television flat panel- or two.

The end user base...yes if you mean that...

Almost? It is a property of the Turing machine from which computers are based...

A computer with a PC is a state machine. Next state = this state +1, unless branch
Yes but for practical reasons it is often good not to look at that too much. The logic that is understood well gets buried, and the rest gets called "FSM".

Computers are based on Turing machines? That's as ridiciulous as to say someone actually "invented" human DNA. Which itself also is kind of a computation.

What is true is Turing actually had a room with toilet paper sheets, and some kind of stones. He used it to imitate magnetic tape. I don't know if magnetic tape already existed at this point of time. Or if it was meant to be used digitally.

The hexdecimal system actually exists for a long time, so other systems than decimal existed before actual computers existed physically.

OP seems to have abandoned the thread...
 

takao21203

Joined Apr 28, 2012
3,702
For instance I found it rather useless to add delays and branching to test keys each time, especially in assembler. Something like

Rich (BB code):
   unsigned char key_handler(unsigned char k)
   {
       if(k==0)
       {
        if((io_0&0x01)==0)
        {
         k++;
         return(k);
        }
       }
       if(k==1)
       {
        if((io_0&0x01)==1)
        {
         k++;
         return(k);
        }
       }

       return(k);
   }
, only based on branching.

I isolated the data into one specific bit, and wrote a generic function for it.

Rich (BB code):
unsigned char key_handler(unsigned char k)
   {
       if(k==0){if((io_0&0x01)==0){k++;return(k);}}
       if(k==1){if((io_0&0x01)==1){k++;return(k);}}
       return(k);
   }
State machines are ominpresent when you write programs for an MCU, including the fact a program counter is used which normally increments +1.

Normally you just don't want to consider FSM all the time. Sometimes it can be highly useful.

It is required to implement any kind of communication protocol. Based on the control signals, various individual states are traversed.

Without to know a specific purpose, or specific type of silicon that is going to be used, all this theoretical discussion is kind of limited.

OP does not really understand application of PLD at all, so let's dig up matter that has something to do with PLD.

And of course the counterpart, which communicates with the key handler:

Rich (BB code):
io_0&=0xfe;
         if((PORTC&0x08)==0x08)io_0|=0x01;
         key0=key_handler(key0);
Most elements of digital logic, or circuits based upon it, as well PLDs, FSM and all that don't make too much sense without to know "communications".

You see the code which gathers data, and calls the key handler, and obtains the output. Together with that, the key handler FSM makes sense.

I would suggest OP to take a look at communications, protocols, communication protocols, and if he wanted to, FSM.
 

tshuck

Joined Oct 18, 2012
3,534
Computers are based on Turing machines? That's as ridiciulous as to say someone actually "invented" human DNA. Which itself also is kind of a computation.
Now, there's no need to try to ridicule anyone on these forums, nor their ideas. They are meant for the dissemination of information. What we are having is a debate, albeit a semantic one, a debate nonetheless.

Instead, allow me to elaborate on what I meant. Computers exhibit the same behavior as a Turing machine, within the physical constraints. They move from one instruction to the next and are capable of algorithmic computation.

The end user base...yes if you mean that...
FPGAs are used quite frequently in professional applications. You should not generalize your hobbyist experiences to the entire world of embedded system design.

For instance I found it rather useless to add delays and branching to test keys each time, especially in assembler. Something like

Code:
unsigned char key_handler(unsigned char k)
{
if(k==0)
{
if((io_0&0x01)==0)
{
k++;
return(k);
}
}
if(k==1)
{
if((io_0&0x01)==1)
{
k++;
return(k);
}
}

return(k);
}
Select All
, only based on branching.

I isolated the data into one specific bit, and wrote a generic function for it.
I don't understand, you've done the same thing in both versions...:confused:

The hexdecimal system actually exists for a long time, so other systems than decimal existed before actual computers existed physically.
That is neither here, nor there...

Moving back to the point of departure for our conversation, a microcontroller is restricted to operate on one fixed width of data in its architecture. A FPGA is restricted only by the available LEs. Additionally, a FPGA operates concurrently, can be restricted to states, but can implement more than one state machine at a time.

So, I say again, a FPGA can implement a microcontroller, a microcontroller cannot implement a FPGA.
 
Top