aravind9
Newbie level 5
This is the Verilog HDL written for Round Robin Arbiter for two simple requests. When the req1 and req2 are high it should grant both requests in consecutive clock pulses, but this is not working when both requests are high. Please help me with this ASAP.
Code:
module round_robin_arbiter(
input clk,
input rst,
input req1,
input req2,
output reg gnt1,
output reg gnt2
);
reg temp;
always @(posedge clk or negedge rst)
begin
if(!rst)
begin
gnt1 <= 1'b0;
gnt2 <= 1'b0;
end
else if (req1)
begin
gnt1 <= 1'b1;
gnt2 <= 1'b0;
end
else if(req2)
begin
gnt2 <= 1'b1;
gnt1 <= 1'b0;
end
else if (req1 && req2)
begin
gnt1 <= 1'b1;
temp <= 1'b1;
gnt2 <= temp;
end
end
endmodule
Last edited by a moderator: