// ********************************************************************** // SysSpecs.h // // A set of defines that are used throughout many of the later projects. // These defined values dictate many of the specifications of the system. // The specs that are defined in this file include: // // Word Size of the Computer. // Little Endian or Bit Endian word storage // Number of Registers // Size of Main Memory // Memory Latency // // ********************************************************************** // CS251 - Computer Organization // Spring 1997 // Dickinson College // Grant Braught // // ********************************************************************** #ifndef SYSSPECS #define SYSSPECS // ***************** // Word Size // ***************** // // Define the number of bytes that are in a word. Any relevant sections of // code should check this location before creating their data structures. So // if the word size is changed here it should change the word size for the // whole computer. This should be valid up to 4 bytes or 32 bits - more than // that and the value of the word can no longer be held by an integer type. #define WORD_SIZE 2 // ***************** // Memory Size // ***************** // // The memory size of the computer. It is intentionally less than the // full address space of the comtpuer. This is so that a virtual memory // system can be experimented with. #define MEMORY_SIZE 4096 // ***************** // Memory Latency // ***************** // // Define the number of calls to the memory Evaluate function that are // required before the memory will return a value. This is sort of a // kludge to make memory access take longer than one machine cycle. // It's initial value of 5 will cause a memory access to take 5 // machine cycles. #define MEMORY_LATENCY 5 // ***************** // Registers // ***************** // // Define the number of registers that this machine will have. // Each register will be WORD_SIZE bytes wide. The number of registers // should always be a power of 2 for maximum efficiency. If more than 16 // registers are being used the Combinational logic circuits will need // to be modified & possibly the InfoTypes stuff too. #define NUM_REGISTERS 16 // ***************** // Word Format // ***************** // // Define whether the bytes in a word are stored in Little Endian or // Big Endian format. All relevant sections of code should look at this // define to determine how to handle words retrieved from memory. So if // we wanted to change the machine from LE to BE we would only have to // change it here. #define LITTLE_ENDIAN 0 #define BIG_ENDIAN 1 //#define ENDIAN LITTLE_ENDIAN // Comment out the one of these two lines #define ENDIAN BIG_ENDIAN // that does not apply. #endif