reading a bookConditional Assignment


A concurrent statement which assigns one of several expressions to a signal, depending on the values of boolean conditions which are tested in sequence. Equivalent to a process containing an if statement.

Syntax ( Key to Notation )

[Label:] Target <= [Options]
Expression [after TimeExpression] when Condition else
Expression [after TimeExpression] when Condition else
...
Expression [after TimeExpression] [when Condition];

Target = {either} SignalName Aggregate

Options = {either}
guarded
transport
reject TimeExpression inertial

Where

architecture-begin-<HERE>-end
block-begin-<HERE>-end
generate-begin-<HERE>-end

Rules

Synthesis

Conditional signal assignments are synthesized to combinational logic. The Expressions on the right hand side are multiplexed onto the Target signal. The resulting logic will be priority encoded, because the Conditions are tested in sequence.

Tips

Example

L: Equal <= '1' when A = B else '0';

NextState <= Idle  when State = Clear else
             Start when State = Idle  else
             Stop  when State = Start else
             Clear;

Flipflop: Q <= D when Rising_edge(Clock);

Latch: Q <= D when Enable = '1' else unaffected;

See Also

Signal Assignment, Select, If, Block


reference cardVHDL Quick Reference
teaching pointerDoulos Training Courses
reading a bookBack to the VHDL Golden Reference Guide


riverDoulos Home Page

Copyright 1995-1997 Doulos
This page was last updated 25th June 1996

mail iconWe welcome your e-mail comments. Please contact us at: webmaster@doulos.co.uk