Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

E Pluribus Unix


devel / comp.arch.fpga / A state machine design problem

SubjectAuthor
* A state machine design problemTianxiang Weng
`- Re: A state machine design problemTianxiang Weng

1
A state machine design problem

<4cca29d1-37c8-4ad0-87c6-118e32ae3ce6n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=192&group=comp.arch.fpga#192

  copy link   Newsgroups: comp.arch.fpga
X-Received: by 2002:a37:6209:: with SMTP id w9mr16448209qkb.490.1625756196763;
Thu, 08 Jul 2021 07:56:36 -0700 (PDT)
X-Received: by 2002:ac8:53d8:: with SMTP id c24mr28551279qtq.38.1625756196624;
Thu, 08 Jul 2021 07:56:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch.fpga
Date: Thu, 8 Jul 2021 07:56:36 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3a90:cb30:9c81:eacc:3605:eebc;
posting-account=uXeJ4gkAAADS8JQB6S6LUjzELiulwQRn
NNTP-Posting-Host: 2600:1700:3a90:cb30:9c81:eacc:3605:eebc
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4cca29d1-37c8-4ad0-87c6-118e32ae3ce6n@googlegroups.com>
Subject: A state machine design problem
From: wtx...@gmail.com (Tianxiang Weng)
Injection-Date: Thu, 08 Jul 2021 14:56:36 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Tianxiang Weng - Thu, 8 Jul 2021 14:56 UTC

Hi,

I have the following VHDL code for a state machine:

type Output_State_t is (

State_a,

State_b,

State_c);

signal Output_State, Output_State_NS : Output_State_t ;

At a clocked process, there is code with the Output_State:

p1: process(Clock, Reset)

begin

if Reset then

Output_State <= State_a;

else

Output_State <= Output_State_NS ;

end if;

end process;

There is a non-clocked process at which Output_State_NS is generated. There is an output enable signal:

signal Output_Enable : std_logic; -- when it = '1', output is allowed, or not allowed if it = '0'.

p2: process(all)

begin

....

A_O <= '0'; -- default values

B_O <= '0';

Output_State_NS <= Output_State;

if Output_Enable = '1' then

case Output_State is

when State_a =>
A_O <= '1';

B_O <= '1';

if Condition_A then

Output_State_NS <= State_b;

end if;

when State\_b =>
....

end case;

end if;
end process;

on clock 1 both Output_Enable and Condition_A = '1', on clock 2, Output_Enable = '0'; In my ModelSim simulation the Output_State is at State_a, not at State_b on clock 2.

Why is it not at State_b?

Thank you.

Weng

Re: A state machine design problem

<5d5e60d1-4731-4bc2-9227-c779d4a676e4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=193&group=comp.arch.fpga#193

  copy link   Newsgroups: comp.arch.fpga
X-Received: by 2002:ac8:564b:: with SMTP id 11mr12968816qtt.60.1625894400665; Fri, 09 Jul 2021 22:20:00 -0700 (PDT)
X-Received: by 2002:ac8:524c:: with SMTP id y12mr20310039qtn.39.1625894400553; Fri, 09 Jul 2021 22:20:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.arch.fpga
Date: Fri, 9 Jul 2021 22:20:00 -0700 (PDT)
In-Reply-To: <4cca29d1-37c8-4ad0-87c6-118e32ae3ce6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:3a90:cb30:b1dd:66cc:954e:bf12; posting-account=uXeJ4gkAAADS8JQB6S6LUjzELiulwQRn
NNTP-Posting-Host: 2600:1700:3a90:cb30:b1dd:66cc:954e:bf12
References: <4cca29d1-37c8-4ad0-87c6-118e32ae3ce6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5d5e60d1-4731-4bc2-9227-c779d4a676e4n@googlegroups.com>
Subject: Re: A state machine design problem
From: wtx...@gmail.com (Tianxiang Weng)
Injection-Date: Sat, 10 Jul 2021 05:20:00 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 84
 by: Tianxiang Weng - Sat, 10 Jul 2021 05:20 UTC

On Thursday, July 8, 2021 at 7:56:39 AM UTC-7, Tianxiang Weng wrote:
> Hi,
>
> I have the following VHDL code for a state machine:
>
> type Output_State_t is (
>
> State_a,
>
> State_b,
>
> State_c);
>
> signal Output_State, Output_State_NS : Output_State_t ;
>
> At a clocked process, there is code with the Output_State:
>
> p1: process(Clock, Reset)
>
> begin
>
> if Reset then
>
> Output_State <= State_a;
>
> else
>
> Output_State <= Output_State_NS ;
>
> end if;
>
> end process;
>
> There is a non-clocked process at which Output_State_NS is generated. There is an output enable signal:
>
> signal Output_Enable : std_logic; -- when it = '1', output is allowed, or not allowed if it = '0'.
>
> p2: process(all)
>
> begin
>
> ...
>
> A_O <= '0'; -- default values
>
> B_O <= '0';
>
> Output_State_NS <= Output_State;
>
> if Output_Enable = '1' then
>
> case Output_State is
>
> when State_a =>
> A_O <= '1';
>
> B_O <= '1';
>
> if Condition_A then
>
> Output_State_NS <= State_b;
>
> end if;
>
> when State\_b =>
> ...
>
> end case;
>
> end if;
> end process;
>
> on clock 1 both Output_Enable and Condition_A = '1', on clock 2, Output_Enable = '0'; In my ModelSim simulation the Output_State is at State_a, not at State_b on clock 2.
>
> Why is it not at State_b?
>
> Thank you.
>
> Weng

Hi,

I have found an error at another place and the listed code is right.

Weng

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor