Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
7aa19ccf2This file is pinned to the selected release. Download the original to open it in your design tool.
import "primitives/core.fil";
import "./sequential.fil";
comp main<'G: 1>(
go: interface['G],
op: ['G+2, 'G+3] 1,
left: ['G, 'G+1] 32,
right: ['G, 'G+1] 32,
) -> ( out: ['G+2, 'G+3] 32)
{
A := new Add[32];
M := new FastMult[32];
m0 := M<'G>(left, right);
a0 := A<'G>(left, right);
// Use register to hold the adder's value
r0 := new Register[32]<'G, 'G+3>(a0.out);
// Use the multiplexer when the mult's output is ready
mx := new Mux[32]<'G+2>(op, r0.out, m0.out);
out = mx.out;
}