Continue to Site

Welcome to EDAboard.com

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.

Why latch is created in this circuit

Status
Not open for further replies.

otis

Member level 3
Joined
Sep 21, 2010
Messages
60
Helped
4
Reputation
8
Reaction score
3
Trophy points
1,288
Activity points
1,711
Hi I saw this circuit some where in the internet. It says Latch is created.. But why?

always @(a, b) begin
temp = a – b;
if ((temp < 8’b0) && abs) // latch!
out = -temp;
else out = temp;
end

Thanks!
 

Hi I saw this circuit some where in the internet. It says Latch is created.. But why?

always @(a, b) begin
temp = a – b;
if ((temp < 8’b0) && abs) // latch!
out = -temp;
else out = temp;
end

Thanks!

Hi, You'd better synthesis this small circuit by any synthesis tool, such as DC, XST or synplify. Then you will get the answer.
Just try it.
 
  • Like
Reactions: otis

    otis

    Points: 2
    Helpful Answer Positive Rating
Hi Ortis,

"always" is a construct in verilog which translates to either a latch or flop based on the sensitivity list...so if you use keyword such as pos/negedge instead if signals in the sensitivity list it will be translated to flop or else a latch...and as yang suggested please synthesize the code in a tool for better understanding

useful???
 
  • Like
Reactions: otis

    otis

    Points: 2
    Helpful Answer Positive Rating
@phoenixpavan
Thanks for the explanation. If I have access the synthesis tool I would not ask here :)
Most people recommend to synthesis but is bit complicated to get access to synthesis tool they ask here.

Thanks for your time !
 

@phoenixpavan
Thanks for the explanation. If I have access the synthesis tool I would not ask here :)
Most people recommend to synthesis but is bit complicated to get access to synthesis tool they ask here.

Thanks for your time !

Hi, otis:
"always" statement will synthesis to combination logic, Latch(with combination logic) or DFF (with combination logic).
You must know how to synthesis to purely combination logic and DFF(with combination logic).
How it will synthesis to Latch(with combination logic)?? Do you get the idea. You can search this in the google for detail.

For the circuit you print out, I don't think it will be synthesised to a Latch(with combination logic) but it just has another problem:
The sensitive list incomplete problem (signal abs doesn't include in the sensitive list). Then you must wonder will this causing problem?? You'd better also search on google.

For enginerring, try it is a good way, I think,

Thanks,
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top