12,547,806 members (35,173 online)
Tip/Trick
alternative version

7.8K views
7 bookmarked
Posted

# Truth table and simplification of a boolean expression

, 16 Jun 2014 CPOL
 Rate this:
generation of Karnaugh table

## Introduction

The Karnaugh map, also known as the K-map, is a method to simplify boolean algebra.

Karnaugh maps are used to facilitate the simplification of Boolean algebra functions. Take the Boolean function described by the following truth table.

## Requirements

The reader should have basic notions of boolean algebra;Knowledge of the Quine McKluskey algorithm is optimal. Basic notions of C# are required for understanding the code.

## Using of the application

first we have to introduce the booleane expression to the textbox, this one must use only(a;b:c:d;!,+) as character, when we click the button of table truth generation the listview ll be filled by the appropriate values. in the variables fields   or sub-functions fields  or Function fields .

then, the Karnaugh button appears, and if we click it, the Karnaugh table ll be generated and filled.

Now to simplify the expression we use tow methods the first is to simplify tow terms and return the simlified expression

```        <span style="color: rgb(0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono; font-size: 12px; white-space: pre; background-color: rgb(251, 237, 187);">public string simplifier1(int i,int j,int order)
</span>```

the socond make all simplifications possible in the Karnaugh table

```public void evaluer(int order)
{
int s = 0;
for (int i = 0; i < Form1.j; i++)
{
for (int k = i; k < Form1.j; k++)
{
simplifier1(i, k, order);
if ((lstTerms[order].GetItemCheckState(i) == CheckState.Checked) && (lstTerms[order].GetItemCheckState(k) == CheckState.Checked))
{
if (!tab.Contains(simplifier1(i, k, order)) && !Form1.local_tab.Contains(simplifier1(i, k, order)))
{
tab[s] = simplifier1(i, k, order);
lstTerms[order+1].SetItemChecked(s, false);
s++;
}
}

}

}
for (int i = 0; i < Form1.j; i++)
{
Form1.local_tab[i] = " ";

}
Form1.j = s;
for (int i = 0; i < Form1.j; i++)
{
Form1.local_tab[i] = tab[i];
tab[i] = " ";
}
if (s == 0)
arret = true;
}
```

and that what we have as result

## Share

 Algeria
No Biography provided

## You may also be interested in...

 Pro

 First Prev Next
 Cannot Download the ZIP File Member 1004250111-Oct-16 4:59 Member 10042501 11-Oct-16 4:59