This repository was archived by the owner on Dec 21, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMemoryLoadMask.v
More file actions
45 lines (45 loc) · 1.54 KB
/
Copy pathMemoryLoadMask.v
File metadata and controls
45 lines (45 loc) · 1.54 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 20:38:28 08/28/2017
// Design Name:
// Module Name: MemoryLoadMask
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module MemoryLoadMask(dataIn, maskLength, dataOut);
//-------------------------------------------Entradas-----------------------------------------//
input [31:0] dataIn;
// 0:Palabra completa 1:Media palabra 2:Byte
input [1:0] maskLength;
//--------------------------------------------Salidas-----------------------------------------//
output reg [31:0] dataOut;
//---------------------------------------------Wires------------------------------------------//
//-------------------------------------------Registros----------------------------------------//
//-----------------------------------------Inicializacion-------------------------------------//
initial begin
dataOut = 0;
end
//--------------------------------------Declaracion de Bloques--------------------------------//
//--------------------------------------------Logica------------------------------------------//
always @*
begin
case (maskLength)
0: dataOut <= dataIn;
1: dataOut <= dataIn&32'hFFFF;
2: dataOut <= dataIn&32'hFF;
default: dataOut <= dataIn;
endcase
end
endmodule