Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8924451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:25:16+00:00 2026-06-15T07:25:16+00:00

Below is a simple 3-bit counter. When reset(rst) is 0, counter value is 000,

  • 0

Below is a simple 3-bit counter.

When reset(rst) is 0, counter value is “000”, else it increments by 1 for rising edge of each clock.

 LIBRARY ieee;
 USE ieee.std_logic_1164.all;
 use IEEE.std_logic_unsigned.all;
 use IEEE.numeric_std.all;
 ---------------------------------------------
 ENTITY counter IS
 PORT (clk : IN STD_LOGIC;
    rst : in std_logic;
       digit : out std_logic_vector (2 downto 0)
       );
 END counter;
 ---------------------------------------------
 ARCHITECTURE counter OF counter IS
 BEGIN

 count: PROCESS(clk,rst)
 VARIABLE temp : std_logic_vector(2 downto 0);
 BEGIN
 IF (clk'EVENT AND clk='1') THEN
     if (rst = '1') then
        temp := temp + "001";
     else
        temp := "000";
     END IF;
 END IF;
 digit <= temp;
 END PROCESS count;
 END counter;

Below is the simulation result I got :

enter image description here

In the result, output is correct. But there is an one clock delay between the time rst = 1 and output=’001′. ie counter doesn’t increment instantaneously when rst = ‘1’.

As per my understanding, whenever a change in clk or rst happens, process is executed. So when rst changes from low to high, an event occurs. Process checks if rising edge of clk, YES. Then check if rst = 1, YES. So normally counter has to increment in that clk itself. But it doesn’t.

Questions:

  1. Why one clock period delay between reset = 1 and output = 001?
  2. And what is wrong in my understanding?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T07:25:17+00:00Added an answer on June 15, 2026 at 7:25 am

    (Disclaimer: It’s been long time since I programmed in VHDL, so this only answers to generic logic design.)

    Anyway, one can’t expect the result of addition to be ready immediately when a process is triggered. The point is, that calculating even the first bit of 000 + 001 is affected by the propagation delay equivalent to one xor operation. The second bit is calculated from the first bit’s carry (if both bits were 1) and xor operation of the second bits. And so on.

    If one would probe the ‘temp’ variable asynchronously, one would see something like this:

                            ^ ________________
    result_bit_0    __________|
                            0123456789
                    _____________
    result_bit_1            ^    |____________
                            0123456789
                    ____________ _____
    result_bit_2            ^  |_|   |________
                            0123456789abcde
                            ________       
    clock:          ________|      |______|
    

    The figure tries to illustrate in more detail the waveforms of a generic add operation.
    At time 0 the process of adding is started.
    After a small delay ‘2’ the first bit stabilizes to 1.
    At time ‘5’ the second bit stabilizes to 0 and at time ‘9’ the third bit stabilizes to 0.
    But also it’s quite common, that as in result_bit_2, the output toggles between various states.

    It’s the total / maximum delay of each temporary variable to take to stabilize, that determines the minimum clock period. At this case the time instant ‘e’ is that one, where we have decided that the result of counter increment is available.

    Still, from the perspective result (which is a vector), everything happens instantly at the next clock cycle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple bit of jQuery which displays the row below the current
Below is a very simple bit of code that mimics a class structure in
when looping through many web pages and calling something simple like below manyhtmlpages.each do
Below is a basic code bit in as3 flash.A simple video streaming example using
I have a bit of xml file named Sample.xml which is shown below <?xml
Below just a simple race between 2 button in 2 threads, and this will
Consider the simple example below of implementing a method in an Enum. One problem
For a simple plot below, is there a way to make matplotlib populate the
I have a simple code below: import java.util.ArrayList; public class BoidList extends ArrayList {
The code pasted below is a simple JSF program, with an idea of having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.