GitHub

Generate Statement – VHDL Example

Generate statements are used to accomplish one of two goals:

  • Replicating Logic in VHDL
  • Turning on/off blocks of logic in VHDL

The generate keyword is always used in a combinational process or logic block. It should not be driven with a clock. If the digital designer wants to create replicated or expanded logic in VHDL, the generate statement with a for loop is the way to accomplish this task. Note that a for loop only serves to expand the logic. For a thorough understanding of how for loops work in VHDL read about for loops in digital design .

The second use case is very handy for debugging purposes, or for switching out different components without having to edit lots of code. The example below turns on an entire process just by switching g_DEBUG to 1. One interesting thing about generate statements used this way is that the same signal can be driven by multiple generate statements. The designer needs to ensure that these generate blocks are mutually exclusive, such that no two can be active at the same time. Otherwise there will be a problem with the same signal being driven by two sources.

Note that the example below uses a VHDL Generic

Learn Verilog

One Comment

' src=

Hello! This is my first visit to your blog! We are a collection of volunteers and starting a new project in a community in the same niche. Your blog provided us valuable information to work on. You have done a extraordinary job!

Leave A Comment Cancel reply

Save my name, email, and website in this browser for the next time I comment.

Introduction to Digital Systems: Modeling, Synthesis, and Simulation Using VHDL by

Get full access to Introduction to Digital Systems: Modeling, Synthesis, and Simulation Using VHDL and 60K+ other titles, with a free 10-day trial of O'Reilly.

There are also live events, courses curated by job role, and more.

4.9 VHDL SIGNAL AND GENERATE STATEMENTS

4.9.1 signal statement.

Signal is a VHDL keyword. It declares a signal of specified data type. A signal declaration is used to represent internal signals within an architecture declaration.

images

Figure 4.20 Logic Circuit with Internal Signals

Unlike entity ports, internal signals do not have a direction. Signal assignment statements execute only when the associated signals (appearing on the right-hand side of the assignment statement) change values. In VHDL, the order of concurrent statements in VHDL code does not affect the order in which the statements are executed. Signal assignments are concurrent and could execute in parallel fashion. Consider the logic circuit in Figure 4.20 where the internal signals are identified. Notice, that from the point of view of an entity declaration, the signals Sig 1 , Sig 2 , and Sig 3 are internal signals. They are neither input ports nor output ports, and therefore do not have a direction.

The VHDL program in Figure 4.21 implements the logic circuit in Figure 4.20 . The entity declaration is similar to that in the VHDL program of Figure 4.6 . The architecture declaration has been modified to include the internal signals. The logic function of the circuit is described in an indirect way using the internal signals. Both VHDL implementations ( Figures 4.6 and 4.21 ) have the same logic function and should yield the same ...

Get Introduction to Digital Systems: Modeling, Synthesis, and Simulation Using VHDL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.

Don’t leave empty-handed

Get Mark Richards’s Software Architecture Patterns ebook to better understand how to design components—and how they should interact.

It’s yours, free.

Cover of Software Architecture Patterns

Check it out now on O’Reilly

Dive in for free with a 10-day trial of the O’Reilly learning platform—then explore all the other resources our members count on to build skills and solve problems every day.

vhdl generate signal assignment

Designing Circuits with VHDL

1. introduction, 2. combinational circuits, signal assignments in vhdl.

library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity fullAdder is     port(  A,B: in  std_logic;  -- input bits for this stage            Ci:   in  std_logic; -- carry into this stage            S:    out std_logic; -- sum bit            Co:   out std_logic  -- carry out of this stage     ); end fullAdder; architecture a1 of fullAdder is begin     S <= A xor B xor Ci;     Co <= (A and B) or ((A xor B) and Ci); end a1;

Processes and Conditional Statements

if a = '0' then     x <= a;     y <= b; elsif a = b then     x <= '0';   y <= '1'; else     x <= not b; y <= not b; end if;
Every signal that is assigned a value inside a process must be defined for all possible conditions.

Case Statements

Structural vhdl, 3. sequential circuits.

vhdl generate signal assignment

busy   is high when the circuit is in the middle of performing an operation;             while busy is high, the insert and delete inputs are ignored; the             outputs are not required to have the correct values when busy is high empty     is high when there are no pairs stored in the priority queue; delete             operations are ignored in this case full      is high when there is no room for any additional pairs to be stored;             insert operations are ignored in this case
  • For adjacent pairs in the bottom row, the pair to the left has a key that is less than or equal to that of the pair on the right.
  • For pairs that are in the same column, the key of the pair in the bottom row is less than or equal to that of the pair in the top row.
  • In both rows, the empty blocks (those with dp =0) are to the right and either both rows have the same number of empty blocks or the top row has one more than the bottom row.
entity priQueue is     Port (clk, reset : in std_logic;           insert, delete : in std_logic;           key, value : in std_logic_vector(wordSize-1 downto 0);           smallValue : out std_logic_vector(wordSize-1 downto 0);           busy, empty, full : out std_logic     );    end priQueue; architecture a1 of priQueue is constant rowSize: integer := 4; -- local constant declaration type pqElement is record     dp: std_logic;     key: std_logic_vector(wordSize-1 downto 0);     value: std_logic_vector(wordSize-1 downto 0); end record pqElement; type rowTyp is array(0 to rowSize-1) of pqElement; signal top, bot: rowTyp; type state_type is (ready, inserting, deleting); signal state: state_type; begin     process(clk) begin         if rising_edge(clk) then             if reset = '1' then                 for i in 0 to rowSize-1 loop                     top(i).dp <= '0'; bot(i).dp <= '0';                 end loop;                 state <= ready;             elsif state = ready and insert = '1' then                 if top(rowSize-1).dp /= '1' then                     for i in 1 to rowSize-1 loop                         top(i) <= top(i-1);                     end loop;                     top(0) <= ('1',key,value);                     state <= inserting;                 end if;             elsif state = ready and delete = '1' then                 if bot(0).dp /= '0' then                     for i in 0 to rowSize-2 loop                         bot(i) <= bot(i+1);                     end loop;                     bot(rowSize-1).dp <= '0';                     state <= deleting;                 end if;             elsif state = inserting or state = deleting then                 for i in 0 to rowSize-1 loop                     if top(i).dp = '1' and                         (top(i).key < bot(i).key                          or bot(i).dp = '0') then                         bot(i) <= top(i); top(i) <= bot(i);                     end if;                end loop;                 state <= ready;             end if;         end if;     end process;     smallValue <= bot(0).value when bot(0).dp = '1' else                   (others => '0');     empty <= not bot(0).dp;     full <= top(rowSize-1).dp;     busy <= '1' when state /= ready else '0'; end a1;

4. Functions and Procedures

package commonConstants is     constant lgWordSize: integer := 4;        constant wordSize: integer := 2**lgWordSize; end package commonConstants; library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; use work.commonConstants.all; entity firstOne is     Port (a: in std_logic_vector(0 to wordSize-1);           x: out std_logic_vector (lgWordSize downto 0)      ); end firstOne; architecture a1 of firstOne is procedure encode(x: in std_logic_vector(0 to wordSize-1);                 indx: out std_logic_vector(lgWordSize-1 downto 0);                 errFlag: out std_logic) is -- Unary to binary encoder. -- Input x is assumed to have at most a single 1 bit. -- Indx is equal to the index of the bit that is set. -- If no bits are set, errFlag bit is made high. -- This is conceptually simple. -- --        indx(0) is OR of x(1),x(3),x(5), ... --        indx(1) is OR of x(2),x(3), x(6),x(7), x(10),x(11), ... --        indx(2) is OR of x(4),x(5),x(6),x(7), x(12),x(13),x(14(,x(15),... -- -- but it's tricky to code so it works for different word sizes. type vec is array(0 to lgWordSize-1) of std_logic_vector(0 to (wordSize/2)-1); variable fOne: vec; variable anyOne: std_logic_vector(0 to wordSize-1); begin     -- fOne(0)(j) is OR of first j bits in x1,x3,x5,...     -- fOne(1)(j) is OR of first j bits in x2,x3, x6,x7, x10,x11,...     -- fOne(2)(j) is OR of first j bits in x4,x5,x6,x7, x12,x13,x14,x15,...     for i in 0 to lgWordSize-1 loop         for j in 0 to (wordSize/(2**(i+1)))-1 loop                        for h in 0 to (2**i)-1 loop                 if j = 0 and h = 0 then                     fOne(i)(0) := x(2**i);                 else                     fOne(i)((2**i)*j+h) := fOne(i)((2**i)*j+h-1) or                                            x(((2**i)*(2*j+1))+h);                 end if;             end loop;         end loop;         indx(i) := fOne(i)((wordSize/2)-1);     end loop;     anyOne(0) := x(0);     for i in 1 to wordSize-1 loop         anyOne(i) := anyOne(i-1) or x(i);     end loop;     errFlag := not anyOne(wordSize-1); end procedure encode; function firstOne(x: std_logic_vector(0 to wordSize-1))                         return std_logic_vector is -- Returns the index of the first 1 in bit string x. -- If there are no 1's in x, the value returned has a -- 1 in the high order bit. variable allZero: std_logic_vector(0 to wordSize-1); variable fOne: std_logic_vector(0 to wordSize-1); variable rslt: std_logic_vector(lgWordSize downto 0); begin     allZero(0) := not x(0);     fOne(0) := x(0);     for i in 1 to wordSize-1 loop         allZero(i) := (not x(i)) and allZero(i-1);         fOne(i) := x(i) and allZero(i-1);     end loop;     encode(fOne,rslt(lgWordSize-1 downto 0),rslt(lgWordSize));     return rslt; end function firstOne; begin     x <= firstOne(a); end a1;

5. Closing Remarks

Generate Statement

  • Architecture

Reference Manual

  • Section 9.7

Rules and Examples

The for generate statement is usually used to instantiate “arrays” of components. The generate parameter may be used to index array-type signals associated with component ports:

A label is compulsory with a generate statement.

The for generate statement is particularly powerful when used with integer generics .

Instance labels inside a generate statement do not need to have an index:

For generate statements may be nested to create two-dimensional instance “arrays”.

Another form of generate is the if generate statement. This is usually used within a for generate statement, to account for irregularity. For instance, a ripple-carry adder with no carry-in:

A generate statement may contain local declarations, followed by the keyword begin.

Synthesis Issues

Generate statements are usually supported for synthesis.

VHDL Logical Operators and Signal Assignments for Combinational Logic

In this post, we discuss the VHDL logical operators, when-else statements , with-select statements and instantiation . These basic techniques allow us to model simple digital circuits.

In a previous post in this series, we looked at the way we use the VHDL entity, architecture and library keywords. These are important concepts which provide structure to our code and allow us to define the inputs and outputs of a component.

However, we can't do anything more than define inputs and outputs using this technique. In order to model digital circuits in VHDL, we need to take a closer look at the syntax of the language.

There are two main classes of digital circuit we can model in VHDL – combinational and sequential .

Combinational logic is the simplest of the two, consisting primarily of basic logic gates , such as ANDs, ORs and NOTs. When the circuit input changes, the output changes almost immediately (there is a small delay as signals propagate through the circuit).

Sequential circuits use a clock and require storage elements such as flip flops . As a result, changes in the output are synchronised to the circuit clock and are not immediate. We talk more specifically about modelling combinational logic in this post, whilst sequential logic is discussed in the next post.

Combinational Logic

The simplest elements to model in VHDL are the basic logic gates – AND, OR, NOR, NAND, NOT and XOR.

Each of these type of gates has a corresponding operator which implements their functionality. Collectively, these are known as logical operators in VHDL.

To demonstrate this concept, let us consider a simple two input AND gate such as that shown below.

The VHDL code shown below uses one of the logical operators to implement this basic circuit.

Although this code is simple, there are a couple of important concepts to consider. The first of these is the VHDL assignment operator (<=) which must be used for all signals. This is roughly equivalent to the = operator in most other programming languages.

In addition to signals, we can also define variables which we use inside of processes. In this case, we would have to use a different assignment operator (:=).

It is not important to understand variables in any detail to model combinational logic but we talk about them in the post on the VHDL process block .

The type of signal used is another important consideration. We talked about the most basic and common VHDL data types in a previous post.

As they represent some quantity or number, types such as real, time or integer are known as scalar types. We can't use the VHDL logical operators with these types and we most commonly use them with std_logic or std_logic_vectors.

Despite these considerations, this code example demonstrates how simple it is to model basic logic gates.

We can change the functionality of this circuit by replacing the AND operator with one of the other VHDL logical operators.

As an example, the VHDL code below models a three input XOR gate.

The NOT operator is slightly different to the other VHDL logical operators as it only has one input. The code snippet below shows the basic syntax for a NOT gate.

  • Mixing VHDL Logical Operators

Combinational logic circuits almost always feature more than one type of gate. As a result of this, VHDL allows us to mix logical operators in order to create models of more complex circuits.

To demonstrate this concept, let’s consider a circuit featuring an AND gate and an OR gate. The circuit diagram below shows this circuit.

The code below shows the implementation of this circuit using VHDL.

This code should be easy to understand as it makes use of the logical operators we have already talked about. However, it is important to use brackets when modelling circuits with multiple logic gates, as shown in the above example. Not only does this ensure that the design works as intended, it also makes the intention of the code easier to understand.

  • Reduction Functions

We can also use the logical operators on vector types in order to reduce them to a single bit. This is a useful feature as we can determine when all the bits in a vector are either 1 or 0.

We commonly do this for counters where we may want to know when the count reaches its maximum or minimum value.

The logical reduction functions were only introduced in VHDL-2008. Therefore, we can not use the logical operators to reduce vector types to a single bit when working with earlier standards.

The code snippet below shows the most common use cases for the VHDL reduction functions.

Mulitplexors in VHDL

In addition to logic gates, we often use multiplexors (mux for short) in combinational digital circuits. In VHDL, there are two different concurrent statements which we can use to model a mux.

The VHDL with select statement, also commonly referred to as selected signal assignment, is one of these constructs.

The other method we can use to concurrently model a mux is the VHDL when else statement.

In addition to this, we can also use a case statement to model a mux in VHDL . However, we talk about this in more detail in a later post as this method also requires us to have an understanding of the VHDL process block .

Let's look at the VHDL concurrent statements we can use to model a mux in more detail.

VHDL With Select Statement

When we use the with select statement in a VHDL design, we can assign different values to a signal based on the value of some other signal in our design.

The with select statement is probably the most intuitive way of modelling a mux in VHDL.

The code snippet below shows the basic syntax for the with select statement in VHDL.

When we use the VHDL with select statement, the <mux_out> field is assigned data based on the value of the <address> field.

When the <address> field is equal to <address1> then the <mux_out> signal is assigned to <a>, for example.

We use the the others clause at the end of the statement to capture instance when the address is a value other than those explicitly listed.

We can exclude the others clause if we explicitly list all of the possible input combinations.

  • With Select Mux Example

Let’s consider a simple four to one multiplexer to give a practical example of the with select statement. The output Q is set to one of the four inputs (A,B, C or D) depending on the value of the addr input signal.

The circuit diagram below shows this circuit.

This circuit is simple to implement using the VHDL with select statement, as shown in the code snippet below.

VHDL When Else Statements

We use the when statement in VHDL to assign different values to a signal based on boolean expressions .

In this case, we actually write a different expression for each of the values which could be assigned to a signal. When one of these conditions evaluates as true, the signal is assigned the value associated with this condition.

The code snippet below shows the basic syntax for the VHDL when else statement.

When we use the when else statement in VHDL, the boolean expression is written after the when keyword. If this condition evaluates as true, then the <mux_out> field is assigned to the value stated before the relevant when keyword.

For example, if the <address> field in the above example is equal to <address1> then the value of <a> is assigned to <mux_out>.

When this condition evaluates as false, the next condition in the sequence is evaluated.

We use the else keyword to separate the different conditions and assignments in our code.

The final else statement captures the instances when the address is a value other than those explicitly listed. We only use this if we haven't explicitly listed all possible combinations of the <address> field.

  • When Else Mux Example

Let’s consider the simple four to one multiplexer again in order to give a practical example of the when else statement in VHDL. The output Q is set to one of the four inputs (A,B, C or D) based on the value of the addr signal. This is exactly the same as the previous example we used for the with select statement.

The VHDL code shown below implements this circuit using the when else statement.

  • Comparison of Mux Modelling Techniques in VHDL

When we write VHDL code, the with select and when else statements perform the same function. In addition, we will get the same synthesis results from both statements in almost all cases.

In a purely technical sense, there is no major advantage to using one over the other. The choice of which one to use is often a purely stylistic choice.

When we use the with select statement, we can only use a single signal to determine which data will get assigned.

This is in contrast to the when else statements which can also include logical descriptors.

This means we can often write more succinct VHDL code by using the when else statement. This is especially true when we need to use a logic circuit to drive the address bits.

Let's consider the circuit shown below as an example.

To model this using a using a with select statement in VHDL, we would need to write code which specifically models the AND gate.

We must then include the output of this code in the with select statement which models the multiplexer.

The code snippet below shows this implementation.

Although this code would function as needed, using a when else statement would give us more succinct code. Whilst this will have no impact on the way the device works, it is good practice to write clear code. This help to make the design more maintainable for anyone who has to modify it in the future.

The VHDL code snippet below shows the same circuit implemented with a when else statement.

Instantiating Components in VHDL

Up until this point, we have shown how we can use the VHDL language to describe the behavior of circuits.

However, we can also connect a number of previously defined VHDL entity architecture pairs in order to build a more complex circuit.

This is similar to connecting electronic components in a physical circuit.

There are two methods we can use for this in VHDL – component instantiation and direct entity instantiation .

  • VHDL Component Instantiation

When using component instantiation in VHDL, we must define a component before it is used.

We can either do this before the main code, in the same way we would declare a signal, or in a separate package.

VHDL packages are similar to headers or libraries in other programming languages and we discuss these in a later post.

When writing VHDL, we declare a component using the syntax shown below. The component name and the ports must match the names in the original entity.

After declaring our component, we can instantiate it within an architecture using the syntax shown below. The <instance_name> must be unique for every instantiation within an architecture.

In VHDL, we use a port map to connect the ports of our component to signals in our architecture.

The signals which we use in our VHDL port map, such as <signal_name1> in the example above, must be declared before they can be used.

As VHDL is a strongly typed language, the signals we use in the port map must also match the type of the port they connect to.

When we write VHDL code, we may also wish to leave some ports unconnected.

For example, we may have a component which models the behaviour of a JK flip flop . However, we only need to use the inverted output in our design meaning. Therefore, we do not want to connect the non-inverted output to a signal in our architecture.

We can use the open keyword to indicate that we don't make a connection to one of the ports.

However, we can only use the open VHDL keyword for outputs.

If we attempt to leave inputs to our components open, our VHDL compiler will raise an error.

  • VHDL Direct Entity Instantiation

The second instantiation technique is known as direct entity instantiation.

Using this method we can directly connect the entity in a new design without declaring a component first.

The code snippet below shows how we use direct entity instantiation in VHDL.

As with the component instantiation technique, <instance_name> must be unique for each instantiation in an architecture.

There are two extra requirements for this type of instantiation. We must explicitly state the name of both the library and the architecture which we want to use. This is shown in the example above by the <library_name> and <architecture_name> labels.

Once the component is instantiated within a VHDL architecture, we use a port map to connect signals to the ports. We use the VHDL port map in the same way for both direct entity and component instantiation.

Which types can not be used with the VHDL logical operators?

Scalar types such as integer and real.

Write the code for a 4 input NAND gate

We can use two different types of statement to model multiplexors in VHDL, what are they?

The with select statement and the when else statement

Write the code for an 8 input multiplexor using both types of statement

Write the code to instantiate a two input AND component using both direct entity and component instantiation. Assume that the AND gate is compiled in the work library and the architecture is named rtl.

Leave a Reply Cancel reply

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

Save my name, email, and website in this browser for the next time I comment.

Table of Contents

Sign up free for exclusive content.

Don't Miss Out

We are about to launch exclusive video content. Sign up to hear about it first.

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Signal assignment type

What is the meaning of "combinational assignment" and "registered assignment" to signals? In particular what are the differences between these two types of assignments?

  • state-machines

rrazd's user avatar

2 Answers 2

Essentially, the difference boils down to whether the signal gets assigned on a clock edge or not.

Combinational code, like A <= B + 1 would have A being assigned B+1 "immediately," whereas

would result in A being assigned B+1 only on a rising clock edge. With code like this, other blocks can use the value of A being guaranteed that its value will be stable and unchanging after a clock edge.

Registers, or clock gating in general I suppose, are really what make designs of any complication possible. You create a pipeline of operations by putting a register at the border between operations. For example, the input operands to an ALU must be stable - in a register- so that the ALU can execute properly, and the result of the ALU's execution should be in a register so that whatever block uses it does not 'see' the changing values inside the ALU as the calculations take place, but only the stable last result.

Kevin H's user avatar

  • \$\begingroup\$ Question: Is a transparent latch considered combinatorial or registered? \$\endgroup\$ –  The Photon Commented May 14, 2012 at 4:52
  • \$\begingroup\$ Yes and no - the input to a transparent latch propagates directly to the output, not on a clock edge. But the addition of an enable signal could make the latch be controlled on a clock edge, ie, opaque. \$\endgroup\$ –  Kevin H Commented May 14, 2012 at 16:17

Assignments in VHDL are neighter specified as registered or combinatorial. In VHDL the actual assignment type (the type of RTL logic generated) is just inferred.

Registers in VHDL are created explicitly by assigning a signal on a clock edge, though just because a process has a clock it does not mean all signals in that block will be assigned on every edge.

Also registers can be inferred without a clock, if some path through a process does not assign a signal, then VHDL assumes you meant to latch that signal between successive passes. This is called an inferred latch (and should be avoided).

VHDL does not know about the technology that you are going to be using. It does not know whether your synthisis engine can generate T,D,JK,SR, or any other sort of latch. For that reason it just suggests a latch, it is up to the synthisis enging to decide which latch fits the bill or if it is simply impossible. Similarlay the fitter might say that a particular latch requested by the synthisis enging is not available or there are no enough of them.

Jay M's user avatar

Your Answer

Sign up or log in, post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

Not the answer you're looking for? Browse other questions tagged vhdl signal state-machines or ask your own question .

  • The Overflow Blog
  • From PHP to JavaScript to Kubernetes: how one backend engineer evolved over time
  • Where does Postgres fit in a world of GenAI and vector databases?
  • Featured on Meta
  • We've made changes to our Terms of Service & Privacy Policy - July 2024
  • Bringing clarity to status tag usage on meta sites

Hot Network Questions

  • Can a 2-sphere be squashed flat?
  • Dress code for examiner in UK PhD viva
  • Is it possible for a fuse to blow at extremely low temperatures?
  • My collegeagues and I are travelling to UK as delegates in an event and the company is paying for all our travel expenses. what documents are required
  • What does "garb" mean in this passage?
  • How do you determine what order to process chained events/interactions?
  • Is the theory of ordinals in Cantor normal form with just addition decidable?
  • Purpose of burn permit?
  • How would increasing atomic bond strength affect nuclear physics?
  • What was I thinking when I made this grid?
  • Is there any video of an air-to-air missile shooting down an aircraft?
  • Validity of ticket when using alternative train from a different station
  • Deviation from the optimal solution for Solomon instances of CVRPTW
  • Using "no" at the end of a statement instead of "isn't it"?
  • Sci-fi short story about a dystopian future where all natural resources had been used up and people were struggling to survive
  • How much missing data is too much (part 2)? statistical power, effective sample size
  • What is the spiritual difference between hungering and thirsting? (Matthew 5:6)
  • How do you hide an investigation of alien ruins on the moon during Apollo 11?
  • Why are AAVs not a replacement for through-roof vent pipe?
  • Crystal Oscillator Waveform
  • How can I draw water level in a cylinder like this?
  • On a 3D Gagliardo-Nirenberg inequality
  • Ship sinking prevention device using foam?
  • My school wants me to download an SSL certificate to connect to WiFi. Can I just avoid doing anything private while on the WiFi?

vhdl generate signal assignment

vhdl generate signal assignment

  • Product Manual
  • Knowledge Base
  • Release Notes
  • Tech Articles
  • Screencasts

Signal Assignments in VHDL: with/select, when/else and case

Sometimes, there is more than one way to do something in VHDL. OK, most of the time , you can do things in many ways in VHDL. Let’s look at the situation where you want to assign different values to a signal, based on the value of another signal.

With / Select

The most specific way to do this is with as selected signal assignment. Based on several possible values of a , you assign a value to b . No redundancy in the code here. The official name for this VHDL with/select assignment is the selected signal assignment .

When / Else Assignment

The construct of a conditional signal assignment is a little more general. For each option, you have to give a condition. This means that you could write any boolean expression as a condition, which give you more freedom than equality checking. While this construct would give you more freedom, there is a bit more redundancy too. We had to write the equality check ( a = ) on every line. If you use a signal with a long name, this will make your code bulkier. Also, the separator that’s used in the selected signal assignment was a comma. In the conditional signal assignment, you need the else keyword. More code for the same functionality. Official name for this VHDL when/else assignment is the conditional signal assignment

Combinational Process with Case Statement

The most generally usable construct is a process. Inside this process, you can write a case statement, or a cascade of if statements. There is even more redundancy here. You the skeleton code for a process (begin, end) and the sensitivity list. That’s not a big effort, but while I was drafting this, I had put b in the sensitivity list instead of a . Easy to make a small misstake. You also need to specify what happens in the other cases. Of course, you could do the same thing with a bunch of IF-statements, either consecutive or nested, but a case statement looks so much nicer.

While this last code snippet is the largest and perhaps most error-prone, it is probably also the most common. It uses two familiar and often-used constructs: the process and the case statements.

Hard to remember

The problem with the selected and conditional signal assignments is that there is no logic in their syntax. The meaning is almost identical, but the syntax is just different enough to throw you off. I know many engineers who permanenty have a copy of the Doulos Golden Reference Guide to VHDL lying on their desks. Which is good for Doulos, because their name gets mentioned all the time. But most people just memorize one way of getting the job done and stick with it.

  • VHDL Pragmas (blog post)
  • Records in VHDL: Initialization and Constraining unconstrained fields (blog post)
  • Finite State Machine (FSM) encoding in VHDL: binary, one-hot, and others (blog post)
  • "Use" and "Library" in VHDL (blog post)
  • The scope of VHDL use clauses and VHDL library clauses (blog post)
  • Network Sites:
  • Technical Articles
  • Market Insights

All About Circuits

  • Or sign in with
  • iHeartRadio

All About Circuits

Concurrent Conditional and Selected Signal Assignment in VHDL

Join our engineering community sign-in with:.

This article will review the concurrent signal assignment statements in VHDL.

This article will first review the concept of concurrency in hardware description languages. Then, it will discuss two concurrent signal assignment statements in VHDL: the selected signal assignment and the conditional signal assignment. After giving some examples, we will briefly compare these two types of signal assignment statements.

Please see my article introducing the concept of VHDL if you're not familiar with it.

Concurrent vs. Sequential Statements

To understand the difference between the concurrent statements and the sequential ones, let’s consider a simple combinational circuit as shown in Figure 1.

vhdl generate signal assignment

Figure 1. A combinational circuit.

If we consider the operation of the three logic gates of this figure, we observe that each gate processes its current input(s) in an independent manner from other gates. These physical components are operating simultaneously. The moment they are powered, they will “concurrently” fulfill their functionality. Note that while, in practice, the AND gate has a delay to produce a valid output, this does not mean that the OR gate will stop its functionality and wait until the output of the AND gate is produced. The OR gate will function all the time; however, its output will not be valid until its inputs have settled.

Now, let’s examine the VHDL description of Figure 1. This is shown below:

The main part that we are here interested in is the definition of the three gates:

Each of these lines describes a physical component in Figure 1. For example, the second line, which describes the OR gate, takes sig1 and c as inputs and produces the OR of these two values. We saw that the physical components of Figure 1 operate concurrently. Hence, it is reasonable to expect that the VHDL description of these gates should be evaluated in a concurrent manner. In other words, the above three lines of the code are executed at the same time and there is no significance to the order of these statements. As a result, we can rewrite the architecture section of the above code as below:

Since these statements are evaluated at the same time, we call them concurrent statements. This type of code is quite different from what we have learned in basic computer programming where the lines of code are executed one after the other. For example, consider the following MATLAB code:

This code produces out1=1 and out2=1 . However, if we change the order of the statements to the following, the program will stop working because we are trying to use sig1 before it is generated.

While the VHDL code describing Figure 1 was executed concurrently, the above MATLAB code is evaluated sequentially (i.e., one line after the other). VHDL supports both the concurrent statements and the sequential ones. It's clear that the concurrent VHDL statements will allow us to easily describe a circuit such as the one in Figure 1 above. In a future article, we'll see that the sequential VHDL statements allow us to have a safer description of sequential circuits. Furthermore, using the sequential VHDL, we can easily describe a digital circuit in a behavioral manner. This capability can significantly facilitate digital hardware design.

The following figure illustrates the difference between concurrent and sequential statements.

vhdl generate signal assignment

Figure 2. The difference between concurrent and sequential statements. Image courtesy of VHDL Made Easy .

Now let's take a look at two concurrent signal assignment statements in VHDL: “the selected signal assignment statement” and “the conditional signal assignment statement”.

Selected Signal Assignment or the “With/Select” Statement

Consider an n -to-one multiplexer as shown in Figure 3. This block should choose one out of its n inputs and transfer the value of this input to the output terminal, i.e., output_signal .

vhdl generate signal assignment

Figure 3. A multiplexer selects one of its n inputs based on the value of the control_expression.

The selected signal assignment allows us to implement the functionality of a multiplexer. For example, the VHDL code describing the multiplexer of Figure 3 will be

Here, the value of the control_expression will be compared with the n possible options, i.e., option_1 , option_2 , …, option_n . When a match is found, the value corresponding to that particular option will be assigned to the output signal, i.e., output_signal . For example, if control_expression is the same as option_2 , then value_2 will be assigned to the output_signal .

Note that the options of a “with/select” assignment must be mutually exclusive, i.e., one option cannot be used more than once. Moreover, all the possible values of the control_expression must be included in the set of the options. The following example clarifies these points.

Example 1 : Use the "with/select" statement to describe a one-bit 4-to-1 multiplexer. Assume that the inputs to be selected are a , b , c , and d . And, a two-bit signal, sel , is used to choose the desired input and assign it to out1 .

The code for this multiplexer is given below:

Note that since the std_logic data type can take values other than “0” and “1” , the last line of the “with/select” statement needs to use the keyword “ others ” to take all the possible values of sel into account.

The following figure shows the simulation of this code using the Xilinx ISE simulator. (In case you’re not familiar with ISE, see this tutorial .) As shown in this figure, from 0 nanosecond (ns) until 300 ns the select input, sel , is 00, and, hence, out1 follows the input a . Similarly, you can verify the intended operation for the rest of the simulation interval.

vhdl generate signal assignment

Figure 4. The ISE simulation for the multiplexer of Example 1.

Example 2 : Use the “with/select” statement to describe a 4-to-2 priority encoder with the truth table shown below.

vhdl generate signal assignment

The following VHDL code can be used to describe the above truth table:

The ISE simulation is shown in Figure 5.

vhdl generate signal assignment

Figure 5. The ISE simulation for the priority encoder of Example 2.

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 “when/else” statement and then discuss some details.

Example 3 : Use the when/else statement to describe a one-bit 4-to-1 multiplexer. Assume that the inputs to be selected are a , b , c , and d . And, a two-bit signal, sel , is used to choose the desired input and assign it to out1 .

The code will be

In this case, the expressions after “when” are evaluated successively until a true expression is found. The assignment corresponding to this true expression will be performed. If none of these expressions are true, the last assignment will be executed. In general, the syntax of the “when/else” statement will be:

We should emphasize that the expressions after the “when” clauses are evaluated successively. As a result, the expressions evaluated earlier has a higher priority compared to the next ones. Considering this, we can obtain the conceptual diagram of this assignment as shown in Figure 6. This figure illustrates a conditional signal assignment with three “when” clauses.

vhdl generate signal assignment

Figure 6. The conceptual implementation of a “when/else” statement with three “when” clauses.

Let’s review the main features of the selected signal assignment and the conditional signal assignment.

“With/Select” vs. “When/Else” Assignment

As mentioned above, the options of a “with/select” assignment must be mutually exclusive, i.e., one option cannot be used more than once. Moreover, all the possible values of the control_expression must be included in the set of options. While the “with/select” assignment has a common controlling expression, a “when/else” assignment can operate on expressions with different arguments. For example, consider the following lines of code:

In this case, the expressions are evaluating two different signals, i.e., reset1 and clk .

For the “when/else” assignment, we may or may not include all the possible values of the expressions to be evaluated. For example, the multiplexer of Example 3 covers all the possible values of sel ; however, the above code does not. The above code implies that out1 should retain its previous value when none of the expressions are true. This causes the inference of a latch in the synthesized circuit.

Another important difference between the “with/select” and “when/else” assignment can be seen by comparing the conceptual implementation of these two statements. The priority network of Figure 6 involves a cascade of several logic gates. However, the “with/select” assignment avoids this chain structure and has a balanced structure. As a result, in theory, the “with/select” statement may have better performance in terms of the delay and area (see RTL Hardware Design Using VHDL: Coding for Efficiency, Portability, and Scalability , Xilinx HDL Coding Hints , and Guide to HDL Coding Styles for Synthesis ).

In practice, we generally don’t see this difference because many synthesis software packages, such as the Xilinx XST, try not to infer a priority encoded logic. Though we can use the PRIORITY_EXTRACT constraint of XST to force priority encoder inference, Xilinx strongly suggests that we use this constraint on a signal-by-signal basis; otherwise, the constraint may guide us towards sub-optimal results. For more details see page 79 of the XST user guide .

  • Concurrent statements are executed at the same time and there is no significance to the order of these statements. This type of code is quite different from what we have learned in basic computer programming where the lines of code are executed one after the other.
  • The selected signal assignment or the "with/select" assignment allows us to implement the functionality of a multiplexer.
  • The options of a “with/select” assignment must be mutually exclusive, i.e., one option cannot be used more than once. Moreover, all the possible values of the control_expression must be included in the set of the options.
  • For the "when/else" statement, the expressions after the “when” clauses are evaluated successively. As a result, the expressions evaluated earlier has a higher priority compared to the next ones.
  • One important difference between the “with/select” and “when/else” assignment can be seen by comparing the conceptual implementation of these two statements. The "when/else" statement has a priority network; however, the “with/select” assignment avoids this chain structure and has a balanced structure.

To see a complete list of my articles, please visit  this page .

  Featured image used courtesy of Parallella .

Related Content

  • Safety in Sensing: Sensor Technology in Smart Cities
  • Thermocouple Signal Conditioners and Signal Conditioning Near the Cold Junction
  • Reducing Distortion in Tape Recordings with Hysteresis in SPICE
  • Test & Measurement in Quantum Computing
  • Open RAN – Network Performance in the Lab and in the Field
  • Looking for Good Waves: The Importance of Signal Integrity in High-Speed PCB Design

Learn More About:

  • programmable logic

vhdl generate signal assignment

Great content. The link to the ISE guide requires password. Can we get that posted again? Thanks!

You May Also Like

vhdl generate signal assignment

The Many Interfaces of PCIe® Connectivity

In Partnership with Microchip Technology

vhdl generate signal assignment

How Do I Find the Right Form Factor?

by Advantech

vhdl generate signal assignment

TDK Launches Sensor Partner Program and MEMS Microphone

by Jake Hertz

vhdl generate signal assignment

EliteSiC M3S Technology for High−Speed Switching Applications

vhdl generate signal assignment

Infineon Levels Up Machine Learning Performance With Three New MCUs

All About Circuits

Welcome Back

Don't have an AAC account? Create one now .

Forgot your password? Click here .

All About Circuits Logo

Forum for Electronics

  • Search forums

Follow along with the video below to see how to install our site as a web app on your home screen.

Note: This feature may not be available in some browsers.

Welcome to EDAboard.com

Welcome to our site edaboard.com is an international electronics discussion forum focused on eda software, circuits, schematics, books, theory, papers, asic, pld, 8051, dsp, network, rf, analog design, pcb, service manuals... and a whole lot more to participate you need to register. registration is free. click here to register now..

  • Digital Design and Embedded Programming
  • PLD, SPLD, GAL, CPLD, FPGA Design

generate signal assignment in vhdl

  • Thread starter ali.329
  • Start date Nov 4, 2016
  • Nov 4, 2016

Newbie level 2

" Illegal target for signal assignment." Click to expand...
"Unknown identifier A0_i." Click to expand...
Code VHDL - ]
fff is signal A0_0 : bit ; signal A0_1 : bit ; signal A0_2 : bit ; signal A0_3 : bit ;   begin       U0 : for i in 0 to 3 generate       U1 : A0_i <= a(i) and b(i) ;       end generate; end sss;

ThisIsNotSam

Advanced member level 5.

why wouldn't you make an array and use i to index? if you absolutely need all 4 A0 signals, you can make a temp array, work on it, and then feed the original signals.  

FvM

Super Moderator

Generate can access array elements but doesn't perform text manipulations of signal names. Need to define a bit_vector port signal.  

Thanks a lot. So there isn't any way to solve this problem with these signals name? I must define array.  

ads-ee

ali.329 said: Thanks a lot. So there isn't any way to solve this problem with these signals name? I must define array. Click to expand...

Advanced Member level 4

You can do it with a 3rd party pre-processor that generates a new file from a template. At one point I had one that let me embed python code in a VHDL/Verilog file for the purpose of code generation.  

You can do it with a 3rd party pre-processor that generates a new file from a template. At one point I had one that let me embed python code in a VHDL/Verilog file for the purpose of code generation. Click to expand...

Similar threads

  • Started by Igloo2
  • Aug 19, 2024
  • Started by KrishKrishnaa
  • Aug 7, 2024
  • Started by metamisers
  • Aug 2, 2024
  • Started by irfanraina1@123
  • Feb 27, 2024

KfirMaymon84

  • Started by KfirMaymon84
  • Jun 14, 2024

Part and Inventory Search

Welcome to edaboard.com.

  • This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register. By continuing to use this site, you are consenting to our use of cookies. Accept Learn more…

HDLRuby: A Ruby Extension for Hardware Description and Its Translation to Synthesizable Verilog HDL

New citation alert added.

This alert has been successfully added and will be sent to:

You will be notified whenever a record that you have chosen has been cited.

To manage your alert preferences, click on the button below.

New Citation Alert!

Please log in to your account

Information & Contributors

Bibliometrics & citations, view options, 1 introduction.

vhdl generate signal assignment

2 Related Works

3 presentation of the hdlruby language, 3.1 overview of the language, 3.2 an example of hdlruby code.

vhdl generate signal assignment

3.3 Implementing a Generic Multi-dimensional CNN with HDLRuby

3.3.1 overview of the cnn implementation., 3.3.2 the global network module..

vhdl generate signal assignment

3.3.3 The Abstract Description of a Layer.

3.3.4 the description of a dense layer., 3.3.5 the description of layers based on sliding windows..

vhdl generate signal assignment

3.3.6 The Descriptions of a Convolution Layer and a Pooling Layer.

vhdl generate signal assignment

4 Extending Ruby to HDLRuby

4.1 the basic constructs of the hdlruby language, 4.2 integrating the hardware expressions, 4.3 integrating the hierarchy, 4.4 integrating the statements.

vhdl generate signal assignment

4.5 Integrating the Declarations

4.6 names and access to hardware components.

vhdl generate signal assignment

4.7 Managing Namespaces

4.8 integrating inheritance, 4.9 integrating genericity and metaprogramming.

vhdl generate signal assignment

5 Processing HDLRuby Description

vhdl generate signal assignment

5.1 Building the HDLRuby RTL Tree

vhdl generate signal assignment

5.2 Converting the HDLRuby RTL Tree for Easy Translation to Other HDL

vhdl generate signal assignment

5.3 Generating the Verilog HDL Code

6 experiments.

SampleNumber ofCompiling time (s)MemoryVerilog
 elementsMACWINLIN(KB)(KB)
Terms1,0000.91.10.534,45634
 2,0003.12.41.552,37272
 3,0006.74.63.395,548110
 4,00012.17.95.9124,720148
 5,00018.011.79.0121,844186
Assignments1,0000.30.70.127,00075
 2,0000.30.70.130,620156
 3,0000.30.80.133,276237
 4,0000.30.80.237,044318
 5,0000.40.80.238,656399
Processes1,0000.30.80.230,100135
 2,0000.40.90.235,688278
 3,0000.51.00.343,788420
 4,0000.71.00.353,180563
 5,0000.91.30.454,836705
Instances1,00025.921.613.0129,928523
 2,000110.485.657.0226,9641,060
 3,000253.2198.3129.3290,3121,620
 4,000449.6344.2229.1354,2522,180
 5,000711.8538.3375.6424,1842,747
CNNNumber of neurons’Compiling time (s)MemoryVerilogFPGA synthesis time (s)FPGA usage
structureinstancesconnectionsMACWINLIN(KB)(KB)RTLImplTotalLUT (%)
d8d10186,352542107,3247342261944201.4
d16d102612,704964165,5921,4543822206022.7
d32d104225,40817119266,1922,8793512686195.4
d64d107450,816352418473,1685,7516213971,01811.0
d128d10138101,632734938837,94411,5711,1176931,81022.2
d256d10266203,264154104791,438,36423,6602,0851,2863,37143.1
d512d10522406,5283142441662,549,05247,3114,2173,0107,22793.7
pc2c1d104987,176544243,3441,9833232205432.2
pc4c1d1098613,56812105488,6563,8998702801,1504.3
pc8c1d101,96226,352362716873,7527,7716493951,0448.5
pc16c1d103,91451,92012577521,508,04416,0041,0516311,68218.0
pc32c1d107,818103,0565032881882,418,21232,0912,2151,2883,50340.0
pc2c2d1069810,976984361,0882,8931,0642541,3184.0
pc2c4d101,09818,56721159550,0004,7324063067126.4
pc2c8d101,89833,776634227889,0128,500672544121614.6
pc2c16d103,49864,176226130921,520,82016,0191,2591,0282,28731.3
pc2c32d106,698124,97610195183992,438,66831,0722,9533,0556,00861.6
pc4c4d102,18636,3686046291,010,0449,5397185601,27815.5
pc8c8d107,562132,75210256053972,630,24834,2413,2392,6205,85964.8
c2pc1pd101,60416,398251910595,0965,7213552215762.0
c4pc2pd103,68238,55210365371,303,30013,7017753001,0755.7
c8pc4pd109,290100,1285463101922,744,62435,3102,1976652,86216.6
3ppc1c1d1016229,070653212,7122,5613012015020.9
3ppc2c2d1036835,442985313,7123,8533202345542.2
3ppc4c4d1094254,180191710641,2047,6005413168576.2
3ppc8c8d102,738115,6324876531,629,92419,8551,2106301,84016.4

vhdl generate signal assignment

7 Conclusion

Index terms.

Electronic design automation

Hardware description languages and compilation

Recommendations

Synthesizable standard cell fpga fabrics targetable by the verilog-to-routing cad flow.

In this article, we consider implementing field-programmable gate arrays (FPGAs) using a standard cell design methodology and present a framework for the automated generation of synthesizable FPGA fabrics. The open-source Verilog-to-Routing (VTR) FPGA ...

Verilog HDL Synthesis: A Practical Primer

The verilog procedural interface for the verilog hardware description language.

The Verilog Procedural Interface is a new C programming interface for the Verilog Hardware Description Language. Different Verilog HDL based tools such as simulators, synthesizers, timing analyzers, and parsers could support this interface for ...

Information

Published in.

cover image ACM Transactions on Embedded Computing Systems

Association for Computing Machinery

New York, NY, United States

Journal Family

Publication history, check for updates, author tags.

  • Register transfer level
  • software language
  • Research-article

Funding Sources

  • Japanese Grants-in-Aid for Scientific Research

Contributors

Other metrics, bibliometrics, article metrics.

  • 0 Total Citations
  • 290 Total Downloads
  • Downloads (Last 12 months) 223
  • Downloads (Last 6 weeks) 71

View options

View or Download as a PDF file.

View online with eReader .

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Full Access

Share this publication link.

Copying failed.

Share on social media

Affiliations, export citations.

  • Please download or close your previous search result export first before starting a new bulk export. Preview is not available. By clicking download, a status dialog will open to start the export process. The process may take a few minutes but once it finishes a file will be downloadable from your browser. You may continue to browse the DL while the export process is in progress. Download
  • Download citation
  • Copy citation

We are preparing your search results for download ...

We will inform you here when the file is ready.

Your file of search results citations is now ready.

Your search export query has expired. Please try again.

  • Stack Overflow for Teams Where developers & technologists share private knowledge with coworkers
  • Advertising & Talent Reach devs & technologists worldwide about your product, service or employer brand
  • OverflowAI GenAI features for Teams
  • OverflowAPI Train & fine-tune LLMs
  • Labs The future of collective knowledge sharing
  • About the company Visit the blog

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Get early access and see previews of new features.

Signals and synthesis of registers/flip flops in VHDL

Waveform link included I have a confusion regarding the value assignment to signal in VHDL.

Confusion is that I have read that values to signal gets assigned at end of process.

Does the value get assigned right when the process finishes or when the process is triggered the next time?

If it is assigned at the end of the process then consider this scenario (3 flip flops in series i.e output of one flip flop is input to another) then if D1 is 1 at time 0 will not the output Q3 be 1 at the same time?

Curious's user avatar

  • 1 possible duplicate of How does signal assignment work in a process? –  Morten Zilmer Commented May 5, 2014 at 19:19
  • Your example for 2. is what happens with a chain of transparent latches. Flip-flops only update on an edge and will see the old value of whatever is driving their Q input not the new value it is updating to after the clock. In real systems you could introduce enough skew between clocks to cause this sort of fall through but it is not normally done in synchronous design. The VHDL simulation kernel ensures this won't happen unless you explicitly make it that way. –  Kevin Thibedeau Commented May 5, 2014 at 21:48
  • Thank you for the quick response. My professor said that in VHDL on the rising edge clk event when a signal is assigned a register is formed. process(clk) if(clk='1' and clk'event)then output<=D; end if; ( what i understand from this is that on the rising edge the signal output is assigned to D but since it results into a register the signal output value will change on next rising clk edge(regsiter) is this right?? –  Curious Commented May 6, 2014 at 16:06

2 Answers 2

(1) Right when the process finishes. More precisely, right after this and ALL processes running alongside this process have finished, and before any processes are subsequently started. So when any signal assignment happens, no process is running.

(2) Q3 will become the value on D1 three clock cycles earlier. Whether that value was '1' or not I can't tell from your question!

  • I have added the waveform link to the question. My professor said that in VHDL on the rising edge clk event when a signal is assigned a register is formed. process(clk) if(clk='1' and clk'event)then output<=D; end if; ( what i understand from this is that on the rising edge the signal output is assigned to D but since it results into a register the signal output value will change on next rising clk edge(regsiter) is this right?? Which output(1,2,3) will be correct in the link of the image?? –  Curious Commented May 6, 2014 at 17:15
  • Which output do you expect? –  user1818839 Commented May 6, 2014 at 19:03
  • I think since a register will be formed it will cause a delay in the output and thus the answer should be the one i showed in (output 1) in the image link. –  Curious Commented May 6, 2014 at 19:12
  • No, a single register would be loaded on the next rising_edge(clk) after D, and its output would be immediately available : waveform 2. You would need a second register with its D connected to the first Q, both clocked from clk to get waveform 1. Try these in a simulator. –  user1818839 Commented May 6, 2014 at 19:23
  • library ieee; use ieee.std_logic_1164.all; entity reg is generic ( width : positive := 8); port ( clk : in std_logic; rst : in std_logic; input : in std_logic_vector(width-1 downto 0); output : out std_logic_vector(width-1 downto 0)); end reg; architecture SYNC_RST of reg is begin if (clk'event and clk='1') then if (rst = '1') then output <= (others => '0'); else output <= input; end if; end if; end process; end SYNC_RST; --output-> link –  Curious Commented May 6, 2014 at 20:13

The signal assignment is done only at the end of the process. After signal assignment, there may exist signal updates and because of the signal updates, the process itself or maybe other processes which are sensitive to some of the updated signals will be triggered. This is the concept of delta-cycle. It happens in a zero simulation time. signal updates -> triggers process->at the end of the process, signals are updated ----------------------------------- ----------------------------------- this is one delta cycle starting of the second delta cycle

when there will be no signal update, the process finishes and the the simulation time increments.

user3690624's user avatar

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Sign up or log in

Post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy .

Not the answer you're looking for? Browse other questions tagged vhdl or ask your own question .

  • The Overflow Blog
  • From PHP to JavaScript to Kubernetes: how one backend engineer evolved over time
  • Where does Postgres fit in a world of GenAI and vector databases?
  • Featured on Meta
  • We've made changes to our Terms of Service & Privacy Policy - July 2024
  • Bringing clarity to status tag usage on meta sites
  • Feedback requested: How do you use tag hover descriptions for curating and do...
  • What does a new user need in a homepage experience on Stack Overflow?
  • Staging Ground Reviewer Motivation

Hot Network Questions

  • How are notes named in Japan?
  • On a 3D Gagliardo-Nirenberg inequality
  • How to assess whether it is imposter syndrome or actual low quality work during Ph.D.?
  • How can these humans cross the ocean(s) at the first possible chance?
  • Using "no" at the end of a statement instead of "isn't it"?
  • My school wants me to download an SSL certificate to connect to WiFi. Can I just avoid doing anything private while on the WiFi?
  • What did the Ancient Greeks think the stars were?
  • Can a 2-sphere be squashed flat?
  • Are there any theoretical reasons why we cannot measure the position of a particle with zero error?
  • What was I thinking when I made this grid?
  • Why do National Geographic and Discovery Channel broadcast fake or pseudoscientific programs?
  • Is it possible to create a board position where White must make the move that leads to stalemating Black to avoid Black stalemating White?
  • ST_Curvetoline creates invalid geometries
  • What did Jesus mean by 'cold water'' in Mtt 10:42?
  • Seth and Cain take turns picking numbers from 1 to 50. Who wins?
  • Can light become a satellite of a black hole?
  • How to justify our beliefs so that it is not circular?
  • Where did Geordi's eyes go?
  • How can you trust a forensic scientist to have maintained the chain of custody?
  • "can-do" vs. "can-explain" fallacy
  • ApiVersion 61.0 changes behaviour of inheritance (cannot override private methods in inner class)
  • What is the spiritual difference between hungering and thirsting? (Matthew 5:6)
  • How do I safely remove a mystery cast iron pipe in my basement?
  • Completely introduce your friends

vhdl generate signal assignment

IMAGES

  1. VHDL Introduction

    vhdl generate signal assignment

  2. Solved Write a VHDL code using Simple Signal Assignment to

    vhdl generate signal assignment

  3. 006 11 Concurrent Conditional Signal Assignment in vhdl verilog fpga

    vhdl generate signal assignment

  4. Solved Write a VHDL code using Selected Signal Assignment to

    vhdl generate signal assignment

  5. PPT

    vhdl generate signal assignment

  6. Solved Write a VHDL program for signal selected assignment

    vhdl generate signal assignment

COMMENTS

  1. modelsim

    The idea here is to provide a name that can be indexed (8.4 Index names) for the generate statement assignment statement target. The issue is A0_i is an identifier (15.4) and indivisible lexical element (15.3). entity fff is. port (. a: in bit_vector(0 to 3); b: in bit_vector(0 to 3) ); end entity; architecture sss of fff is.

  2. VHDL Example Code of Generate Statement

    Generate Statement - VHDL Example. Generate statements are used to accomplish one of two goals: Replicating Logic in VHDL. Turning on/off blocks of logic in VHDL. The generate keyword is always used in a combinational process or logic block. It should not be driven with a clock.

  3. Writing Reusable VHDL Code using Generics and Generate Statements

    The VHDL code snippet below shows how we would write this code using the for generate statement. -- Code to declare an array type. type slv_array_t is array (0 to 2) of std_logic_vector(3 downto 0); rd_data_array : slv_array_t; -- Generate the RAM modules. gen_ram_array: for i in 0 to 2 generate.

  4. VHDL Reference Guide

    The for ..generate statement isd usually used to instantiate "arrays" of components. The generate parameter may be used to index array-type signals associated with component ports: architecture GEN of REG_BANK is component REG port(D,CLK,RESET : in std_ulogic; Q : out std_ulogic); end component; begin GEN_REG: for I in 0 to 3 generate REGX : REG port map (DIN(I), CLK, RESET, DOUT(I)); end ...

  5. 4.9 VHDL Signal and Generate Statements

    4.9 VHDL SIGNAL AND GENERATE STATEMENTS 4.9.1 Signal Statement. Signal is a VHDL keyword. It declares a signal of specified data type. A signal declaration is used to represent internal signals within an architecture declaration.. Figure 4.20 Logic Circuit with Internal Signals. Unlike entity ports, internal signals do not have a direction. Signal assignment statements execute only when the ...

  6. Designing Circuits with VHDL

    Signal Assignments in VHDL Combinational circuits can be represented by circuit schematics using logic gates. For example, Equivalently, ... The for-generate statement also allows us to define the adder using a named constant for the word size, instead of explicit values. This makes the code more general and easier to change, if we decide that ...

  7. Generate Statement

    The for generate statement is usually used to instantiate "arrays" of components. The generate parameter may be used to index array-type signals associated with component ports: A label is compulsory with a generate statement. The for generate statement is particularly powerful when used with integer generics.

  8. VHDL Logical Operators and Signal Assignments for Combinational Logic

    The VHDL code shown below uses one of the logical operators to implement this basic circuit. and_out <= a and b; Although this code is simple, there are a couple of important concepts to consider. The first of these is the VHDL assignment operator (<=) which must be used for all signals.

  9. VHDL Reference Guide

    Assignment to 'Z' will normally generate tri-state drivers. assignment to 'X' may not be supported. Whats New in '93: In VHDL-93, any signal assignment statement may have an optional label: label: signal_name <= expression; A delayed signal assignment with inertial delay may be explicitly preceded by the keyword inertial.

  10. vhdl

    1. Assignments in VHDL are neighter specified as registered or combinatorial. In VHDL the actual assignment type (the type of RTL logic generated) is just inferred. Registers in VHDL are created explicitly by assigning a signal on a clock edge, though just because a process has a clock it does not mean all signals in that block will be assigned ...

  11. Signal Assignments in VHDL: with/select, when/else and case

    With / Select. The most specific way to do this is with as selected signal assignment. Based on several possible values of a, you assign a value to b. No redundancy in the code here. The official name for this VHDL with/select assignment is the selected signal assignment. with a select b <= "1000" when "00", "0100" when "01", "0010" when "10 ...

  12. VHDL Reference Guide

    Conditional signal assignments are generally synthesisable. A conditional signal assignment will usually result in combinational logic being generated. Assignment to 'Z' will normally generate tri-state drivers. ... any signal assigment statement may have an optinal label. VHDL-93 defines an unaffected keyword, which indicates a condition when ...

  13. 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 ...

  14. 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 ...

  15. generate signal assignment in vhdl

    VHDL is not a string manipulation language, and signal names are not strings that you can perform text manipulation on to construct new signal names. You can perhaps do this in some programing languages, but VHDL is less than a crummy programming language.

  16. concurrent and conditional signal assignment (VHDL)

    5. Where you are hinting at in your problem has nothing to do with concurrent assignments or sequential statements. It has more to do with the difference between if and case. Before we get to that first lets understand a few equivalents. The concurrent conditional assignment: Y <= A when ASel = '1' else B when BSel = '1' else C ;

  17. HDLRuby: A Ruby Extension for Hardware Description and Its Translation

    Digital hardware is notably more time-consuming to design than software. Even now, register transfer level (RTL) description and languages such as Verilog HDL [], SystemVerilog [], and VHDL [] remain the de facto standards for hardware, whereas software design is in perpetual evolution.Large research efforts have been made for reducing the gap between hardware and software design with the main ...

  18. VHDL: setting a constant conditionally based on another constant's

    The simplest solution is to change the datatype of burst_mode to integer with range 0 to 1, and then use some math: library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity bridge is. generic (. burst_mode :integer range 0 to 1 := 0. ); end entity;

  19. Signals and synthesis of registers/flip flops in VHDL

    The signal assignment is done only at the end of the process. After signal assignment, there may exist signal updates and because of the signal updates, the process itself or maybe other processes which are sensitive to some of the updated signals will be triggered. This is the concept of delta-cycle. It happens in a zero simulation time.