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.
For constant powers of 2 then usually yes.
For non-powers of two, or non constants, then I think Quartus supports it, Xilinx probably not. But even if it is supported the circuit created will be very slow.
Non power-of-two modulo is implemented as parallel divider. Quartus supports it at least for integer signals. How much logic cells is consumes and how slow it is depends of course on the operand size.
Although we usually try to replace dividers by other constructs, it may be required for some designs.
If speed isn't important, it is very simple and compact to do modulo with a state machine, but that will never be generated automatically from the modulo operator. You have to write the state machine yourself, or "borrow" code from someone.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.