C
Chris Hinsley
Guest
This might just not be possible, but I'll ask before spending ages
trying to get it working.
I have a multiply I did myself that works fine, but takes a fair
ammount of resources, and has a latency of several cycles. I can feed
it new inputs each clock though.
I'd like to use the FPGA's internal multiply blocks to get the mul done
to save resource, but I don't know if you can use the * operator in a
way that will let me put in a simple bit of behavoural code to express
a pipelined version of the mul ?
I hope you see what I'm getting at.
I'd like to say 'put me in this mul, but know that it wil take 2 cycles
for the result to appear.'
My first thought was maybe do somthing like this, with the results
getting written every other cycle sort of thing ? As useual advise
gratefuly recieved.
always @(posedge clk)
begin
reg [1:0] cnt;
cnt <= cnt + 1;
if (cnt[1])
outa = ina * inb;
else
outb = inc * ind;
end
Chris
trying to get it working.
I have a multiply I did myself that works fine, but takes a fair
ammount of resources, and has a latency of several cycles. I can feed
it new inputs each clock though.
I'd like to use the FPGA's internal multiply blocks to get the mul done
to save resource, but I don't know if you can use the * operator in a
way that will let me put in a simple bit of behavoural code to express
a pipelined version of the mul ?
I hope you see what I'm getting at.
I'd like to say 'put me in this mul, but know that it wil take 2 cycles
for the result to appear.'
My first thought was maybe do somthing like this, with the results
getting written every other cycle sort of thing ? As useual advise
gratefuly recieved.
always @(posedge clk)
begin
reg [1:0] cnt;
cnt <= cnt + 1;
if (cnt[1])
outa = ina * inb;
else
outb = inc * ind;
end
Chris