Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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++

image text in transcribed

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 1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

Students also viewed these Databases questions

Question

When is it appropriate to use a root cause analysis

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago