-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreg_32.sv
31 lines (26 loc) · 891 Bytes
/
reg_32.sv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module reg_16 ( input Clk, Reset, Load,
input [31:0] D,
output logic [31:0] Data_Out);
always_ff @ (posedge Clk or posedge Reset)
begin
// Setting the output Q[15..0] of the register to zeros as Reset is pressed
if(Reset)
Data_Out <= 16'b0000000000000000;
// Loading D into register when load button is pressed (will eiher be switches or result of sum)
else if(Load)
Data_Out <= D;
end
endmodule
module reg_1 ( input Clk, Reset, Load,
input D,
output logic Data_Out);
always_ff @ (posedge Clk or posedge Reset)
begin
// Setting the output Q[15..0] of the register to zeros as Reset is pressed
if(Reset)
Data_Out <= 1'b0;
// Loading D into register when load button is pressed (will eiher be switches or result of sum)
else if(Load)
Data_Out <= D;
end
endmodule