Question: Please write this program using c++ Requirements Create a function for each of the gate operations Use an enumeration to specify the type of gates

Please write this program using c++

Please write this program using c++ Requirements Create a function for each

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 P P Input/Output Table Q Carry Sum 1 1 0 0 0 1 OR 1 e AND Sum NOT 1 0 0 AND Carry 1 0 1 0 0 0 FULL-ADDER Circuit C P OR half-adder #1 S Q C2 Input/Output Table P Q R CS 1 1 1 1 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 0 1 half-adder #2 R S

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!