I have searched to understand what is the difference between behavioral and data flow code in verilog
. at last i can't find good example for that, everywhere tell the thing that they do.
for example :
"Its very simple.Name itself explains what they are.Dataflow is one way of describing the program.Like describing the logical funtion of a particular design. Behavioral model on the other hand describes the behavior of the system.How does it behave when particular input is given?"
here is written very simple example but I need more examples.
Dataflow modeling in Verilog allows a digital system to be designed in terms of it's function. Dataflow modeling utilizes Boolean equations, and uses a number of operators that can acton inputs to produce outputs operators like + - && & ! ~ || | << >> {} so if i want to describe a 2 to 4 decoder in dataflow modeling i would be like this
module decoder2to4 ( e , a, b, do, dl, d2, d3);
input e, a, b;
output do, dl, d2, d3;
assign dO = ( e & ~a & ~b); //00
assign dl = (e & ~a & b); //01
assign d2 = (e & a & ~b); //10
assign d3 = ( e & a & b); //11
endmodu1e
on the other hand The Behavioral modeling in Verilog is used to describe the function of a design in an algorithmic manner so if i want to describe a 2 to 4 decoder in dataflow modeling i would be like this
module decoder2to4 (e, i, d);
output [3:0] d;
input [l:0]i;
input e;
reg [3:0] d;
always @ (i or e) begin
if (e==l) begin
case (i)
0: d = 4'b 0001;
1: d = 4'b 0010;
2: d = 4'b 0100;
3: d = 4'b 1000;
default d = 4'b xxxx;
endcase
end
else
d = 4'b0000;
end
endmodule
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With