Docsity

Assignments and Delays in Verilog: A Comprehensive Guide, Schemes and Mind Maps of Electric Machines

Toggle sidebar
bg1
Supplemental (補充教材)
•Assignment types:
•Continuous assignment
•Blocking assignment
•Non-Blocking assignment
•Delay types
•Inertial Delay
•Transport Delay So there are 6 different combinations
for using assignments and delays in
Verilog…
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Assignments and Delays in Verilog: A Comprehensive Guide and more Schemes and Mind Maps Electric Machines in PDF only on Docsity!

Supplemental (補充教材)

• Assignment types:

  • Continuous assignment
  • Blocking assignment
  • Non-Blocking assignment

• Delay types

  • Inertial Delay
  • Transport Delay So there are 6 different combinations for using assignments and delays in Verilog…
  • Continuous assignment and inertial delay , e.g.,

assign #5 C1 = A +B ;

✓ When the statement is executed at time T, wait for 5ns, and then calculate the value of the right of the equal sign to assign to A. The values of A and B used are the values of the T+5ns moment. ✓ If the value of A or B changes during the wait process and triggers the assign block again, according to the gate timing model characteristics of the assign block, the simulator will undo the previous wait event and then re-execute the statement. ✓ When the change pulse is less than 5ns, The wait event is revoked and the pulse becomes ineffective. At 6ns, 8ns, 9ns, and 10ns, A has changed, but because the duration is less than 5ns, it has no effect on C1 , and only the change duration Source: https://www.cnblogs.com/Alfred-HOO/articles/16581599.html^ of 12ns and 18ns exceeds 5ns, acting on^ C

  • Blocking assignment and inertial delay , e.g.,

always @(*)

begin

#5 C3 = A +B;

end

✓When the statement is executed at time T, wait for 5ns, and then calculate the

value to the right of the equal sign to assign blocking to A. The values of A and B

used are the values of the T+5ns moment.

✓If the value of A or B changes during the waiting process, the always block is

triggered again, according to the characteristics of the process timing model of

always block, the process is still waiting at this time, the always statement has

not been executed, a new round of events will not start, and the simulator will

not react to the sensitive list.

At 6ns the value of A changes, the always block starts execution, and after 5ns, the values of A and B at 11ns are used to calculate the result to C3, ignoring the change at 8ns, 9ns and 10ns.

At 6ns the value of A changes, the always block starts execution, and after 5ns, the result is assigned to C4 by calculating the changed values of A and B at 6ns, ignoring the changes at 8ns, 9ns and 10ns

  • Non-Blocking assignment and Inertial delay , e.g.,

always @(*)

begin

#5 C5 <= A +B;

end

✓When the statement is executed at time T, wait for 5ns, and then calculate the

value to the right of the equal sign to assign blocking to A. The values of A and B

used are the value of the T+5ns moment.

✓If the value of A or B changes during the waiting process, the always block is

triggered again, according to the characteristics of the process timing model of

always block, the process is still waiting at this time, the always statement has

not been executed, a new round of events will not start, and the simulator will

not react to the sensitive list.

  • Non-Blocking assignment and Transport delay , e.g.,

always @(*)

begin

C6 <= #5 A +B;

end

✓ When the statement is executed at time T, the value to the right of the equal sign is calculated, waiting for 5ns and assigning it to A. The values of A and B used are the value of time T. ✓ If the value of A or B changes during the waiting process and triggers the always block again, according to the characteristics of the process timing model of always block, because the assignment method is non-blocking assignment, after the assignment event is put into the event queue, the execution of the always statement ends, waiting for the next trigger, and starting a new round of events when the trigger comes. ✓ The emulator accepts data changes in the delay period, and the delay of the input change is all reflected on the output.

Each change of A and B triggers the execution of the always block, and each change is delayed by 5ns and then reacts on C