Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Unsupported error,& Right operand of "Divide" operator must be a power of 2..

 
Thread Tools Search this Thread
Old 02-29-2004, 04:14 PM   #1
Default Unsupported error,& Right operand of "Divide" operator must be a power of 2..


Hi,
I have a question concerning vhdl error.
I tried to solve the error but I am still in trouble.

My code's errors are as follows:
1st. Unsupported feature error: remainder[REM] operator
2nd. Right operand of "Divide" operator must be a power of 2


1st error was solved when I replace rem to another operator, but I
don't know what's wrong with my syntax about "rem".
2nd error... I couldn't understand where the error lied.



My code is as follows:

LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;

ENTITY test_core_8254_3th IS
PORT (
CLK : IN std_logic ;
D : Buffer integer range 0 to 255;
PA, PB : OUT std_logic
);
END test_core_8254_3th;

ARCHITECTURE arc OF test_core_8254_3th IS
BEGIN
process(CLK,D)
variable cnt: integer:= 0;
begin
if (CLK' event and CLK = '1') then
cnt:= cnt+1;
if (D rem 2)=0 then
if (cnt<=(10000/(D/2))/4) then
PA<='1';
PB<='0';
else
PA<='Z';
PB<='Z';
cnt:=0;
end if;
end if;
end if;
end process;
END arc;



How can I resolve my problem?

I would appreciate any helpful hint.
(and I'm sorry for my poor English... ^^


Kind regards
KIM JM.


Kim JM
  Reply With Quote
Old 04-02-2004, 07:58 PM   #2
Riyaz
 
Posts: n/a
Default Re: Unsupported error,& Right operand of "Divide" operator must be a power of 2..
Is the error you receive from a synthesis tool or a simulation tool. I
believe it is from a synthesis tool in which case you will probably have to
instantiate dividers to sort the problem. Try to think about how the design
is going to be implemented in hardware, although it can be very easy to get
carried away using procedural constructs. Maybe a very good synthesis tool
can derive some hardware from that but it is generally more efficient if you
spend some time trying to derive a hardware structure than to write C-type
language in VHDL (this latter case can sometimes work mind but can result in
larger and slower hardware)
"Galland" <> wrote in message news:SC39c.783$...
> > if (D rem 2)=0 then
> > if (cnt<=(10000/(D/2))/4) then

>
> Hi, first you must understand that modelling hardware through a

description
> language
> is not like writing software, in your code the division is only done if it
> is divided by a multiple of 2 but the code is synthesized as a hardware

that
> does the division (10000/(D/2)) whichever D it is, it cannot be

"activated"
> if D is multiple of 2 and deactivated to ensure correct operation if it is
> not. In hardware (though i might be wrong here) it would be implemented as

a
> division that executes always but only gets to cnt (through a multiplexor)
> if (D rem 2) is 0. This is hardware description, not software description,
> though practice and trial-and-error heals anybody .
>
> Galland
>
>
>
>





Riyaz
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
reporting power with dc_shell perseo Hardware 0 10-11-2007 09:01 AM
Power Supply vs. Motherboard smackedass A+ Certification 48 03-01-2007 07:35 AM
Judge: File-swapping tools are legal Citizen Bob DVD Video 140 11-08-2006 06:42 PM
Old PC Occasionally Won't Start, Doesn't Power Down all the time mr x A+ Certification 4 02-26-2004 04:50 AM
Power Supply Requirements Joe A+ Certification 1 12-20-2003 06:13 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46