Pages

Thursday, January 6, 2011

Behavioural Way of Programming - Basics




May the peace and blessings of the Almighty be upon you all…

We know that Hardware Description Languages are classified into three major categories, (i) Data flow way of programming, (ii) Structural way of programming and (iii) Behavioural way of programming. Having seen glimpses of data flow and structural way of programming in the previous posts, let us go ahead with the basics of behavioural way of programming in this post. 

As the name indicates, behavioural way of programming depends on behaviour of the project rather than internal circuitry of the project. 

To explain the point, let us take the example of 2*1 Mux.

To implement a 2*1 Mux in Data flow and Structural method, one should know the internal circuitry of the project. Whereas in behavioural method, that is not required. If one knows “how the project works”, that is sufficient to implement the project. 

To explain this more clearly, Let us take the inputs and outputs of the 2*1 Mux to be a0,a1,s(selection line) and y. We know that, 2*1 Mux operates in such a way that, if s=0 then output y selects the first input (a0), else it selects the second input (a1). 

Now, if we want to implement this mux in data flow way of programming, we need to draw the internal circuit of the mux and then write the program according to the circuit as shown below, 



Fine, if the same project to be implemented in the behavioural way, one does not bothers about the internal circuitry of the project and finishes the coding just by describing the behaviour of the circuit as shown below,



Behavioural method includes a key term called “PROCESS”. Next to process we find another important feature called “Sensitivity List”. Sensitivity list is nothing but the list of variables which can change the output. In the above example, inputs are the ones which change the output. Hence a0, a1 and s were placed inside the Sensitivity list. Generally sensitivity list holds the inputs and signals. Now, process has to be understood in the following way. It tells us that, “Process the below lines whenever there is a change in the variables of the sensitivity list”.

So, one can see from the above example that, behavioural way of programming doesn’t requires the internal circuitry of the project. All it requires is, just a description or behaviour of the project. That is why it is sometimes called “BLACK BOX MODELLING”

Hope this helps you…if you find it useful please share it with your friends…

Allah knows best.

Thanks and take care,

Your brother,
Aashiq Ahamed A

0 comments:

Post a Comment