Question: 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



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
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
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 P 1 1 OR AND Sum 0 0 NOT TE 1 0 1 0 1 AND Carry 0 0 0 0 FULL-ADDER Circuit P OR half-adder #1 S Q C2 half-adder #2 Input/Output Table PORcs 11111 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 0 1 0 0 0 0 0 R S 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, ...} See also: Other data types - C++ Tutorials (cplusplus.com) - 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. See also: vector - C++ Reference (cplusplus.com) * The program lab assignment is to be done individually. You may not copy someone else's work. I adhere to the Ohlone College Policy on Academic Integrity * For submission, please attach a screenshot of your output (.e..jpg file) and CS113-Lab 2.cpp file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
