Created
May 16, 2013 06:03
-
-
Save uiur/5589692 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RegisterFile (Read1, Read2, Write, RegWrite, WriteData, Data1, Data2); | |
input [2:0] Read1, Read2, Write; | |
input [15:0] WriteData; | |
input RegWrite; | |
output [15:0] Data1, Data2; | |
reg [15:0] RegFile [0:7]; | |
assign Data1 = RegFile[Read1]; | |
assign Data2 = RegFile[Read2]; | |
always @(posedge RegWrite) begin | |
if (RegWrite) begin | |
RegFile[Write] = WriteData; | |
end | |
end | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment