nand2/07_Operating_System/00_HACK/Bit.v
Michael Schröder 971b323822 added v2.0
2023-01-11 23:04:57 +01:00

20 lines
276 B
Verilog

/**
* 1-bit register:
* If load[t] == 1 then out[t+1] = in[t]
* else out does not change (out[t+1] = out[t])
*/
`default_nettype none
module Bit(
input clk,
input in,
input load,
output out
);
reg out = 0;
always @(posedge clk)
out <= load?in:out;
endmodule