• 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 SKILL
  3. How can I express exponents like as 2^4 or pow(2, 4) in...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 143
  • Views 4408
  • 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

How can I express exponents like as 2^4 or pow(2, 4) in Ocean script ?

ichiro
ichiro over 4 years ago

Hi,

As I mentioned in title, I'd like to know how to express exponent in Ocean script.

best regards,

ichiro

  • Cancel
  • ichiro
    ichiro over 4 years ago

    I have 16 lines bit that has 0 or 1.

    Expected code is like below.

    for( i 0 16 then

         buf = buf + bit[i]*2^i

    )

    sprintf(get "%x" buf)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • ichiro
    ichiro over 4 years ago in reply to ichiro

    I got "2**i" 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 4 years ago in reply to ichiro

    You can do:

    2**i
    expt(2 i) ; this is exactly what 2**I does - it's the functional equivalent
    pow(2 i)
    1<<i ; This does a binary left shift by I places - so only works if I<31 (if 31 you get a negative answer because integers are signed 32-bit integers in SKILL

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • ichiro
    ichiro over 4 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks a lot for info to understand cadence tools/skills every time.

    Ichiro

    • 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