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.

sine and cos in veilog

Status
Not open for further replies.

FARAH F MIRZA

Newbie level 5
Joined
Apr 4, 2010
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
PAKISTAN
Activity points
1,338
this code was implemented well on modelsim but how to do it on xilinx ise .... i maen the decimal point numbers handling ....

Code:
 xa=ang+1.570796325;
              
                asign = 1.0;
        
                  xa1 = xa;
                if (xa1<0)
                  begin
                    xa1 = -xa1;
                    asign = -1.0;
                  end
                while (xa1 > 3.14159265/2.0)
                  begin
                    xa1 = xa1 - 3.14159265;
                    asign = -1.0*asign;
                  end  
                ya = xa1*2/3.14159265;
                ya2 = ya*ya;
                ya3 = ya*ya2;
                ya5 = ya3*ya2;
                ya7 = ya5*ya2;
                asum = 1.570794*ya - 0.645962*ya3 +
                       0.079692*ya5 - 0.004681712*ya7;
                asin = asign*asum;
 

Hi,

You have to consider using fixed point implementation (or floating point implementation) to handle the decimal number with points in your initial Verilog code to make it synthesizable by the synthesis tool (such as ISE). Consider this tutorial: https://docs.google.com/viewer?a=v&q=cache:0Ip7lRMh0N4J:www.cs.washington.edu/education/courses/cse467/08au/pdfs/lectures/11-FixedPointArithmetic.pdf+&hl=en&pid=bl&srcid=ADGEESheHWE_nZKBETmGfGtIThAn_hypGYvDUInrqiKCIKHWrxyfUtTWpgRfeYD4aC9elu8SKR27OiCgI-WqPPan7CTgAgvAuvnpBtqHXRhUqXJS1TW61xXS7U8iFLoVmpCQ6g88K6Mb&sig=AHIEtbQOtR3HGXDmFqeOVRF0xs3aufNwiQ

You can google for more tutorial.

Thanks.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top