FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CA-Cache-processor/src/hardware/Memory.java at master · Th3Hunger/CA-Cache-processor · GitHub
Th3Hunger
CA-Cache-processor
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
CA-Cache-processor
/
src
/
hardware
/
Memory.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
51 lines (38 loc) · 1 KB
Breadcrumbs
CA-Cache-processor
/
src
/
hardware
/
Memory.java
Copy path
File metadata and controls
51 lines (38 loc) · 1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
46
47
48
49
50
51
package
hardware
;
public
class
Memory
{
public
static
String
[]
data
=
new
String
[
4096
];
public
static
String
MemRead
=
"0"
;
public
static
String
MemWrite
=
"0"
;
public
Memory
() {
/*
* filling memory here with random values in case of pipe
*/
for
(
int
i
=
0
;
i
<
data
.
length
;
i
++) {
data
[
i
] =
"00000000000000000000000000011111"
;
}
}
public
static
String
Read
(
String
address
) {
int
decimal
=
Integer
.
parseInt
(
address
,
2
);
MemRead
=
"1"
;
if
(
MemRead
.
equalsIgnoreCase
(
"1"
)) {
System
.
out
.
print
(
data
[
decimal
] +
" "
);
}
System
.
out
.
println
(
"MemRead"
+
" "
+
MemRead
);
MemRead
=
"0"
;
return
data
[
decimal
];
}
public
static
void
write
(
String
address
,
String
info
) {
MemWrite
=
"1"
;
int
decimal
=
Integer
.
parseInt
(
address
,
2
);
if
(
MemWrite
.
equalsIgnoreCase
(
"1"
)) {
data
[
decimal
] =
info
;
}
System
.
out
.
println
(
"MemWrite"
+
" "
+
MemWrite
);
MemWrite
=
"0"
;
}
public
static
void
main
(
String
[]
args
) {
// Memory x = new Memory();
// x.write(1, 50);
// x.Read(1);
}
}
Back
|
FazBrowse Home
|
New Git URL