Converted address to 16-bit binary string rather than byte.
This commit is contained in:
@@ -8,13 +8,13 @@ namespace CPUSimulation
|
||||
static MC _memoryController;
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
_memoryController = new MC(8, 2048);
|
||||
for (int i = 0; i < 2049; i++)
|
||||
_memoryController = new MC(4, 32768);
|
||||
for (int i = 0; i < 32768; i++)
|
||||
{
|
||||
Word dataToWrite = GenerateRandomWord(_random.Next(1, 9));
|
||||
_memoryController.Write(i, dataToWrite);
|
||||
Word dataRead = _memoryController.Read(i);
|
||||
Console.WriteLine($"Data read from address {i}: {dataRead.ToString()}");
|
||||
Word dataToWrite = GenerateRandomWord(_random.Next(1, 5));
|
||||
_memoryController.Write((Int16)i, dataToWrite);
|
||||
Word dataRead = _memoryController.Read((Int16)i);
|
||||
Console.WriteLine($"Data read from address {new Address((Int16)i).ToString()}: {dataRead.ToString()}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user