The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Design Languages >> Verilog-AMS >> Interpreting input logic busses as signed integers https://designers-guide.org/forum/YaBB.pl?num=1242651957 Message started by Alexander Eßwein on May 18th, 2009, 6:05am |
Title: Interpreting input logic busses as signed integers Post by Alexander Eßwein on May 18th, 2009, 6:05am Hello, I am modelling the behaviour of a DCO after Staszewski in Verilog-AMS. As there are no integer type ports in Verilog, i have a bus of logic ports that i use to read the digital control word from. I would like this port to behave like a signed integer input, but it only interprets the input as unsigned. How can I make the input behave like it is a signed integer port? An example code of the DCO is attached. |
Title: Re: Interpreting input logic busses as signed integers Post by Peruzzi on May 20th, 2009, 12:38pm Hello Alexander, I am guessing that the Staszewski case you are following is one in which he used VHDL (non AMS) and thus was limited to integer and real ports to carry analog information. Since you are using Verilog-AMS you don't have that limitation. You can use wreal signals and ports to carry your signed integers. Hope this helps. Bob P. www.RPeruzzi.com |
Title: Re: Interpreting input logic busses as signed integers Post by jbdavid on Jun 1st, 2009, 5:53pm use the keyword "signed" on the wire where you declare it from 1364-2005 paragraph 12.3.3: Code:
if you used the signed keyword, the resulting integer will be treated just like a signed register. Code:
|
Title: Re: Interpreting input logic busses as signed integers Post by Alexander Eßwein on Jun 2nd, 2009, 4:04am Thank you Guys, that very much did the trick! |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |