// ********************************************************************** // LogicGates.h // // Definitions of functions that emulate elementary logic gates. // // ********************************************************************** // CS251 - Computer Organization // Spring 1997 // Dickinson College // Grant Braught // // ********************************************************************** // // NOTE: // It is possible to add multiple input logic gates too if they // are found to be helpful. However, the gates given below are // sufficient for completion of all of the projects. // #ifndef LOGICGATES #define LOGICGATES #include "Logic.h" Bool NOTgate (Bool X); // Logical NOT - !X Bool ANDgate (Bool X, Bool Y); // Logical AND - X && Y Bool NANDgate (Bool X, Bool Y); // Logical NAND - ! (X && Y) Bool ORgate (Bool X, Bool Y); // Logical OR - X || Y Bool NORgate (Bool X, Bool Y); // Logical NOR - ! (X || Y) Bool XORgate (Bool X, Bool Y); // Logical XOR - (X || Y) && !(X && Y) #endif