-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInsMem.v
More file actions
39 lines (34 loc) · 1002 Bytes
/
InsMem.v
File metadata and controls
39 lines (34 loc) · 1002 Bytes
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
module InstructionMem
(
input [63:0] Addr,
output wire [31:0] Instr
);
integer i,j,k;
reg[31:0] TempI;
reg [7:0] mem[15:0];
always@(Addr)
begin
mem[0] = 8'b00000000;
mem[1] = 8'b00000000;
mem[2] = 8'b00000000;
mem[3] = 8'b00110011;
mem[4] = 8'b00000010;
mem[5] = 8'b00110000;
mem[6] = 8'b00000001;
mem[7] = 8'b00010011;
mem[8] = 8'b00000000;
mem[9] = 8'b00110001;
mem[10] = 8'b00000000;
mem[11] = 8'b10110011;
mem[12] = 8'b00100011;
mem[13] = 8'b00111000;
mem[14] = 8'b10010101;
mem[15] = 8'b00001110;
i=Addr;
j=Addr+3;
TempI = mem[i];
for(k=i; k<=j;k=k+1)
TempI= (TempI << 8) | mem[k];
end
assign Instr=TempI;
endmodule