Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Problem with my counter

Reply
Thread Tools

Problem with my counter

 
 
twinkle twinkle is offline
Junior Member
Join Date: Feb 2009
Posts: 3
 
      02-09-2009
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use work.poly_pack.all;

entity DeMUX is
port(clk, rst : in std_logic;
input : in std_logic_vector(INPUT_WIDTH-1 downto 0);
out1_dmux : out std_logic_vector(INPUT_WIDTH-1 downto 0);
out2_dmux : out std_logic_vector(INPUT_WIDTH-1 downto 0)
);
end DeMUX;

architecture behavior of DeMUX is
signal sel : std_logic;
begin

process(sel,input)
begin

case sel is
when '1'=>
out1_dmux <= input;
out2_dmux <= "00000000";

when '0' =>
out2_dmux <= input;
out1_dmux <= "00000000";

when others =>
out1_dmux <= "00000000";
out1_dmux <= "00000000";
end case;

end process;


process (clk, rst)
begin
if (rst = '0') THEN
sel <= '1';
else
if (clk'event and clk = '1')then
sel <= sel + 1;
end if;
end if;
end process;
end behavior;

I get the following two errors when am incrementing my 'sel'. i.e., the problem is shown in sel <= sel+1. Please some one help me in resolving this problem.

Errors shown:

No feasible entries for infix operator "+"
Type error resolving infix expression "+" as type ieee.std_logic_1164.std_logic

Thanking you!!


/Twinkle
 

Last edited by twinkle; 02-09-2009 at 01:51 PM..
Reply With Quote
 
 
 
 
eliascm eliascm is offline
Member
Join Date: Jan 2009
Posts: 42
 
      02-11-2009
sel is type std_logic so "sel + 1" is not defined. You could use "sel <= not sel" to alternate the state of sel (you should first set sel to a default state of '1' or '0' since "not sel" will not work for the other possible states of sel.
 
Reply With Quote
 
 
 
 
twinkle twinkle is offline
Junior Member
Join Date: Feb 2009
Posts: 3
 
      02-12-2009
Yaa now I realize the mistake...Thank you very much!!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page File counter and Private Bytes Counter George2 C++ 1 01-31-2008 09:27 AM
Performance Counter Update problem in ASP.Net application jvn ASP .Net 1 11-24-2006 09:20 AM
Hit-Counter Problem Colin Computer Support 1 04-29-2005 03:18 AM
Session("counter") vs. ViewState("counter")...a newbie question The Eeediot ASP .Net 3 12-22-2004 09:31 PM
ShinyStat counter problem, why? Adriano Computer Information 0 12-08-2004 10:32 AM



Advertisments