Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
import "primitives/core.fil";
comp Mult[#W]<G: 2>(
@interface[G] go_G: 1,
@[G, G+1] left: #W,
@[G, G+1] right: #W,
) -> (
@[G+2, G+3] out: #W
) where #W > 0 {
ll := new Register[#W]<G, G+3>(left);
lr := new Register[#W]<G, G+3>(right);
m := new MultComb[#W]<G+2>(ll.out, lr.out);
out = m.out;
}
/// ANCHOR: fastmult
/// Implementation of a multiplier with initiation interval 1 and latency 3
comp FastMult[#W]<G: 1>(
@interface[G] go_G: 1,
@[G, G+1] left: #W,
@[G, G+1] right: #W,
) -> (
@[G+3, G+4] out: #W,
) where #W > 0
/// ANCHOR_END: fastmult
{
// First stage, register the inputs
l := new Register[#W]<G, G+2>(left);
r := new Register[#W]<G, G+2>(right);
// Second stage, perform the computation and save it
m := new MultComb[#W]<G+1>(l.out, r.out);
ot := new Register[#W]<G+1, G+3>(m.out);
// Third stage, forward the value from temp out to out register
final := new Register[#W]<G+2, G+4>(ot.out);
// Connect the output to the out register
out = final.out;
}
cdff47fcaThis file is pinned to the selected release. Download the original to open it in your design tool.