Documente Academic
Documente Profesional
Documente Cultură
“LOGIC
SIMPLIFICATION”
COMPUTER ENGINEERING
Project Submitted To:- Mrs.Anupam
Garg(HOD)
Ms. Monika Gupta
Lect. Ms. Rupinder Kaur
Pr
oject Submitted by: -
PRIYANKA GUPTA
2008/182
RISHI ARORA
2008/187
SHIVANI ARORA
2008/194
(6TH COMP.)
ACKNOWLEDGEMENT
CERTIFICATE
Table of Contents
Introduction to Project
• Purpose
• Scope
• Need of project
Dataflow diagrams
• Level-0 (DFD)
Functions Used
Coding
Output screens
• Front Page
• Sub Page having Choice to opt for one
• Using Theorems
• Display various Theorems
• K-map of diff Variables
• Simplified Expression using k-maps
Conclusion
Bibliography
Introduction
1.1) PURPOSE
1.2) SCOPE
2. Reliability: - The reliability of the proposed system will be high due to the
above stated reasons. The reason for the increased reliability of the system is
that now there would be proper storage of information.
Hardware Requirements
Processor RAM Disk Space
2.4) Constraints
• GUI is only in English
BASIC LOGIC GATES
Logic is defined as science of reasoning. In other words, it is the
development of a reasonableor logical conclusion based on known
information. A gate is simply an electronic circuit which operates on one or
more input signals to produce an output signal. Logic gates can be
constructed from diodes, transistors and resistors connected in such a way
that circuit output is the result of a basic logic operations performed on the
inputs. The three basic logic gates are:-
AND gate
OR gate
X x`
2.AND gate :
The AND gate is a Logic circuit that requires all the inputs to be high at
same time in order for output to be high. AND gate can have two or
more inputs.If any of the input is low(0),then the output is low(0).
X=A.B;
A X=A.B
B
3.OR gate :
The OR gate is a Logic circuit that requires any of the one inputs to be
high at same time in order for output to be high. OR gate can have two
or more inputs.If any of the input is high(1),then the output is high(1).
X=A+B;
K-MAP:
The Karnaugh Map(k-Map) is a systematic method for simplifying and
manipulating Boolean expression. In this technique information contained in
a truth table in sum of product or product of sum is represented on k-map. It
is used to simplify a logic expression or to convert a truth table to
corresponding ligig circuit in simple orderly process. K-map can be used for
problems involving any no. of input variables but practically limited to six
variables.
1)GRAPHICS.H:-
The functions which are refered from graphics. h are
fillellipse, settextstyle, moveto, outtext, closegraph.
SETTEXTSTYLE:-
CLOSEGRAPH:-
void closegraph(void);
SETBKCOLOR:-
SETTEXTSTYLE:
SETCOLOR:-
It sets the current drawing color,which ranges from 0 to
specific color ranges.
CLRSCR():-
GETCH():-
GOTOXY():-
It moves the cursor to the given position in the current
text window. Its declaration is as:-
where x=column
y=row
EXIT:-
4) IOSTREAM.H:-
This is a file which is mainly used in c++. The functions
which are refered from this file are:-
COUT:-
CIN:-
Strcmp(str1,str2);
Istmain()
Scdmain()
Data Flow Diagrams:-
We have used c++ as front end for our project. C++ was
developed by “Bjarne Stroustrup” of AT&T Bell Laboratories
in the early “1980's”, and is based on the C language. The
name is a pun - "++" is a syntactic construct used in C (to
increment a variable), and C++ is intended as an
incremental improvement of C.
C is in many ways hard to categories. Compared to assembly
language it is high-level,but it never the less. It includes
many low-level facilities to directly manipulate the
computer's memory. It is therefore an excellent language for
writing efficient "systems" programs. But for other types of
programs, C code can be hard to understand, and C
programs can therefore be particularly prone to certain types
of error. The extra object-oriented facilities in C++ are partly
included to overcome these shortcomings.
Concepts of OOP’s
“BENEFITS OF OOPS”
OOP’s is used in Several Places The Features of the OOP’s
include----
“OVERVIEW OF C++”
#include<iostream.h>
Void main()
“C++ Tokens”
A C++ Program is made up of Classes and Methods. The
Methods are the container of the various statements and a
statement is made up of Variables, Constants, operators
etc .Tokens are the Smallest unit of Program .
• Identifier
• Operators
• Separators
Like 2 +3 ,
“C++ Compiler “
Compiler translates the human code into the byte codes.
1) Initialization
2) Condition check
3) Increment
1) while
2) do-while
3) for
All these are used for performing the repetitive tasks until the
given condition is not true.
“Jumping in Loops”
A Class contains :
“CONSTRUCTOR”
Object-oriented programming
Portability
Brevity
Modular programming
C Compatibility
Speed
File Handling
The C++ file system is designed to work with a wide variety
of devices, including terminals, disk drives and tape drives.
Even though each device is very different, the C file system
transforms each into a logical device called a stream. There
are two types of streams text and binary. A Text stream is a
sequence of characters. A binary stream is a sequence of
bytes with a one-to-one correspondence to those in the
external device. It acts either as a source from which the
input data can be obtained or a destination to which the
output data can be sent. The concept is illustrated in the
figure.
Coding
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<process.h>
#include<graphics.h>
#include<stdlib.h>
class gate
{
int a,b;
public:
int and(int ,int);
int or(int ,int);
int not(int,int);
};
setlinestyle(SOLID_LINE,1,3);
setcolor(8);
rectangle(3,3,636,476);
setlinestyle(SOLID_LINE,1,1);
setcolor(4);
rectangle(8,8,631,471);
settextjustify(1,1);
setbkcolor(11);
setcolor(4);
settextstyle(7,0,0);
setusercharsize(17,10,6,3);
outtextxy(320,30,"LOGIC");
outtextxy(360,100,"SIMPLIFICATION");
setusercharsize(2,3,2,3);
settextstyle(1,0,0);
outtextxy(500,220,"Project Submitted By:");
line(360,240,620,240);
outtextxy(500,250,"Priyanka Gupta(182/08)");
outtextxy(500,280,"Rishi Arora(187/08)");
outtextxy(500,310,"Shivani Arora(194/08)");
outtextxy(130,220,"Project Submitted TO:");
line(10,240,250,240);
outtextxy(130,250,"Mrs.Anupam Garg");
outtextxy(130,280,"[ HOD CSE Dept. ]");
outtextxy(130,310,"Lect.Monika Gupta");
outtextxy(130,340,"Lect.Rupinder Kaur");
getch();
clrscr();}
int scdmain()
{
int m;
cleardevice();
setlinestyle(SOLID_LINE,1,1);
rectangle(3,3,636,476);
setlinestyle(SOLID_LINE,1,1);
rectangle(8,8,631,471);
settextjustify(1,1);
textcolor(15);
setbkcolor(15);
setcolor(6);
settextstyle(7,0,0);
setusercharsize(2,3,2,3);
outtextxy(320,80,"The Two Proposed Way To Simplify");
outtextxy(360,110,"The Boolean Expression:");
setusercharsize(2,3,2,3);
settextstyle(1,0,0);
outtextxy(350,200,"\n\t\t1. The Various Theorams.....");
outtextxy(385,250,"2. Through Karnaugh Map(k-map)");
outtextxy(280,380,"Enter The Choice(1/2):");
cin>>m;
char s[4];
itoa(m,s,10);
outtextxy(440,380,s);
getch();
clrscr();
return(m);
}
void main()
{
gate g;
int gd,gm,m;
gd=DETECT;
int h,n;
initgraph(&gd,&gm,"d:\\software\\tur-cpp\\bgi");
cleardevice();
istmain();
m=scdmain();
if(m==1)
{
cleardevice();
setbkcolor(GREEN);
textcolor(GREEN);
setcolor(BLUE);
clrscr();
settextstyle(0,0,1);
cout<<"\n\n\t\tTHE VARIOUS LAWS FOR LOGIC SIMPLIFICATION:";
cout<<"\n\n\n\t\tCHOOSE ANY OF THE FOLLOWING LAW TO IMPLEMENT";
cout<<"\n\n\t\t\t(a)INDEMPOTENT LAW";
cout<<"\n\n\t\t\t(b)COMPLEMENTRY LAW";
cout<<"\n\n\t\t\t(c)INVOLUTION LAW";
cout<<"\n\n\t\t\t(d)COMMUTATIVE LAW";
cout<<"\n\n\t\t\t(e)ASSOCIATIVE LAW";
cout<<"\n\n\t\t\t(f)DISTRIBUTIVE LAW";
cout<<"\n\n\t\t\t(g)ABSORPTION LAW";
cout<<"\n\n\t\t\t(h)ALGEBRIC RULE";
cout<<"\n\n\t\t\t(i)DEMORGANS THEORMS:";
cout<<"\n\n\t\t\t(x)FOR EXIT";
char ch;
cout<<"\n\t\tEnter choice:";
cin>>ch;
switch(ch)
{
case'a': //For Implementing Indempotent Law
{
clrscr();
cout<<"\nThe Indempotent Law States that:";
cout<<"\n\n\t1. If a variable is ORed with itself then output is equal to variable itself.";
cout<<"\n\n\t\t\t\t\t\tX+X=X";
cout<<"\n\n\t2. If a variable is ANDed with itself then output is equal to variable itself." ;
cout<<"\n\n\n\t\t\t\t\t\tX.X=X";
cout<<"\n\nEnter Choice(1/2):";
int p;
cin>>p;
if(p==1)
{
clrscr();
int i;
cout<<"\nEnter Value (1/0)of x=";
cin>>i;
int result;
char s[4];
result=(i | i);
g.or(100,100);
itoa(i,s,10);
outtextxy(100,90,s);
outtextxy(100,125,s);
itoa(result,s,10);
outtextxy(175,107,s);
}
else if(p==2)
{
clrscr();
int i;
cout<<"\nEnter Value (1/0)of x=";
cin>>i;
int result;
char s[4];
result=(i & i);
g.and(100,100);
itoa(i,s,10);
outtextxy(100,90,s);
outtextxy(100,125,s);
itoa(result,s,10);
outtextxy(182,103,s);
}
break;
}
case'b': // For Implementing Complementary Law
{
clrscr();
cout<<"\n\n\tTHIS LAW STATES:";
cout<<"\n\n\t1.If a variable and its complement are ORed,result is always 1:";
cout<<"\n\n\t\t\tX+X'=1";
cout<<"\n\n\t2.If a variable and its complement are ANDed,result is always 0:";
cout<<"\n\n\t\t\tX.X'=0";
int i,com,result,p;
char s[4];
cout<<"\n\n\t\tEnter The Choice(1/2)";
cin>>p;
getch();
clrscr();
if(p==1)
{
cout<<"\n\t\tEnter Input(1/0):";
cin>>i;
if(i==1)
{
com=0;
}
if(i==0)
{
com=1;
}
result=(i | com);
g.or(100,100);
itoa(i,s,10);
outtextxy(100,90,s);
itoa(com,s,10);
outtextxy(100,125,s);
itoa(result,s,10);
outtextxy(175,107,s);
}
if(p==2)
{
cout<<"\n\t\tEnter Input(1/0):";
cin>>i;
if(i==1)
{
com=0;
}
if(i==0)
{
com=1;
}
result=(i & com);
g.and(100,100);
itoa(i,s,10);
outtextxy(100,90,s);
itoa(com,s,10);
outtextxy(100,125,s);
itoa(result,s,10);
outtextxy(183,102,s);
}
break;
}
case'x':
exit(0);
break;
default: // For Any Wrong input
{
clrscr();
cout<<"\n\n\n\n\n\n\n\n\t\t\tEnter valid choice...............";
}
}
getch();
}
else if(m==2) //For Displaying the K-Map
{
setlinestyle(SOLID_LINE,1,1);
setcolor(15);
setbkcolor(8);
textcolor(8);
rectangle(3,3,636,476);
setlinestyle(SOLID_LINE,1,1);
clrscr();
rectangle(8,8,631,471);
settextjustify(1,1);
setcolor(15);
settextstyle(5,0,0);
setusercharsize(4,4,2,3);
outtextxy(320,80,"The Simplified Expression Using K-MAP");
outtextxy(360,120,"&& Expressed Using Logic Gates::::::");
settextstyle(1,0,0);
setusercharsize(2,4,2,3);
outtextxy(400,270,"For Ex:");
rectangle(400,300,500,400);
line(450,300,450,400);
line(400,350,500,350);
outtextxy(430,320,"1");
outtextxy(480,370,"1");
getch();
clrscr();
cout<<"\n\tEnter the no.of variables in the expression f():{ <= 3 }";
cin>>n;
cout<<"\n\n\tHow many Boxes:";
cin>>h;
cout<<"\n\n\tEnter the Boxes:";
int a[16],c[10],count=0;
for(int i=0;i<8;i++)
{
c[i]=0;
}
for(i=0;i<h;i++)
{
cin>>a[i];
}
switch(n)
{
case 2: //For two variables Expression
{
int b[2][2];
rectangle(150,175,210,225);
line(180,150,180,225);
line(120,200,210,200);
settextstyle(0,0,1);
outtextxy(160,150,"A`");
outtextxy(120,180,"B`");
outtextxy(120,210,"B");
outtextxy(160,160,"0");
outtextxy(190,150,"A");
outtextxy(190,160,"1");
outtextxy(135,180,"0");
outtextxy(135,210,"1");
for(i=0;i<h;i++)
{ // For displaying the K-Map
switch(a[i])
{
case 0:
outtextxy(160,183,"1");
b[0][0]=1;
break;
case 1:
outtextxy(190,183,"1");
b[0][1]=1;
break;
case 2:
outtextxy(160,210,"1");
b[1][0]=1;
break;
case 3:
outtextxy(190,210,"1");
b[1][1]=1;
break;
}
}
getch();
closegraph();
if(h==2)
{
if (b[0][0]==1&&b[1][1]==1)
cout<<"\nExpression is:"<<"A'B'+AB";
}
if(h==2)
{
if(b[0][1]==1&&b[1][0]==1)
cout<<"\nExpression is:"<<"AB'+A'B";
}
if(b[0][0]==1 && b[0][1]==1 && b[1][0]==1 && b[1][1]==1) // For resulting in the simplified
Expression Form
{
cout<<"\nExpression is : 0";
getch();
}
else
{
if(b[0][0]==1 && b[0][1]==1)
{
if(b[1][1]==1)
cout<<"\n Expression is:"<<"A+B'";
else if(b[1][0]==1)
cout<<"\n Expression is:"<<"A`+B";
else
cout<<"\n Expression is:"<<"B`";
}
else if(b[0][0]==1 && b[1][0]==1)
{
if (b[1][1]==1)
cout<<"\n Expression is:"<<"A`+B";
else if(b[0][1]==1)
cout<<"\ne\Expression is"<<"A'+B'";
else
cout<<"\n Expression is:"<<"A`";
}
else if(b[1][0]==1 && b[1][1]==1)
{
if(b[0][1]==1)
cout<<"\n Expression is:"<<"A+B";
else if(b[0][0]==1)
cout<<"\nExpression is:"<<"A'+B";
else
cout<<"\n Expression is:"<<"B";
}
else if(b[0][1]==1 && b[1][1]==1)
cout<<"\n Expression is:"<<"A";
getch();
break;
}
}
case 3: // For Expression having 3 variables
{
rectangle(100,175,220,225);
line(130,150,130,225);
line(160,150,160,225);
line(190,150,190,225);
line(220,150,220,225);
line(75,200,220,200);
outtextxy(100,155,"A`B`");
outtextxy(100,165,"0");
outtextxy(115,165,"0");
outtextxy(133,155,"A`B");
outtextxy(133,165,"0");
outtextxy(148,165,"1");
outtextxy(163,155,"A");
outtextxy(178,155,"B");
outtextxy(163,165,"1");
outtextxy(178,165,"1");
outtextxy(193,155,"A");
outtextxy(205,155,"B`");
outtextxy(193,165,"1");
outtextxy(205,165,"0");
outtextxy(77,177,"C`");
outtextxy(77,190,"0");
outtextxy(77,203,"C");
outtextxy(77,218,"1");
int hflag=0,qh1=0,qh2=0,qh3=0;
int trv[2][4]={0,0,0,0,0,0,0,0};
int ctrv[2][4];
for(i=0;i<h;i++) // For display the K-Map
{
switch(a[i])
{
case 0:
outtextxy(115,185,"1");
trv[0][0]=1;
break;
case 1:
outtextxy(145,185,"1");
trv[0][1]=1;
break;
case 2:
outtextxy(175,185,"1");
trv[0][2]=1;
break;
case 3:
outtextxy(205,185,"1");
trv[0][3]=1;
break;
case 4:
outtextxy(115,205,"1");
trv[1][0]=1;
break;
case 5:
outtextxy(145,205,"1");
trv[1][1]=1;
break;
case 6:
outtextxy(205,205,"1");
trv[1][3]=1;
break;
case 7:
outtextxy(175,205,"1");
trv[1][2]=1;
break;
}
}
for(int e=0;e<=1;e++)
{
for(int t=0;t<=3;t++)
{
ctrv[e][t]=trv[e][t];
}
}
getch();
fflush(stdout);
flushall(); // For display the simplified Expression
for(i=0;i<=3;i++)
{
if(trv[0][i]==1)
{
qh1=1;
}
else
{
qh1=0;
break;
}
}
fflush(stdout);
fflush(stdin);
for(i=0;i<=3;i++)
{
if(trv[1][i]==1)
{
qh2=1;
}
else
{
qh2=0;
break;
}
}
if(count==0)
{
clrscr();
cout<<"\n\n\t\tExpression is: C";
}
else
{
cout<<"+C";
}
count++;
for(i=0;i<=3;i++)
{
ctrv[1][i]=0;
}
}
if(count==0)
{
clrscr();
cout<<"C'";
}
else
{
cout<<"+C'";
}
count++;
for(i=0;i<=3;i++)
{
ctrv[0][i]=0;
}
}
}
}
for(int j=0;j<=2;j++)
{
if(ctrv[0][j]==1)
{
if((trv[0][j+1]==1)&&(trv[1][j]==1)&&(trv[1][j+1]==1))
{
switch(j)
{
case 0:
if(count==0)
{
clrscr();
cout<<"A'";
}
else
{
cout<<"+A'";
}
count++;
ctrv[0][0]=0;
ctrv[0][1]=0;
ctrv[1][0]=0;
ctrv[1][1]=0;
break;
case 1:
if(count==0)
{
clrscr();
cout<<"B";
}
else
{
cout<<"+B";
}
count++;
ctrv[0][1]=0;
ctrv[0][2]=0;
ctrv[1][1]=0;
ctrv[1][2]=0;
break;
case 2:
if(count==0)
{
clrscr();
cout<<"A";
}
else
{
cout<<"+A";
}
count++;
ctrv[0][2]=0;
ctrv[0][3]=0;
ctrv[1][2]=0;
ctrv[1][3]=0;
break;
}
}
}
}
for(j=0;j<=2;j++)
{
if(ctrv[1][j]==1)
{
if((trv[1][j+1]==1)&&(trv[0][j]==1)&&(trv[0][j+1]==1))
{
switch(j)
{
case 0:
if(count==0)
{
clrscr();
cout<<"A'";
}
else
{
cout<<"+A'";
}
count++;
ctrv[0][0]=0;
ctrv[0][1]=0;
ctrv[1][0]=0;
ctrv[1][1]=0;
break;
case 1:
if(count==0)
{
clrscr();
cout<<"B";
}
else
{
cout<<"+B";
}
count++;
ctrv[0][1]=0;
ctrv[0][2]=0;
ctrv[1][1]=0;
ctrv[1][2]=0;
break;
case 2:
if(count==0)
{
clrscr();
cout<<"A";
}
else
{
cout<<"+A";
}
count++;
ctrv[0][2]=0;
ctrv[0][3]=0;
ctrv[1][2]=0;
ctrv[1][3]=0;
break;
}
}
}
}
if(ctrv[0][0]==1)
{
if(trv[0][3]==1)
{
if(count==0)
{
clrscr();
cout<<"b'c'";
}
else
{
cout<<"+b'c'";
}
count++;
ctrv[0][0]=0;
ctrv[0][3]=0;
}
}
if(ctrv[1][0]==1)
{
if(trv[1][3]==1)
{
if(count==0)
{
clrscr();
cout<<"b'c";
}
else
{
cout<<"+b'c";
}
count++;
ctrv[1][0]=0;
ctrv[1][3]=0;
}
}
for(j=0;j<=2;j++)
{
if(ctrv[0][j]==1)
{
if(trv[0][j+1]==1)
{
switch(j)
{
case 0:
if(count==0)
{
clrscr();
cout<<"a'c'";
}
else
{
cout<<"+a'c'";
}
count++;
ctrv[0][0]=0;
ctrv[0][1]=0;
break;
case 1:
if(count==0)
{
clrscr();
cout<<"bc'";
}
else
{
cout<<"+bc'";
}
count++;
ctrv[0][1]=0;
ctrv[0][2]=0;
break;
case 2:
if(count==0)
{
clrscr();
cout<<"ac'";
}
else
{
cout<<"+ac'";
}
count++;
ctrv[0][2]=0;
ctrv[0][3]=0;
break;
}
}
else if(trv[1][j]==1)
{
switch(j)
{
case 0:
if(count==0)
{
clrscr();
cout<<"a'b'";
}
else
{
cout<<"+a'b'";
}
count++;
ctrv[0][0]=0;
ctrv[1][0]=0;
break;
case 1:
if(count==0)
{
clrscr();
cout<<"a'b";
}
else
{
cout<<"+a'b";
}
count++;
ctrv[0][1]=0;
ctrv[1][1]=0;
break;
case 2:
if(count==0)
{
clrscr();
cout<<"ab";
}
else
{
cout<<"+ab";
}
count++;
ctrv[0][2]=0;
ctrv[1][2]=0;
break;
}
}
}
}
if(ctrv[0][3]==1)
{
if(trv[1][3]==1)
{
if(count==0)
{
clrscr();
cout<<"ab'";
}
else
{
cout<<"+ab'";
}
count++;
ctrv[0][3]=0;
ctrv[1][3]=0;
} }
for(j=0;j<=2;j++)
{
if(ctrv[1][j]==1)
{
if(trv[1][j+1]==1)
{
switch(j)
{
case 0:
if(count==0)
{
clrscr();
cout<<"a'c";
}
else
{
cout<<"+a'c";
}
count++;
ctrv[1][0]=0;
ctrv[1][1]=0;
break;
case 1:
if(count==0)
{
clrscr();
cout<<"bc";
}
else
{
cout<<"+bc";
}
count++;
ctrv[1][1]=0;
ctrv[1][2]=0;
break;
case 2:
if(count==0)
{
clrscr();
cout<<"ac";
}
else
{
cout<<"+ac";
}
count++;
ctrv[1][2]=0;
ctrv[1][3]=0;
break;
}
}
else if(trv[0][j]==1)
{
switch(j)
{
case 0:
if(count==0)
{
clrscr();
cout<<"a'b'";
}
else
{
cout<<"+a'b'";
}
count++;
ctrv[0][0]=0;
ctrv[1][0]=0;
break;
case 1:
if(count==0)
{
clrscr();
cout<<"a'b";
}
else
{
cout<<"+a'b";
}
count++;
ctrv[0][1]=0;
ctrv[1][1]=0;
break;
case 2:
if(count==0)
{
clrscr();
cout<<"ab";
}
else
{
cout<<"+ab";
}
count++;
ctrv[0][2]=0;
ctrv[1][2]=0;
break;
}
}
}
}
if(ctrv[1][3]==1)
{
if(trv[0][3]==1)
{
if(count==0)
{
clrscr();
cout<<"ab'";
}
else
{
cout<<"+ab'";
}
count++;
ctrv[0][3]=0;
ctrv[1][3]=0;
}
}
for(j=0;j<=3;j++)
{
if(ctrv[0][j]==1)
{
switch(j)
{
case 0:
if(count==0)
{
clrscr();
cout<<"a'b'c'";
}
else
{
cout<<"+a'b'c'";
}
count++;
ctrv[0][0]=0;
break;
case 1:
if(count==0)
{
clrscr();
cout<<"a'bc'";
}
else
{
cout<<"+a'bc'";
}
count++;
ctrv[0][1]=0;
break;
case 2:
if(count==0)
{
clrscr();
cout<<"abc'";
}
else
{
cout<<"+abc'";
}
count++;
ctrv[0][2]=0;
break;
case 3:
if(count==0)
{
clrscr();
cout<<"ab'c'";
}
else
{
cout<<"+ab'c'";
}
count++;
ctrv[0][3]=0;
break;
}
}
if(ctrv[1][j]==1)
{
switch(j)
{
case 0:
if(count==0)
{
clrscr();
cout<<"a'b'c";
}
else
{
cout<<"+a'b'c";
}
count++;
ctrv[1][0]=0;
break;
case 1:
if(count==0)
{
clrscr();
cout<<"a'bc";
}
else
{
cout<<"+a'bc";
}
count++;
ctrv[1][1]=0;
break;
case 2:
if(count==0)
{
clrscr();
cout<<"abc";
}
else
{
cout<<"+abc";
}
count++;
ctrv[1][2]=0;
break;
case 3:
if(count==0)
{
clrscr();
cout<<"ab'c";
}
else
{
cout<<"+ab'c";
}
count++;
ctrv[1][3]=0;
break;
}
} }
}
getch();
}
}
else
{
clrscr();
cout<<"\n\n\n\t\tOoops!!!!! Enter Between 2 Valid Choices(1/2):" ;
}
getch();
}
OUTPUT
SCREENS
1. Welcome Page:
2.Choice Page:
3.Various Laws:
4.Explanation of Law:
5.Law using Logic Gates
6.Distributive Law:
7.Truth Table(T-T) of Distributive Law:
12.K-Map in 3 Variables:
13.Simplified Expression of Input:
Conclusion