aboutsummaryrefslogtreecommitdiff
path: root/MicSim/components/ram.py
diff options
context:
space:
mode:
Diffstat (limited to 'MicSim/components/ram.py')
-rw-r--r--MicSim/components/ram.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/MicSim/components/ram.py b/MicSim/components/ram.py
index 62edb0c..a0f708e 100644
--- a/MicSim/components/ram.py
+++ b/MicSim/components/ram.py
@@ -69,7 +69,7 @@ class Ram:
try:
value=self.data[addr]
except:
- if addr>self.lastAddr:
+ if addr>self.lastAddr or addr<0:
raise ValueError("You get out of the ram by trying to get value at address {}, max address is {}".format(addr,self.lastAddr))
if(value==None):
return(0)