Question
Please write this program in C++ Requirements Create a function for each of the gate operations Use an enumeration to specify the type of gates
Please write this program in C++
Requirements Create a function for each of the gate operations
Use an enumeration to specify the type of gates
Each gate may have up to 8 user-inputs.
An input value is either 0 or 1. Value 0 implies false and value 1 implies true
For demonstration, your program tests each operation and shows all inputs and output.
Hints:
- enum GATE_TYPE { NOT, AND, OR, ...}
- const int MAX_INPUT = 8;
int input[MAX_INPUT];
Ex.
"Enter number of inputs: " ___________
cin >> input
- You may use either array or vector to store the list of inputs.
Write a C++ (or Java, etc.) menu-driven program that prompts the user to select the type of gate and determine the output for the given inputs (8 max inputs). Digital Logic Gates MAIN MENU ======= 1 - NOT gate 2- AND gate 3- OR gate 4 - NAND gate 5 - NOR gate 6- Half-adder 7 - Full-adder 8 - Exit HALF-ADDER Circuit Input/Output Table Q Carry Sum 1 1 0 1 OR Q AND Sum 1 0 NOT 0 1 0 1 0 1 AND Carry 0 0 0 0 FULL-ADDER Circuit OR half-adder #1 S Input/Output Table PQRc S 1 1 1 0 1 0 1 0 1 1 0 1 0 0 0 1 0 1 1 1 0 0 1 0 0 1 0 0 1 half-adder #2 S 0 1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started