1
0
Fork 0
2023-fpga-computer/src/sap1/reg_b.v

23 lines
264 B
Coq
Raw Normal View History

2023-01-04 02:26:45 +00:00
module reg_b(
input clk,
input rst,
2023-01-04 02:26:45 +00:00
input load,
input[7:0] bus,
output[7:0] out
);
2023-01-04 02:26:45 +00:00
reg[7:0] reg_b;
2023-01-04 02:26:45 +00:00
always @(posedge clk, posedge rst) begin
if (rst) begin
reg_b <= 8'b0;
end else if (load) begin
2023-01-04 02:26:45 +00:00
reg_b <= bus;
end
end
assign out = reg_b;
2023-01-04 02:26:45 +00:00
endmodule