EmbDev.net

Forum: FPGA, VHDL & Verilog / operand can not have such operands in this context


Author: dhootha adhi (Company: Student) (gollum)
Posted on:

Rate this post
0 useful
not useful
I am using the following libraries
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use ieee.numeric_std.all;
library ieee_proposed;
use ieee_proposed.fixed_float_types.all;
use ieee_proposed.fixed_pkg.all;
I get this error"/ cannot have such operands in this context" at line 
where variable c is assigned in the following code when i checked the 
syntax
I have got this error at all places where the / operator is used in 
fixed point operations.
type comp is 
  record
    Rel :sfixed(7 downto -6);
    Img :sfixed(7 downto -6);
  end record;

function complexdiv(seven :comp; h :sfixed(7 downto -6)) return comp is
variable result5 :comp;
variable a,b,c,d :sfixed(14 downto -13) ;
begin
  c :=seven.Rel / h;
   
  --result5.Rel := resize(d,result5.Rel) ;
  --result5.Img := resize(seven.Img/h,result5.Img) ;
return result5;
end complexdiv;

What might be the problem??

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
dhootha adhi wrote:
> I get this error "/ cannot have such operands in this context"
From who: simulator or synthesizer? Which one?

Author: dhootha adhi (Company: Student) (gollum)
Posted on:

Rate this post
0 useful
not useful
synthesizer

Author: Lothar Miller (lkmiller) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Division is not synthesizable!

Ok, it is synthesizable if the divisor is a constant and a power of 2.
Your h is none of them...

Author: dhootha adhi (Company: Student) (gollum)
Posted on:

Rate this post
0 useful
not useful
okay.Thanks a lot

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.