Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Construct synthesis problem

Reply
Thread Tools

Construct synthesis problem

 
 
Kuan Zhou
Guest
Posts: n/a
 
      04-22-2005
Hi,

I read a piece of code as follows:

.....
port(a,b: IN integer; c: OUT integer);
.....

Architecture error_arch2 of math_test IS
Begin
c <= a/5;
.....

The error message for c<=a/5 in the synthesis is: The second operand
must be a power of two.

Can anybody explain it to me?


Kuan
 
Reply With Quote
 
 
 
 
Lars Wehmeyer
Guest
Posts: n/a
 
      04-22-2005
Kuan Zhou wrote:
> The error message for c<=a/5 in the synthesis is: The second operand
> must be a power of two.


Just a guess: your synthesis library does not support division units.
Therefore, the / operator can only be used to mean right shift,
which implies a power of two as second operand.

HTH

Lars

 
Reply With Quote
 
 
 
 
Mohammed A khader
Guest
Posts: n/a
 
      04-22-2005
HI Kuan,

One Arithmetic right shift is equal to ' divide by 2 '. Lets take an
example Suppose you have a 5 bit of std_logic_vector as
vec = "00110". hence it represents 6 . If you right shift the vec
once then it becomes "00011" . which represents 3. That mean Shifting
right by one time is equal to dividing by 2. Similarly Shifting Left by
1 time is equal to multiply by 2 .

Suppose if you write c <= a/4 , then what it does is just right
shift by 2 times.

I assume you know the difference between airthmetic shift and logical
shift. If not you refer to some good arithmetic book to find the
difference.

 
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
Behavior of if construct in switch case defualt construct. Mukesh C Programming 4 03-26-2010 12:38 PM
a big Problem: construct a software 月夕 C++ 0 07-07-2009 04:58 AM
Problem using \G in look-behind Construct in Regular Expression (Ruby 1.9) Wolfgang Nádasi-Donner Ruby 10 06-30-2006 04:39 PM
SOS! newbie question about synthesizable VHDL : synthesis run successfully but post-synthesis failed... walala VHDL 4 09-09-2003 08:41 AM
what are the possible reasons that successful pre-synthesis simulation + successful synthesis = failed post-synthes walala VHDL 4 09-08-2003 01:51 PM



Advertisments
 



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 47 48 49 50 51 52 53 54 55 56 57