The idea
Key formulas
De Morgan for AND
De Morgan for OR
Loading lessons…
Just a moment, getting everything ready. The first load can take up to a minute.
Discrete maths
Boolean laws and Karnaugh-map groupings reduce logic expressions while preserving their truth-table outputs.
Click or focus a cell and press Enter/Space to cycle 0 → 1 → X.
Boolean variables take values 0 or 1. In Boolean algebra, means OR, juxtaposition means AND, and a prime means NOT. Important identities include De Morgan's laws and , absorption , and distributivity . Every Boolean function can be written in sum-of-products (SOP) form (OR of AND terms) or product-of-sums (POS) form (AND of OR terms).
A Karnaugh map (K-map) rearranges truth-table rows so neighboring cells differ in one variable. Group 1-cells in rectangular groups of size 1, 2, 4, 8, or 16 to obtain simplified SOP terms. For POS, group 0-cells. Groups may wrap across opposite edges and may overlap; choose large groups that cover every required cell with few groups. A don't-care cell may be included in a group if it simplifies the result, or ignored if not useful. Maps with two, three, or four variables use Gray-code order so adjacent rows or columns differ in one bit.
The canonical SOP has one minterm (an AND term containing every variable or its complement) for each 1-row of the truth table. The canonical POS has one maxterm (an OR term containing every variable or its complement) for each 0-row. K-map grouping removes literals from these canonical forms without changing the function.
NAND and NOR are universal gates: any Boolean function can be constructed using only NAND gates or only NOR gates by applying De Morgan's laws and expressing the function in the suitable form.