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 7760151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:48:27+00:00 2026-06-01T13:48:27+00:00

I’ve got a problem with a pseudo random number generators with a counter to

  • 0

I’ve got a problem with a pseudo random number generators with a counter to check if I’m dealling with irreducible polynomial. the geenrator is working without problems but the counter doesn’t if I try to use it as a sub-module. any idea ??

-- x^6 + x^5 + x^3 + x^2 + 1

Library IEEE;
use ieee.numeric_std.all;

use IEEE.STD_LOGIC_1164.ALL;

use ieee.std_logic_unsigned.all;


entity EPZG is
   port (CLK:       in std_logic;                      
         EQ:        out bit_vector(5 downto 0);  
             A :        out bit );
 end EPZG;

 architecture behaviour of EPZG is 
 component Counter is port ( CLK, RESET : in std_logic;
   result: out bit_vector(5 downto 0)); 
 end component;

signal SZ: bit; 
signal SEQ : bit_vector(5 downto 0); 
signal CNT_RESET : std_logic; 
signal CNT_RESULT : bit_vector(5 downto 0);
begin 
  SZ <= '1';
  PZG : process(CLK)
  begin
  CNT_RESET <= '1';

    if (CLK'event and CLK ='1') then
       SEQ(0) <= SZ xor SEQ(5);
       SEQ(1) <= SEQ(0);
       SEQ(2) <= SEQ(1) xor SEQ(5);
       SEQ(3) <= SEQ(2) xor SEQ(5);
       SEQ(4) <= SEQ(3);
       SEQ(5) <= SEQ(4) xor SEQ(5);
    end if;
end process PZG;
EQ <= SEQ;
CNT: Counter port map ( CLK , RESET =>CNT_RESET,result =>CNT_RESULT);
end behaviour;

the counter Code

  1. Library IEEE;
    use IEEE.STD_LOGIC_1164.ALL;
    use ieee.std_logic_unsigned.all;

    entity Counter is port 
    (CLK, RESET : in std_logic;
      result: out bit_vector(5 downto 0));
    end Counter;
    
    architecture BEHAVIOUR of Counter is
      signal pre_counter: std_logic_vector(5 downto 0);
      begin 
      REG : process(CLK, RESET)
      begin
      if(CLK'event and CLK = '1') then 
         if (RESET = '0') then
             pre_counter <= (others =>'0');
         else
      pre_counter <= pre_counter +1 ;
        end if;
      end if; 
    end process;
    result <= To_bitvector (pre_counter);
    end BEHAVIOUR;
    
  • 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-01T13:48:28+00:00Added an answer on June 1, 2026 at 1:48 pm

    Okay then, another try. Your counter module never gets reset, so pre_counter is never initialized – which will give you undefined results in simulation at least. Either generate a reset for it in your top-level code, or initialize it as:

    signal pre_counter: std_logic_vector(5 downto 0) := (others => '0');
    

    Also, your process code in your counter module could use a few tweaks. The process sensitivity list contains both clk and reset, yet your process uses a synchronous reset. You should make your processes either with a synchronous reset and only clk in the sensitivity list:

    process(clk)
    begin
      if(rising_edge(clk)) then
        if(reset = '1') then
        (...)
    

    or with an asynchronous reset and both clk and reset in the sensitivity list:

    process(clk, reset)
    begin
      if(reset = '1') then
        (...)
      elsif(rising_edge(clk)) then
        (...)
    

    Also notice the use of the rising_edge() function, which is the “modern” way of checking for an edge.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I am currently running into a problem where an element is coming back from
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.