Multiplication example

72 views
Skip to first unread message

Leonardo Romor

unread,
Oct 29, 2020, 11:19:35 AM10/29/20
to xls-dev
Hi, 

I just recently found this very interesting project.
I'm trying to build an optimal cubic bezier sampling pipeline in verilog hence my interest in this project.
 
I would be very happy to contribute but for now I only have very basic and silly questions.

I'm trying to slightly extend the quickstart example by making a multiplier of two 32 bit signed integers.
How would you do it considering that the output could be 64 bits wide?
Are the arithmetic operators always returning the same width as their inputs?

Best,

Leo

Chris Leary

unread,
Oct 29, 2020, 12:34:09 PM10/29/20
to Leonardo Romor, xls-dev
Hi Leonardo, welcome to the list! Thanks for posting.

My apologies for the documentation gap, we have `std::smul` and `std::umul` for the "full multiplication" signature (while the * operator is C-style giving you the same width result).


You can see example tests here:


We've been meaning to make a script that automatically generates stdlib documentation (markdown), but should have made manual documentation as a stopgap.

For the time being if you check out the stdlib.x, you can access all those functions like `std::umul` in the DSL.

Hope that helps, let me know if you run into any issues, and I'll be getting on some stdlib documentation solution post-haste. :-D

- Leary

--
You received this message because you are subscribed to the Google Groups "xls-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xls-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xls-dev/aad0b813-4b98-4a62-a380-8520069f08can%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages