[SOLVED] The difference between "initial" and "always"

Status
Not open for further replies.

u24c02

Advanced Member level 1
Joined
May 8, 2012
Messages
404
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
4,101
Hi i want to know following verilog that

1. The difference between initial and always.
2. The difference between blocking assinment and nonblocking assignment.
3. The difference between ifdef and generate.
4. The difference between forever, repeat, while, for, do-while.
5. The difference between flip-flop and latch.
 

 

Better to go through any Verilog HDL book like sameer palnitkar.
 

Initial Block will get executed only once start of the simulation.
Always Block will get executed when ever it meets the condition to enter always block.
 

Both latches and flip-flops are circuit elements whose output depends not only on the current inputs, but also on previous inputs and outputs.

The difference between a latch and a flip-flop is that a latch does not have a clock signal, whereas a flip-flop always does.Latches are asynchronous, which means that the output changes very soon after the input changes.A flip-flop is a synchronous version of the latch.
Latch is a level sensitive device and flip-flop is edge sensitive device. Latch is sensitive to glitches on enable pin, where as flip-flop is immune to gltiches.
Latches take less gates (also less power) to implement then flip-flops.
Latches are faster then flip-flops.

this is how the output of the two will differ:

the output of the latch will be the same as the data input as it does not have a clock signal whereas in a flipflop there would be a delay of one clock cycle to see the output.
pooja

Read more: Difference between flip-flops & latches | Answerbag https://www.answerbag.com/q_view/436819#ixzz26nVlLYyn
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…