sim
Class RAM

java.lang.Object
  |
  +--sim.RAM
All Implemented Interfaces:
Memory

class RAM
extends java.lang.Object
implements Memory

Implements a simple, random-access memory


Field Summary
(package private)  byte[] data
           
 
Constructor Summary
RAM(int size)
           
 
Method Summary
 void doCycle()
           
 int getSize()
           
 void initialize()
          zero out memory.
 byte readByte(int address)
           
 int readWord(int address)
           
 java.lang.String toString()
           
 void writeByte(int address, byte value)
           
 void writeWord(int address, int value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

byte[] data
Constructor Detail

RAM

public RAM(int size)
Method Detail

doCycle

public void doCycle()
Specified by:
doCycle in interface Memory

getSize

public int getSize()
Specified by:
getSize in interface Memory

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

initialize

public void initialize()
zero out memory.

Specified by:
initialize in interface Memory

readWord

public int readWord(int address)
Specified by:
readWord in interface Memory

readByte

public byte readByte(int address)
Specified by:
readByte in interface Memory

writeWord

public void writeWord(int address,
                      int value)
Specified by:
writeWord in interface Memory

writeByte

public void writeByte(int address,
                      byte value)
Specified by:
writeByte in interface Memory