VHDL Concurrent Conditional Assignment

The Conditional Signal Assignment statement is concurrent because it is assigned in the concurrent section of the architecture. It is possible to implement the same code in a sequential version, as we will see next.

The conditional signal assignment statement is a process that assigns values to a signal.

It is a concurrent statement; this means that you must use it only in concurrent code sections.

The statement that performs the same operation in a sequential environment is the “ if ” statement.

The syntax for a conditional signal assignment statement is:

This is a simple example of a two-way mux as reported here:

Two Way Mux example

The output “ a ” is equal to “ b ” when the selector “ c ” is “1” else is equal to “ d ”

Concurrent Conditional Signal Assignment Example 1

This example extends the previous one. This is a 4-way mux, implemented as concurrent code.

The architecture declarative section is empty. As you can notice, we don’t care about how the mux is implemented.

In this moment we don’t’ talk about logic gate, and or nand ect, we are describing the behavior of circuit using a high level description.

A graphical representation can be this one.

4 way mux representation

It is up to the synthesizer to implement the best architecture on the selected technology in terms of logic gates. In fact if you are using FPGA the synthesizer will use LUT to map the VHDL functions, if you are implementing an ASIC the synthesized logic will depend on differ technology and will be implemented using, for instance, NAND, OR, NOR gate, depending on the technology.

Running the RTL compiler on Altera Quartus II , this is the output of the RTL viewer, if we try to layout this mux4 .

Altera RTL Viewer of 4-way-mux

As clear, the RTL translation is implemented in terms of AND gate and 2-way mux. The output “ e ” is generated by cascading 3 two-way mux.

Altera MAP Viewer of 4-way-mux

This is the output of the Altera MAP viewer selecting Cyclone IV FPGA technology. Our mux4 is implemented using LOGIC_COMB_CELL Look Up Table present in the Cyclone IV FPGA . This example should clarify the meaning of “technology dependent”.

Concurrent Conditional Signal Assignment Example 2

This example is the same 4-way mux as the previous one, in which we used a different syntax to implement the selector. In this case, we have introduced the statement “with select”.

In the architecture declarative section, we declared a signal “ sel ” of type integer used to address the mux. The signal “ sel ” is coded as binary to integer.

The statement “ with select ” allows compacting the syntax of the mux code. Note the introduction of the “ other ” keyword. It is necessary because the mux assignment cover only 3 of the 2^32 possible integer values. If we try to layout the code, it is interesting to see how RTL viewer interprets the VHDL code:

Altera RTL Viewer of 4-way-mux using select clause

This case is different from the previous one. We can notice that the VHDL relative to the signal sel is decoded in order to implement mux selection and that the output mux is implemented as 4-way mux. So the RTL view of the RTL code is totally different from the previous one.

The FPGA used in this example is the same as the previous example, in fact the output of Altera MAP viewer have the same implementation of the previous RTL code as clear if we make a comparison between the two implementations.

Altera MAP Viewer of 4-way-mux using select clause

These two examples should clarify the meaning of behavioral. We have seen two different implementations of a simple mux mapped on the same hardware :

implementation of different RTL code can generate the same hardware logic.

Of course, gaining the sensibility to write good VHDL/RTL code is only a matter of time and experience . If you will follow the course, you will find good advices in order to gain all the shortcuts useful reduce this amount of time.

  Previous  – Next

VHDLwhiz

How to create a concurrent statement in VHDL

A concurrent statement in VHDL is a signal assignment within the architecture, but outside of a normal process construct. The concurrent statement is also referred to as a concurrent assignment or concurrent process.

When you create a concurrent statement, you are actually creating a process with certain, clearly defined characteristics. Concurrent statements are always equivalent to a process using a sensitivity list, where all the signals to the right of the signal assignment operator are on the sensitivity list.

These shorthand notation processes are useful when you want to create simple logic which results in the assignment of a single signal. Instead of typing out a full process construct with sensitivity lists and all of that, you can simply assign to the target signal directly in the architecture.

This blog post is part of the Basic VHDL Tutorials series.

When used correctly, the intention of the code will still be pretty clear. No need to create a process for every single bit you want to flip.

In this video, we learn how to create a concurrent statement:

The final code we created in this tutorial:

The waveform window in ModelSim after we pressed run, and zoomed in on the timeline:

bit_shift_multiplication

Let me send you a Zip with everything you need to get started in 30 seconds

Unsubscribe at any time

We can see from the waveform that Mul1 , Mul2 , and Mul3 behave exactly the same. This is because the concurrent statement and the two processes we created are equivalent.

A concurrent statement works just like a process. All signals to the right of the <= are automatically added to the sensitivity list. This means that the signal to the left of the <= will be updated whenever one of the signals that are evaluated change.

There are many ways to multiply numbers in VHDL. In this exercise we multiplied the Uns signal by 4, using bit shifting. All our signals are of unsigned type, meaning that they are interpreted by numbers. Appending a 0 to the right of a binary number is the same as multiplying it by 2.

Get exclusive access to exercises and answers!

  • A concurrent statement is a signal assignment directly in the architecture region
  • Concurrent statements are equivalent to a process with all evaluated signals on the sensitivity list

Go to the next tutorial »

' src=

I’m from Norway, but I live in Bangkok, Thailand. Before I started VHDLwhiz, I worked as an FPGA engineer in the defense industry. I earned my master’s degree in informatics at the University of Oslo.

Similar Posts

Basic VHDL Quiz – part 4

Basic VHDL Quiz – part 4

Test your progress with this VHDL quiz after completing part 4 of the Basic VHDL Tutorial series! [wpViralQuiz id=15773]

How to create a breathing LED effect using a sine wave stored in block RAM

How to create a breathing LED effect using a sine wave stored in block RAM

I’ve noticed that many of the gadgets that I’ve bought the last couple of years have shifted away from LED blinking to led breathing. Most electronic gizmos contain a status LED whose behavior gives away indications of what’s going on inside of the device. My electric toothbrush flashes an LED when it’s time to recharge…

How to use conditional statements in VHDL: If-Then-Elsif-Else

How to use conditional statements in VHDL: If-Then-Elsif-Else

In the previous tutorial we used a conditional expression with the Wait Until statement. The expression ensured that the process was only triggered when the two counter signals where equal. But what if we wanted the program in a process to take different actions based on different inputs? The If-Then-Elsif-Else statements can be used to…

How to create your first VHDL program: Hello World!

How to create your first VHDL program: Hello World!

When learning a new programming language, I always like to start by learning how to print. When you master outputting “Hello World!”, you know that you’ve got the environment working. It also shows you the basic skeleton of the language, the bare minimum code required to produce any output. You might be thinking: but VHDL…

How to check if a vector is all zeros or ones

How to check if a vector is all zeros or ones

I know that I have googled this at least a hundred times throughout my career as an FPGA engineer; how to check if all bits in a std_logic_vector signal are ‘0’ or ‘1’. Of course, you know a few ways to do it already, but you want to find the most elegant code that will…

How to create a PWM controller in VHDL

How to create a PWM controller in VHDL

Pulse-width modulation (PWM) is an efficient way to control analog electronics from purely digital FPGA pins. Instead of attempting to regulate the analog voltage, PWM rapidly switches on and off the supply current at full power to the analog device. This method gives us precise control over the moving average of energy provided to the…

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Notify me of replies to my comment via email

Dot Matrix VHDL and FPGA Course

This is the most extensive course VHDLwhiz has ever made.

vhdl_reference_93:concurrent_signal_assignment

Concurrent signal assignment ,... <= ..."

Concurrent_signal_assignment_statement.

  • architecture_statement_part
  • block_statement_part

Further definitions

Conditional_signal_assignment.

target <= options conditional_waveforms ;

selected_signal_assignment

with expression select target <= options selected_waveforms ;

Additional information

With a conditional signal assignment there is always an equivalent process statement; in general, this is valid for all concurrent assignments.

The equivalent process statement of a concurrent signal assignment statement including the keyword POSTPONED is a postponed process.

If the conditional signal assignment has the form

the signal assignment in the corresponding process statement has the form

If the (conditional) waveform is a simple waveform the signal assignment in the corresponding process statement has the form

The process statement of the wave_transform of a waveform of the form

has the form

null is here a null statement, not a null transaction!

The waveforms` characteristics and the conditions contained in the signal assignment have to be formulated appropriately so that the IF-statement in the corresponding process statement is a permitted statement.

With a selecting signal assignment there is always an equivalent process statement. If the selecting signal assignment has the form

For wave_transform look at the previous topic on conditional signal assignment.

The characteristics of the selected expression, of the waveforms and the criteria of selection contained in the signal assignment have to be formulated appropriately so that the CASE statement in the corresponding process statement is a permitted statement.

If the option GUARDED is contained in the signal assignment it is a so-called controlled assignment. If the target is also controlled the statement part of the corresponding process statement looks as follows:

If the target is not controlled the statement part of the corresponding process statement looks as follows:

It is also possible that neither signal assignment nor target is controlled. If this is the case the statement part of the corresponding process statement looks as follows:

It is not permitted to handle a signal assignment as being not controlled while handling the corresponding target as being controlled!

The value of b is assigned to the signal a after 5ns. In the first case the inertial delay model and in the second case the transport delay model is used.

The controlled signal assignment is only carried out if the corresponding condition in the block declaration is fulfilled.

If sel=0 then a is assigned the value 1 after 5ns; if sel=1 then a is assigned the value 0 after 3ns and the value 1 after 5ns; otherwise a is given the value X after 2 ns.

In this value assignment to the signal sig the value of of muxval is taken into consideration.

If muxval=0 then sig is assigned the value 001 etc. For this assignment the delay model TRANSPORT is used irrespective of the value of muxval .

S is only driven if the driver value is different the current value of S ; otherwise nothing happens.

concurrent signal assignment statement in vhdl

Concurrent Signal Assignments :

Useful resources.

  • Mini Projects
  • MATLAB Projectss
  • VLSI Projects
  • Arduino Projects

Concurrent Signal Assignment Statements of VHDL

Ieee account.

  • Change Username/Password
  • Update Address

Purchase Details

  • Payment Options
  • Order History
  • View Purchased Documents

Profile Information

  • Communications Preferences
  • Profession and Education
  • Technical Interests
  • US & Canada: +1 800 678 4333
  • Worldwide: +1 732 981 0060
  • Contact & Support
  • About IEEE Xplore
  • Accessibility
  • Terms of Use
  • Nondiscrimination Policy
  • Privacy & Opting Out of Cookies

A not-for-profit organization, IEEE is the world's largest technical professional organization dedicated to advancing technology for the benefit of humanity. © Copyright 2024 IEEE - All rights reserved. Use of this web site signifies your agreement to the terms and conditions.

COMMENTS

  1. Concurrent Conditional and Selected Signal Assignment in VHDL

    Conditional Signal Assignment or the "When/Else" Statement. The "when/else" statement is another way to describe the concurrent signal assignments similar to those in Examples 1 and 2. Since the syntax of this type of signal assignment is quite descriptive, let's first see the VHDL code of a one-bit 4-to-1 multiplexer using the ...

  2. PDF Concurrent Statements

    A bus is a collection of wires related in some way by function or clock domain. Examples would be an address bus or data bus. In VHDL we refer to busses as a vector. For example: --8-bit bus consisting of 8 wires carrying signals of -- type std_logic --all these wires may be referred to by the name big_bus. SIGNAL big_bus : STD_LOGIC_VECTOR(7 ...

  3. concurrent and conditional signal assignment (VHDL)

    Concurrent vs Sequential is about independence of execution. A concurrent statement is simply a statement that is evaluated and/or executed independently of the code that surrounds it. Processes are concurrent. Component/Entity Instances are concurrent. Signal assignments and procedure calls that are done in the architecture are concurrent.

  4. VHDL Concurrent Conditional Assignment

    VHDL Concurrent Conditional Assignment. The Conditional Signal Assignment statement is concurrent because it is assigned in the concurrent section of the architecture. It is possible to implement the same code in a sequential version, as we will see next. The conditional signal assignment statement is a process that assigns values to a signal.

  5. PDF 6. Sequential and Concurrent Statements in The Vhdl Language

    This statement is the concurrent version of the sequential signal assignment statement and has the same form with this. As the sequential version, the concurrent assignment defines a new driver for the assigned signal. A concurrent assignment statement appears outside a process, within an architecture.

  6. PDF Conditional Concurrent Signal Assignment

    The conditional concurrent signal assignment statement is modeled after the "if statement" in software programming languages. ... Essential VHDL for ASICs 8 Concurrent Statements - Component Instantiation Another concurrent statement is known as component instantiation. Component instantiation can be used to connect

  7. PDF Concurrent Signal Assignment Statements concurrent signal assignment

    Hardware Design with VHDL Concurrent Stmts ECE 443 ECE UNM 3 (9/6/12) Simple Signal Assignment Statements For example: q <= ((not q) and (not en)) or (d and en);Here, the q signal takes the value of d when en is '1', otherwise it takes the inverse of itself Although this is syntactically correct, the statement forms a closed feedback loop and should be avoided It may synthesize to an ...

  8. How to create a concurrent statement in VHDL

    A concurrent statement in VHDL is a signal assignment within the architecture, but outside of a normal process construct. The concurrent statement is also referred to as a concurrent assignment or concurrent process. When you create a concurrent statement, you are actually creating a process with certain, clearly defined characteristics.

  9. PDF Concurrent Signal Assignment Statements From VHDL Essentials I, we

    The outputs include a 2-bit signal (code), which is the binary code of the highest priority request and a 1-bit signal active that indicates if there is an active request. has the highest priority, i.e., when asserted, the other three requests are ignored and the code signal becomes "11". When r(3) is not asserted, the second highest request, r ...

  10. Concurrent Signal Assignment Statements of VHDL

    Simple signal assignment statement. Conditional signal assignment statement. Selected signal assignment statement. Conditional signal assignment statement versus selected signal assignment statement. Synthesis guidelines. Bibliographic notes

  11. vhdl_reference_93:concurrent_signal_assignment [VHDL-Online]

    The controlled signal assignment is only carried out if the corresponding condition in the block declaration is fulfilled. reg_output AFTER 3 ns ; If sel=0 then a is assigned the value 1 after 5ns; if sel=1 then a is assigned the value 0 after 3ns and the value 1 after 5ns; otherwise a is given the value X after 2 ns.

  12. Signal Assignment Statements

    The conditional signal assignment statement is very general in that any readable signals or inputs may be tested to determine the value to be assigned to the target. Note that the simple concurrent signal assignment statement (e.g. A <= B;) is simply the degenerate case of a conditional signal assignment statement. The selected signal ...

  13. Concurrent-Statements

    Concurrent Signal Assignments : Concurrent signal assignment is process for sequential assignment. The concurrent signal assignment statements are to be indicated into architecture. Concurrent signal assignment is independent of statements inside architecture and executed concurrently. For multiple assignments multiple drivers are created.

  14. Concurrent Signal Assignment Statements of VHDL

    Concurrent Signal Assignment Statements of VHDL Abstract: This chapter contains sections titled: Combinational versus sequential circuits. Simple signal assignment statement. Conditional signal assignment statement. ... Concurrent Signal Assignment Statements of VHDL. Publisher: Wiley-IEEE Press.

  15. PDF Concurrent Statements

    Delay Types. VHDL signal assignment statements prescribe an amount of time that must transpire before a signal assumes its new value. This prescribed delay can be in one of three forms: Transport: propagation delay only. Inertial: minimum input pulse width and propagation delay. Delta:

  16. VHDL Concurrent Statements

    A conditional assignment statement is also a concurrent signal assignment statement. target <= waveform when choice; -- choice is a boolean expression target <= waveform when choice else waveform; sig <= a_sig when count>7; sig2 <= not a_sig after 1 ns when ctl='1' else b_sig; "waveform" for this statement seems to include [ delay_mechanism ...

  17. PDF Selected Concurrent Signal Assignment

    Component instantiation can be used to connect circuit elements at a very low level or most frequently at the top level of a design. VHDL written in this form is known as Structural VHDL. The instantiation statement connects a declared component to signals in the architecture.

  18. Concurrent Signal Assignment Statement

    The concurrent signal assignment statements within the block refer to the formal ports of the block and the local objects zero, gated_d0 and gated_d1. The generic map supplies an actual value for width, using the constant sig_width declared in the enclosing architecture body. Similarly, the port map associates the actual signals s1, s2, s3 and ...

  19. vhdl

    Any variable which does not assign its value to a signal, but only to other variables, is a perfectly acceptable "wire". A signal assignment inside a process will disregard other signal assignments made in the same process "instantiation". Also, for the same signal, only the last assignment will be taken into account.

  20. concurrent and sequential statements in VHDL

    It's actually very simple: all statements inside a VHDL process are executed sequentially, in order, from top to bottom, no exceptions.However, the left hand side of a signal assignment operator (<=) does not take its new value until the process (and all other processes) have suspended (either hit the bottom or hit a wait statement) and. if you assign to a signal again (as in your second ...