Programs on logic gate in c

Asked By 30 points N/A Posted on -
qa-featured

I have been asked to prepare a c project permitting the user to mimic combinational intelligence entryways where the user inputs paired qualities for A,B and C and the yield circuit is shown. have been given a template show to utilize with the system which holds the paired illumination for As well as and NOT doors. 

The principal part of the spec advises me to Begin by including C capacities for re-enacting extra sensibility entryways: XOR, XNOR, NAND and NOR. 
 
All I am searching for is the way could i go regarding addressing the first part…. including c capacities for the XOR, XNOR and so forth sensibility entryways as this part is confounding me? Are there programs on logic gate in C or C++?

 

SHARE
Answered By 0 points N/A #143274

Programs on logic gate in c

qa-featured

Hello Ingridgonzalou,

The best way is to do this is write NAND, NOR, XOR, XNOR using simple AND, OR, NOT. For example NAND is NOT(AND). If AND gives 1 as the output then NAND gives 0. NOR is NOT(OR) and XNOR is NOT(XOR). 

You have to write XOR using simple AND and OR. This can be written using NAND like this:

NAND(A NAND (A NAND B)) NAND (B NAND (A NAND B))

You can simplify the about XOR using NOT and AND.

Now you can write a simple program to output the solution for AND, OR, NOT using C++. Then can use it to get the results for the NAND, NOR, XOR, XNOR gates.

Login/Register to Answer

Related Questions