Continue to Site

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.

why input cannot be used in case??

Status
Not open for further replies.

fahim1

Member level 4
Member level 4
Joined
Jun 4, 2015
Messages
75
Helped
2
Reputation
4
Reaction score
2
Trophy points
8
Visit site
Activity points
517
i want to use input in case but i have warning "Array type case expression must be of a locally static subtype."
how can i fix it?whats the soloution?
heres the code :
Code:
case mplr(1 downto 0)&'0' is
  when "000" =>  p1 := "00000000" ;
tnx
 

Why are you bothering adding that '0'???? That's simply redundant.

Code:
case mplr(1 downto 0) is
      when "00"=>...
 

i want to use input in case but i have warning "Array type case expression must be of a locally static subtype."
how can i fix it?whats the soloution?
heres the code :
Code:
case mplr(1 downto 0)&'0' is
  when "000" =>  p1 := "00000000" ;
tnx

Because you're not allowed - its an annoying quirt of vhdl. You need to make an intermediate signal:

my_intermediate <= mplr(1 downto 0) & '0';
case my_intermediate is...
 

Because you're not allowed - its an annoying quirt of vhdl. You need to make an intermediate signal:

my_intermediate <= mplr(1 downto 0) & '0';
case my_intermediate is...

That's still a waste of resources. (Which will probably be trimmed by the tool anyway).
 

its just part of code i have other parts
like
when "001"

if you did the code you describe:

case a(1 downto 0) & '0' is

when "001" =>

would be an impossible case - so it would be removed during compilation.
 

Because you're not allowed - its an annoying quirt of vhdl. You need to make an intermediate signal:

my_intermediate <= mplr(1 downto 0) & '0';
case my_intermediate is...

Is is better to use a variable as the intermediate value. It probably doesn't matter in a combinatorial process, but a signal will create a register and a delay in a clocked process.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top