Either a concurrent statement (continuous assignment) or a statement (procedural continuous assignment).
A continuous assignment creates events on one or more nets whenever nets or registers in the expression on the right hand side of the continuous assignment change value.
A procedural continuous assignment, when active, similarly assigns values to one or more registers, and prevents ordinary procedural assignments from affecting the values of the assigned registers.
Syntax ( Key to Notation )
{Continuous assignment:} assign [Strength] [Delay] NetTarget = Expression ; NetTarget = {either} NetName NetName[ConstantExpression] NetName[ConstantExpression:ConstantExpression] {NetTarget,...} (See also Net) {Procedural continuous assignment:} assign RegisterTarget = Expression ; deassign RegisterTarget ; RegisterTarget = {either} RegisterName RegisterName[Expression] RegisterName[ConstantExpression:ConstantExpression] MemoryName[Expression] {RegisterTarget,...}
module-<HERE>-endmodule {Continuous assignment}
See Statement for procedural continuous assignment.
Continuous assignments are not the same as procedural continuous assignments, although they are similar. Make sure that you place an assign statement in the correct place: outside any initial or always statements for continuous assignments, and inside initial or always statements for procedural continuous assignments.
wire cout, cin; wire [31:0] sum, a, b; assign {cout, sum} = a + b + cin; wire enable; wire [7:0] f; reg [7:0] data; assign #3 f = enable ? data : 8'bz; always @(posedge Clock) Count = Count + 1; always @(Reset) if (Reset) assign Count = 0; // Prevents counting, until // Reset goes low else deassign Count;
Net, Expression, Timing Control , Strength, Force
Verilog Quick Reference
Doulos Training
Courses
Back to the Verilog Golden Reference Guide
Copyright 1995-1997 Doulos
This page was last updated 16th July 1996
We welcome your e-mail comments. Please contact us at: webmaster@doulos.co.uk