Enable signal synthesis

Source: Internet
Author: User

Generation of enable signals by Quartus II Synthesizer

    

Compare the following code with the comprehensive result (the code is taken from the crazybingo routine ):

always@(posedge clk or negedge rst_n)begin    if(!rst_n)        delay_cnt <= 0;    else if(delay_cnt < DELAY_TOP)        delay_cnt <= delay_cnt + 1‘b1;    else        delay_cnt <= 0;endwire    delay_done = (delay_cnt == DELAY_TOP) ? 1‘b1 : 1‘b0;//-----------------------------------always@(posedge clk or negedge rst_n)begin    if(!rst_n)        led_data  <= 0;    else if(delay_done)        led_data <= led_data + 1‘b1;    else        led_data <= led_data;end

The two necessary conditions for generating the enable signal are:

1. the conditional signal (enable signal) must be determined for the signal triggering the output.

2. When the condition signal is determined as false, the trigger outputs the input in the previous state (that is, the input remains unchanged ).

This is the reason why the two if statements in the Code have different results. The above always block statements cannot generate trigger enabling signals, while the underground block statements can generate, because its logic conforms to the role of the enable signal.

The following is the RTL register transfer level circuit diagram after the above Code is integrated:

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.