BASIC Logic Gates - 16 Bit
AND, OR, NOT, NAND, NOR, XOR and XNOR are Basic Logic Gates. We will see how we can easily implement 16 bit array of logic gates in very simple manner.
Supplies
Any calculator(HW or SW) capable of performing 16 bits of logical operations.
Any Intel MCS-51 Single Board Computer running BASIC-52
Input and Output Format
The system can take 16 bit data in either DECIMAL or HEXADECIMAL format. In decimal the number ranges from 0 to 65535 both included. We can just enter the number.
For Hexadecimal numbers the number always ends with "h" or "H" to denote the entry is Hexadecimal. Apart from this we need to enter a "0" if the hexadecimal starts with any of a Alphabet between A~F.
The program prints the output value of the resulted logic operation in hexadecimal. The user can easily change the output format using PH0. to suppress the trailing zero in hexadecimal format or just add or change to "PRINT" for default decimal format.
It is much easier to enter in hexadecimal and get the output in hexadecimal. This will be easy to understand.
AND Gate
The system prompts the user to enter the input A and B. The output is Y.
User can enter Decimal number between 0 to 65535 for both input A and input B. The system computes the ANDed output and print in hexadecimal format.