Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
blocking is step by step process and it is the systhesis the comdination ckt
non blocking is the concurrent process and it is the systhesis the sequential ckt
Blocking Statements: A blocking statement must be executed before the execution of the statements that follow it in a sequential block.
Nonblocking Statements: Nonblocking statements allow you to schedule assignments without blocking the procedural flow. You can use the nonblocking procedural statement whenever you want to make several register assignments within the same time step without regard to order or dependence upon each other. It means that nonblocking statements resemble actual hardware more than blocking assignments.
1 module block_nonblock();
2 reg a, b, c, d , e, f ;
3
4 // Blocking assignments
5 initial begin
6 a = #10 1'b1;// The simulator assigns 1 to a at time 10
7 b = #20 1'b0;// The simulator assigns 0 to b at time 30
8 c = #40 1'b1;// The simulator assigns 1 to c at time 70
9 end
10
11 // Nonblocking assignments
12 initial begin
13 d <= #10 1'b1;// The simulator assigns 1 to d at time 10
14 e <= #20 1'b0;// The simulator assigns 0 to e at time 20
15 f <= #40 1'b1;// The simulator assigns 1 to f at time 40
16 end
17
18 endmodule
When you guys said:
use blocking for combinational and non-blocking for sequential.....
what do it really mean? Cause in Verilog HDL, we are implementing the combinational logic within the block ( which is control by posedge CLK or nedege CLK).
For example,
always(@posedge CLK) begin
a = b+c;
d = e+f;
x = a&d;
end
In this example the statement within the block is combinational logic. And this combonation logic is located within the 2 flop control by the posedge CLK.
Can you help to explain in more details on this statement (use blocking for combinational and non-blocking for sequential)?
Your example is a combinational with a flip flop at the output.
Actually, your example is a sequential design.
Why?
Because you use clock edge.
When to use blocking (=)?
We use blocking when we want to design PURELY combinational circuit.
Example:
wire [2:0] x;
assign x = a + b;
OR
reg [2:0] x;
always @(a or b) // here I'm not using any clock edge (flops)
begin
x = a + b; // adder circuit (purely combinational)
end
As for non-blocking (<=), we use it for sequential circuit, where the circuit is using clock edge. Flop is a sequential circuit.
Example:
reg [2:0] x;
always @(posedge clock)
begin
x <= a + b; // there will be flip flops at output X
end
For better understanding, try to synthesis all the example given.
Before that my personal opinion, you need to understand both pure combinational circuit and sequential circuit.
A blocking statement blocks the statements after it. A set of blocking statements execute sequentially.
A non-blocking statement does block the statements with it. they execute concurrently..
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.