Design of Feedback Oscillator:
The feedback oscillator which is going to be designed as shown below.
Case-1: using NBA
always@(posedge clk, negedge rst) begin
if (rst) a <= 0;
else a <= b;
end
always@(posedge clk, negedge rst) begin
if (rst) b <= 1;
else b <= a;
end
Here always blocks are executed in any order, when reset = 1 then a = 0,b = 1 and when reset is released then a = 1, b = 0.In next posedge the values of a and b are interchanged and this process continuous until the end of simulation.
Case-2: using BA
always@(posedge clk, negedge rst) begin
if (rst) a = 0;
else a = b;
end
always@(posedge clk, negedge rst) begin
if (rst) b = 1;
else b = a;
end
Here the values of a and b depends on the order of execution of always blocks i.e., Race condition.
No comments:
Post a Comment