• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. analog digital output average mean value

Stats

  • Locked Locked
  • Replies 21
  • Subscribers 126
  • Views 17931
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

analog digital output average mean value

abdurrahman0234
abdurrahman0234 over 3 years ago

Hello,

I have 4 bit analog digital output. By averaging output, I can not precise result because tools take analog signal. and since analog signal have changes since temperature and little edge distortions, tool dont give me precise average mean value. I want to take precise average value without using verilogA model. How can I achieve this? 

   

  • Cancel
Parents
  • abdurrahman0234
    abdurrahman0234 over 3 years ago

    helllo,

    Hello,

    I have 4 bit analog digital output. By averaging output, I can not precise result because tools take analog signal. and since analog signal have changes since temperature and little edge distortions, tool dont give me precise average mean value. I want to take precise average value without using verilogA model. How can I achieve this?

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • abdurrahman0234
    abdurrahman0234 over 3 years ago in reply to abdurrahman0234

    sorry, I attached right figure as seeen in the below

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • abdurrahman0234
    abdurrahman0234 over 3 years ago in reply to Andrew Beckett

    Thank you andrew.

    How Can I set the new cont. option set??Also, I can get  digital decimal values as seen in the figure for average? I think that signed decimals bits which I converted, cadence tool get  as a analog signal?Is it right? 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • abdurrahman0234
    abdurrahman0234 over 3 years ago in reply to abdurrahman0234

    How Can I set the new cont. option set?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to abdurrahman0234

    Your last two questions are slightly garbled so I'm not entirely sure what you mean. If you have a waveform such as the red-pink signal you showed in a graph before, that is suitable for feeding to the average function, although as I said you'd probably want to sample it first to ensure you only have one point per period, and then use average with ?continuous "no" - which can be chosen from the calculator (assuming you're using a recent enough version):

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 3 years ago in reply to Andrew Beckett

    Dear abdurrahman0234,

    I was about to respond to "attempt" to save Andrew some time, when as usual, Andrew responded sooner than I could! To expand on his response, Figures1 and 2 show the Calculator expressions that are invoked when the ?continuous argument is set to "no" and "yes" respectively. This is further detailed in the Help GUI for the average function. From the Help GUI, the definitions for the two ?continuous argument is shown in Figure 3.

    Shawn

    Figure 1

    Figure 2

    Figure 3

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • abdurrahman0234
    abdurrahman0234 over 3 years ago in reply to ShawnLogan

    I experienced this, tool can not be y axis values precisely, especially at the edges. Have a another way to get average for 4 bit analog output?

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to abdurrahman0234
    abdurrahman0234 said:
    I experienced this, tool can not be y axis values precisely, especially at the edges. Have a another way to get average for 4 bit analog output?

    I have no idea what you're saying here. We've given you a way of getting the average, but I don't know what you mean by "tool can not be y axis value precisely" (I recognise that English is not your first language, but this statement doesn't mean anything). What is wrong with the method we have suggested?

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • abdurrahman0234
    abdurrahman0234 over 3 years ago in reply to Andrew Beckett

    I apologize Andrew,

    for example digital analog value '840 mv' for  +1 bit, cadence takes it as a 838 mV so average value is calculated wrongly. (Average is fluctuated) 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to abdurrahman0234
    abdurrahman0234 said:
    for example digital analog value '840 mv' for  +1 bit, cadence takes it as a 838 mV so average value is calculated wrongly. (Average is fluctuated) 

    OK, how did you generate the analog signal? You've given no information on how the red/pink waveform was generated.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • abdurrahman0234
    abdurrahman0234 over 3 years ago in reply to Andrew Beckett

    it is 4 bit analog output signal at the digital circuit (out <3:0>). For example it seen like '-2 1 0 1 3' when I converted to decimal.(analog to digital)When taking average, seen as a analog signal

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to abdurrahman0234

    Details are very important here. How exactly did you convert  this 4 bit digital output to an analog signal? You mention that it should be 840mV - but without knowing what expression you used or method you used to do the conversion from the digital bus to an analog value, it's impossible to know if this is something you've done incorrectly or whether there is a bug in the tool (I would be very surprised if a properly set up conversion could make that magnitude of error).

    So please explain exactly how you did this. Knowing the precise Virtuoso version might be important too (Help->About in any Virtuoso window will tell you the sub-version).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to abdurrahman0234

    Details are very important here. How exactly did you convert  this 4 bit digital output to an analog signal? You mention that it should be 840mV - but without knowing what expression you used or method you used to do the conversion from the digital bus to an analog value, it's impossible to know if this is something you've done incorrectly or whether there is a bug in the tool (I would be very surprised if a properly set up conversion could make that magnitude of error).

    So please explain exactly how you did this. Knowing the precise Virtuoso version might be important too (Help->About in any Virtuoso window will tell you the sub-version).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • abdurrahman0234
    abdurrahman0234 over 3 years ago in reply to Andrew Beckett

    Firslty, I have a output 4 analog bits. Then, I converted analog bits to decimal (analog to digital converter) from measurement, and send it to calculator or use analog to digital converter function in the calculator. Then,  While getting average, tools take analog signal so I can not calculate average rightly. Or please can help me about signed 4 bit analog to digital converter(integer) verllogA code,please. I find codes from the google are not correct

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to abdurrahman0234

    Even though you still haven't answered my questions, I spent a few minutes putting together an example (the yellow dots are showing the symbol locations in my digital to analog output using the measurement):

    I then realised that your "analog" waveform has got glitches in it, so cannot possibly have been generated by the d2a in the calculator.

    So unless you can explain how you got the waveform that you are trying to sample/average (with ?continuous nil), there's little I can do to. help. So far you've been so vague that it's impossible to help.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • abdurrahman0234
    abdurrahman0234 over 3 years ago in reply to Andrew Beckett

    Thank you Andrew for ur help

    I converted analog signal to digital. I converted analog signal to integer in the calculator. Then I clipped signal over one sample period range and take average of result(f=400Mhz). Also,I tried with sampling analog signal but still calculator sometimes can not take y values precisely (especially clock edges). Y values sometimes fluctuates about 7-8mV  

    average(clip(analog2Digital(leafValue( VT("/Y<3:0>") "bit" "/Y<0>" "X" 0.84 )  "center" ?vCenter 420m) +  analog2Digital(leafValue( VT("/Y<3:0>") "bit" "/Y<1>" "X" 0.84 )  "center" ?vCenter 420m)*2 + analog2Digital(leafValue( VT("/Y<3:0>") "bit" "/Y<2>" "X" 0.84 )  "center" ?vCenter 420m)*4 + analog2Digital(leafValue( VT("/Y<3:0>") "bit" "/Y<3>" "X" 0.84 )  "center" ?vCenter 420m) *-8 5n 1.33u ))

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to abdurrahman0234

    OK, you didn't make it clear you had an analog bus with noisy values - the very first post had a bus at the top, so I assumed you wanted to do a d2a of the bus and then average the values. You have a noisy/glitchy bus, and so you should be able to do analog2Digital like you have (bearing in mind that as soon as you start adding the analog2Digital waveforms together or multiplying by some number, they will convert back to 0 to 5V analog value (so you may need to scale the overall result back down again). The conversion to digital should remove the glitchiness, and then you can either do a conventional average (since it will be nicely discrete) or you can sample and then use the average with ?continuous nil that we mentioned earlier.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • abdurrahman0234
    abdurrahman0234 over 3 years ago in reply to Andrew Beckett

    I have done all of them(a2d,sample, value function) but I think that tool take analog signal

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 3 years ago in reply to abdurrahman0234

    Dear abdurrahman0234,

    As did Andrew, I tried an example of the operations you were intending and found the following:

    1. I sampled an analog clock waveform asynchronously between 15 ns and 16 ns (i.e. sample points were at a frequency that is not the same frequency as the frequency of the clock waveform) and applied the analog2digital() calculator function using the following expression:

    analog2Digital(sample(clip(v("/clk_p" ?result "tran") 15n 16n) 15n 16n "linear" 1e-12 ) "hilo" ?vHigh 0.60 ?vLow 0.20 ?timeX 1e-12)

    2. I also sampled the same analog clock waveform synchronously using two samples per period of the analog clock waveform period as detailed in the Calculator expression:

    analog2Digital(sample(clip(v("/clk_p" ?result "tran") 15n 16n) 15n 16n "linear" 1e-12 ) "hilo" ?vHigh 0.60 ?vLow 0.20 ?timeX 0.50/frequency(clip(v("/clk_p" ?result "tran") 15n 16n) ))

    3. I plotted the analog clock waveform between 15 ns and 16 ns as well as the two versions of the outputs of the analog2Digital() function expressions in Figure 1. Note that the expression shown in [1] above has a number of "X" values since the sampling times occasionally occur where the analog waveform is between the 600 mV and 200 mV values defined as logic high and low values respectively. However, the samples of the synchronously sampled waveform after the analog2Digital() expression in [2] has no "X' values as all samples are either above 600 mV or below 200 mV.

    The values for the three waveforms were exported to a table in order that you may see the unknowns in the asynchronously sampled waveform in Figure 2.

    4. In its current state, it appears the average() function with the ?continuous argument set to nil (i.e., "no" in the function panel) does not provide its expected value when its waveform argument is digital. The average() function without the ?continuous argument set to nil does accept a digital waveform. However, in your case, you do not want the average value as defined by a continuous integral overaged over the waveform's x-axis values. Hence, I did the following:

    i. I converted the digital waveform to an analog waveform with analog logic high and low set to 1.0 V and 0.0 V respectively and the "X" value set to the average value of the logic high and logic low. This is the full expression:

    awvDigital2Analog(analog2Digital(sample(clip(v("/clk_p" ?result "tran") 15n 16n) 15n 16n "linear" 0.50/frequency(clip(v("/clk_p" ?result "tran") 15n 16n) )) "hilo" ?vHigh 0.60 ?vLow 0.20 ?timeX 0.50/frequency(clip(v("/clk_p" ?result "tran") 15n 16n) )) 1.0 0.0 "(vhi + vlo)/2.0")

    I plotted the waveform and its digital version:

    analog2Digital(sample(clip(v("/clk_p" ?result "tran") 15n 16n) 15n 16n "linear" 0.50/frequency(clip(v("/clk_p" ?result "tran") 15n 16n) )) "hilo" ?vHigh 0.60 ?vLow 0.20 ?timeX 0.50/frequency(clip(v("/clk_p" ?result "tran") 15n 16n) ))

    and show the result in Figure 4.

    The values of the two waveforms are shown in the Table in Figure 5.

    ii. If I now take the average() function with the ?continuous argument set to nil:

    average(awvDigital2Analog(analog2Digital(sample(clip(v("/clk_p" ?result "tran") 15n 16n) 15n 16n "linear" 0.50/frequency(clip(v("/clk_p" ?result "tran") 15n 16n) )) "hilo" ?vHigh 0.60 ?vLow 0.20 ?timeX 0.50/frequency(clip(v("/clk_p" ?result "tran") 15n 16n) )) 1.0 0.0 "(vhi + vlo)/2.0") ?continuous nil )

    the result is a value of 506.8E-3. If I take the average() function without the ?continuous argument:

    average(awvDigital2Analog(analog2Digital(sample(clip(v("/clk_p" ?result "tran") 15n 16n) 15n 16n "linear" 0.50/frequency(clip(v("/clk_p" ?result "tran") 15n 16n) )) "hilo" ?vHigh 0.60 ?vLow 0.20 ?timeX 0.50/frequency(clip(v("/clk_p" ?result "tran") 15n 16n) )) 1.0 0.0 "(vhi + vlo)/2.0") )

    is also 500.0E-3.

    Without the awvDigital2Analog() function, the expression:

    provides a value of 2.500.

    Hence, I would suggest to obtain your desired average, which requires the ?continuous argument set to nil, you convert your waveform back to a analog waveform using the awvDigital2Analog() function. There are additional arguments to the function with a description at the Cadence On-line support site URL:

    support.cadence.com/.../techpubDocViewerPage

    I hope this helps abdurrahman0234!

    Shawn

    Figure 1

    ViVA Waveforms of Analog Waveform and its Asynchronously and Synchronously Sampled Waveforms after Analog to Digital Conversion

    Figure 2

    Tabular Values of Analog Waveform and its Asynchronously and Synchronously Sampled Waveforms after Analog to Digital Conversion

    Figure 3

    Analog Waveform (top trace) created from digital waveform (lower trace) using awvDigital2Analog() Function

    Figure 4

    Exported Values of Analog and Digital Versions of Waveforms in Figure 3

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to ShawnLogan

    A small add-on note to Shawn's suggestions, rather than calling the calculator function to convert the digital signal back to analog, you could just do:

    analog2Digital(v("v0" ?result "tran-tran")  "center" ?vCenter 0.5)/5

    (using whatever values you were using for analog2Digital for example) - when a digital value is in an arithmetic expression it will automatically be converted to "analog" and be between 0 and 5V, so dividing it by 5 both converts it to analog and divides by 5, meaning you'll have an analog waveform between 0 and 1. It would also be simpler (if adding multiples of the "analog" digital signals) to do your summing of each scaled bits to do the sample() after you've added them all up (the expression will be simpler).

    Also, if the 4 bit number is signed, you can't just add the powers of each bit - you'll need to take that into account when doing the conversion. Maybe that (or the scale factor of 5) was what the original poster did wrong?

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ShawnLogan
    ShawnLogan over 3 years ago in reply to Andrew Beckett

    Dear Andrew,

    Thank you for taking the time to read my response to abdurrhaman0234! A very nice  idea! I do recall the type conversion, but did not think of it for some reason!

    Thank you, again!

    Shawn

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information