Sir can I ask a doubt .........a case where I need to update my array. I use always@(posedge) block to update my array. At that time I need to get my old mapping in that array , so that I use an always@(*) block to get the old value using a combinational logic. I am getting output with my old value whenever the input given, but problem is whenever the new write happens in my array at rising edge clock the same new value is also coming as out since I need only old value , means my old value is overwritten so how can I block always@(*) block in preventing updating by the new value
@vaibhavgarg29343 жыл бұрын
Procedural Statement would still execute in sequential manner even if we use non blocking assignments?
@ComponentByte3 жыл бұрын
Procedural statements are executed sequentially. You are correct. Non blocking assignment may get executed sequentially or parallely.its also true but It's execution depends on data dependency. In real hardware everything is executed parallely as all hardware are run independently. Non blocking assignments are used to model sequential logic and sequential logic stores previous data.This statement is enough to understand what is the purpose of using non blocking assignment. If you understand the real hardware execution and not just the code execution theory then you will understand what is the use of non blocking assignment or its purpose and how it is executed not by simulator but by underlying hardware I always try to explain verilog code interms of hardware as verilog is a HDL. Thank you for your query as it will help other to understand in better way. Thank you.
@vaibhavgarg29343 жыл бұрын
@@ComponentByte it was a doubt about the code itself as a coder's logic I wanted to know in virtual environment where synthesis does not matter, where only behavioural modeling is understood irrespective of practicality, in that environment if I try to write a swap code would it work or not.
@vaibhavgarg29343 жыл бұрын
@@ComponentByteyour stuff is actually very gripping, thank you for your service.
@ComponentByte3 жыл бұрын
It will definitely work if RTL coding guidelines are followed. Most of the time we write a software code than a hardware code and fully dependent on software tools to catch the error. I believe you are smart enough to understand what you are coding for. Thanks.
@abhilash43842 жыл бұрын
Nice videos thanks sir
@unknowneditz48642 жыл бұрын
Sir your said statements inside always block are executed one by one that is sequentially but those should be non-blocking statements right as discussed earlier so they will get executed simultaneously ?? Can you clear this please
@ComponentByte2 жыл бұрын
Blocking means evaluate and assign immediately.(hence suitable for combinational logic) Non blocking means evaluate immediately and assign once all the evaluation are done in one time step.(sequential logic) This is what you have to remember for blocking and non blocking . If go deep then At stimulation level(all software code run this way) everything runs sequentially(both blocking and non blocking) if no data dependency and at hardware level it runs parallelly.
@akhilnair91652 жыл бұрын
Procedural statements inside always block should always be non blocking?
@ComponentByte2 жыл бұрын
Not always. It depends on the type of logic we design. So before writing any code , first logic ckt is designed and then decided how to write code for it following proper RTL guidelines. If it's combinational logic then usually we use blocking and for sequential it's non blocking.