1
0
Fork 0
2023-fpga-computer/src/sap2/ir.v

23 lines
269 B
Coq
Raw Normal View History

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