electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

what is the difference between #1 a<=b and a<=#1 b


Post new topic  Reply to topic    EDAboard.com Forum Index -> ASIC Design Methodologies & Tools (Digital) -> what is the difference between #1 a<=b and a<=#1 b
Author Message
tigerajs



Joined: 08 Feb 2006
Posts: 30


Post20 Feb 2006 2:17   

what is the difference between #1 a<=b and a<=#1 b


plz help me
Back to top
aravind



Joined: 29 Jun 2004
Posts: 622
Helped: 23
Location: india


Post20 Feb 2006 2:40   

what is the difference between #1 a<=b and a<=#1 b


it is thumb rule u should not use a = #5 b;
u can use #5 a= b;
because it is blocking statement.
1.it blocks b value for 5 secs and give it to a
2.a=b value happen after 5 secs .

simillary for non-blocking statement its vice versa
u must follow a <= #5b
because it wont block corresponding statements
Back to top
jarodz



Joined: 12 Mar 2005
Posts: 100
Helped: 14


Post20 Feb 2006 5:43   

what is the difference between #1 a<=b and a<=#1 b


A. #5 a = b, after 5 time unit, simulator execute assign value of b to a.
B. a = #5 b, when simulator execute this statement,
keep the current value of b, and then assign this keeped value to a after 5 time unit.
It is same with "<=".



Sincerely,
Jarod
Back to top
nand_gates



Joined: 19 Jul 2004
Posts: 907
Helped: 120


Post20 Feb 2006 7:32   

Re: what is the difference between #1 a<=b and a<=#1 b


These are the ways one model transport delay and inertial delay in verilog simulator.
If ur are familiar with VHDL you will get it!
I am assuming timescale as 1ns
#1 a<=b // This models transport delay b will appear at 'a' after 1 ns
a<=#1 b // This models inertial delay 'a' follows 'b' after 1 ns delay in additin to this
any pulse < 1ns will get filter out at 'a'

Plaese refer the link below for VHDL!
http://www.gmvhdl.com/delay.htm
Back to top
novise



Joined: 14 Feb 2006
Posts: 12


Post20 Feb 2006 15:38   

Re: what is the difference between #1 a<=b and a<=#1 b


when #1a<=b is used b(t) is assigned a at time t+1 ,on the other hand when a<=#1b is used b(t+1) is assigned to a at time t+1
Back to top
Google
AdSense
Google Adsense




Post20 Feb 2006 15:38   

Ads




Back to top
rsjgs



Joined: 14 Feb 2006
Posts: 10


Post26 Feb 2006 18:37   

Re: what is the difference between #1 a<=b and a<=#1 b


the difference is that in the first case the evaluation of the RHS takes place immediately but assigment after 1 ns. In the second case evaluation itself done after 1 ns
Back to top
darylz



Joined: 24 Mar 2005
Posts: 132
Helped: 4


Post27 Feb 2006 2:21   

what is the difference between #1 a<=b and a<=#1 b


that nand_gates said is extract!
Back to top
bracketx



Joined: 11 Jan 2006
Posts: 12


Post28 Feb 2006 12:20   

what is the difference between #1 a<=b and a<=#1 b


hehe,there's several explanation.
Back to top
positive_edge



Joined: 13 Feb 2006
Posts: 6


Post01 Mar 2006 19:12   

Re: what is the difference between #1 a<=b and a<=#1 b


1)

#1 a <= b

Evaluation of the assignment is delayed by the timing control.
RHS expression evaluated.
Assignment is scheduled ie a <--- b(t + 1 )

2)a <= #1 b

RHS expression evaluated .
Assignment is delayed by the timing control and is scheduled at the end of the queue.
Flow continues on.
a<-- b at simulation time t + 1
Back to top
AlexWan



Joined: 26 Dec 2003
Posts: 305
Helped: 6


Post02 Mar 2006 8:44   

Re: what is the difference between #1 a<=b and a<=#1 b


1 #N a<=b
Adding delays to the left-hand-side (LHS) of nonblocking assignments to model combinational logic is flawed.
Code:

module adder_t2 (co, sum, a, b, ci);
   output co;
   output [3:0] sum;
   input [3:0] a, b;
   input ci;

   reg co;
   reg [3:0] sum;

   always @(a or b or ci)
       #12 {co, sum} <= a + b + ci;
endmodule

If the a input changes at time 15, then if the a, b and ci inputs all change during the next 9ns, the outputs will be updated with the latest values of a, b and ci. This modeling style permitted the ci input to propagate a value to the sum and carry outputs after only 3ns instead of the required 12ns propagation delay.

So do not place delays on the LHS of nonblocking assignments to model combinational logic. This is a bad coding style.

Any guys may get the more detail inforamtion from Clifford E. Cummings papers.[/code]
Back to top
weng



Joined: 13 Jan 2006
Posts: 32


Post03 Mar 2006 19:01   

Re: what is the difference between #1 a<=b and a<=#1 b


Do these blocking and nonblocking assignment reflect the actual circuit?

Can anyone code an example?
Back to top
Vonn



Joined: 06 Oct 2002
Posts: 254
Helped: 2


Post06 Mar 2006 1:25   

Re: what is the difference between #1 a<=b and a<=#1 b


sure it does ... here is an example :

if you write in your process :

a = 1;
b = a;
c = b;
these are Blocking assignment a = b = c = 1 and the generated circuit will be a 3 buffers connected to each others

1 ---[buffer]--->a---[buffer]--->b---[buffer]--->c

while if you write it using non-blocking

a <= 1;
b <= a;
c <= b;

this is Nonblocking assignment that means :
a = 1
b = old value of a
c = old value of b

and the actual circuit will be f/f instead of buffers

1 ---[f/f]--->a---[f/f]--->b---[f/f]--->c
Back to top
yuenkit



Joined: 20 Jan 2005
Posts: 110
Helped: 5


Post10 Mar 2006 9:21   

Re: what is the difference between #1 a<=b and a<=#1 b


transportation delay and inertial delay
Back to top
weng



Joined: 13 Jan 2006
Posts: 32


Post14 Mar 2006 2:41   

Re: what is the difference between #1 a<=b and a<=#1 b


Quote:
Do these blocking and nonblocking assignment reflect the actual circuit?

Can anyone code an example?




I am sorry that I didn't make my question clear.

What I wanted to ask is whether these blocking and nonblocking assignments with delays reflect the actual circuit. How do the delays in both assignments synthesize to circuit?
Back to top
shiv_emf



Joined: 31 Aug 2005
Posts: 641
Helped: 16


Post09 Sep 2006 17:18   

what is the difference between #1 a<=b and a<=#1 b


Vonn has given nice example !! can i use it for designing shift register ?/
Back to top
archillios



Joined: 29 Jun 2005
Posts: 97
Helped: 4


Post12 Sep 2006 15:53   

Re: what is the difference between #1 a<=b and a<=#1 b


AlexWan is right, that is a bad coding style when used in combinational logic modeling. Thanks for Alex!
see the code below:

/*
bad coding style example
*/
module adder_t2 (co, sum, a, b, ci);
output co;
output [3:0] sum;
input [3:0] a, b;
input ci;

reg co;
reg [3:0] sum;

always @(a or b or ci)
#12 {co, sum} <= a + b + ci; // bad non-block assignment delay coding style
endmodule
module tb;
reg [3:0] a, b;
reg ci;
wire [3:0] sum;
wire co;
adder_t2 dut (.co(co),.sum(sum),.a(a),.b(b),.ci(ci));
initial
begin
#0 {a,b,ci} = {4'h1,4'h1,1'h0};
#50;
#11 {a,b,ci} = {4'h2,4'h5,1'h1};
#5 {a,b,ci} = {4'he,4'h0,1'h1};
#9 {a,b,ci} = {4'h5,4'h1,1'h0};
#50;
$display("good night");
$stop;

end
endmodule
/////////////////////////////////////////
unexpected behavior will be seen.

after the a/b/ci is changed, the {co, sum} <= a + b + ci; is scheduled at 12 time unit later, before the time is come, any change of a/b/ci will effect the {co, sum}, so the delay is not #12.
Back to top
foster_cn



Joined: 14 Jan 2003
Posts: 74
Helped: 2


Post14 Sep 2006 6:06   

what is the difference between #1 a<=b and a<=#1 b


does the #1 in a <= #1 b means the flipflop transition time?
Back to top
darylz



Joined: 24 Mar 2005
Posts: 132
Helped: 4


Post14 Sep 2006 6:13   

what is the difference between #1 a<=b and a<=#1 b


the assignment sequence is different!
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> ASIC Design Methodologies & Tools (Digital) -> what is the difference between #1 a<=b and a<=#1 b
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
What is the Difference between a Monitor and TV (9)
what is the difference between c and embedded c? (2)
what is the difference between macro and the inline function (7)
What is the difference between the .four and FFT anlysis (5)
what is the difference between the bipolar and unipolar comm (1)
What is the difference between the signal and the waveform? (2)
What is the difference between the communication and the tel (3)
What is the difference between the Fading and the Attenuatio (2)
What is difference between the FCC and the ITU (3)
What is the difference between STA and CTS? (4)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS