Continue to Site

Welcome to EDAboard.com

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.

Synthesizable modulo operator

Status
Not open for further replies.

promach

Advanced Member level 4
Joined
Feb 22, 2016
Messages
1,199
Helped
2
Reputation
4
Reaction score
5
Trophy points
1,318
Activity points
11,636
is modulo operator (%) supported (synthesizable) by Xilinx Vivado, Altera Quartus and yosys ?
 

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.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top