Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Accumulator (
- input logic clk,
- input logic direction,
- input logic [15:0] increment,
- output logic [15:0] result
- );
- logic [15:0] next;
- always_comb begin
- if (direction)
- next = result + increment;
- else
- next = result - increment;
- end
- always_ff @(posedge clk)
- result <= next;
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement