Open In App
Related Articles

Representation of Boolean Functions

Improve Article
Save Article
Like Article

A Boolean function is described by an algebraic expression consisting of binary variables, the constants 0 and 1, and the logic operation symbols +,\:.\:,\:^\prime   For a given set of values of the binary variables involved, the boolean function can have a value of 0 or 1. For example, the boolean function F= x^\prime y + z   is defined in terms of three binary variables x,\:y,\:z   . The function is equal to 1 if x=0   and y=1   simultaneously or z=1   . Every boolean function can be expressed by an algebraic expression, such as one mentioned above, or in terms of a Truth Table. A function may be expressed through several algebraic expressions, on account of them being logically equivalent, but there is only one unique truth table for every function. A Boolean function can be transformed from an algebraic expression into a circuit diagram composed of logic gates connected in a particular structure. Circuit diagram for F    

Canonical and Standard Forms – Any binary variable can take one of two forms, x   or x^\prime   . A boolean function can be expressed in terms of n   binary variables. If all the binary variables are combined together using the AND operation, then there are a total of 2^n   combinations since each variable can take two forms. Each of the combinations is called a minterm or standard product. A minterm is represented by m_i   where i   is the decimal equivalent of the binary number the minterm is designated. Important Note – In a minterm, the binary variable is un-primed if the variable is 1 and it is primed if the variable is 0 i.e. if the minterm is xy^\prime   then that means x=1   and y'=0   . For example, for a boolean function in two variables the minterms are – m_0=x^\prime y^\prime,\:m_1=x^\prime y,\:m_2=x y^\prime,\:m_3=x y   In a similar way, if the variables are combined together with OR operation, then the term obtained is called a maxterm or standard sum. A maxterm is represented by M_i   where i   is the decimal equivalent of the binary number the maxterm is designated. Important Note – In a maxterm, the binary variable is un-primed if the variable is 0 and it is primed if the variable is 1 i.e. if the maxterm is x^\prime+y   then that means x^\prime=1   and y=0   . For example, for a boolean function in two variables the maxterms are – M_0=x+y,\:M_1=x+y^\prime,\:M_2=x^\prime + y,\:M_3=x^\prime + y^\prime   Minterms and Maxterms for function in 3 variables –


 Relation between Minterms and Maxterms – Each minterm is the complement of it’s corresponding maxterm. For example, for a boolean function in two variables –

m_0=x^\prime y^\prime[Tex](m_0)^\prime=(x^\prime y^\prime)^\prime[/Tex](m_0)^\prime=(x^\prime)^\prime + (y^\prime)^\prime[Tex](m_0)^\prime=x+y=M_0[/Tex]In general m_i = (M_i)^\prime or M_i = (m_i)^\prime

Constructing Boolean Functions – Now that we know what minterms and maxterms are, we can use them to construct boolean expressions. “A Boolean function can be expressed algebraically from a given truth table by forming a minterm for each combination of the variables that produces a 1 in the function and then taking the OR of all those terms.” For example, consider two functions f_1   and f_2   with the following truth tables –

x y z f f
0 0 0 0 0
0 0 1 1 0
0 1 0 0 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1

\begin{tabular}{||c||c||c||c||c||} \hline x&y&z&f_1&f_2\\ \hline \hline 0&0&0&0&0\\ \hline 0&0&1&1&0\\ \hline 0&1&0&0&0\\ \hline 0&1&1&0&1\\ \hline 1&0&0&1&0\\ \hline 1&0&1&0&1\\ \hline 1&1&0&0&1\\ \hline 1&1&1&1&1\\ \hline \end{tabular}   The function f_1   is 1 for the following combinations of x,\:y,\:z   – 001,100,111 The corresponding minterms are- x^\prime y^\prime z   x y^\prime z^\prime   xyz   . Therefore the algebraic expression for f_1   is- f_1(x,y,z) = x^\prime y^\prime z + x y^\prime z^\prime + xyz   [Tex]f_1(x,y,z) = m_1 + m_4 +m_7   [/Tex]Similarly, the algebraic expression for f_2   is- f_2(x,y,z) = m_3 + m_5 + m_6 + m_7   If we use De Morgans Law on f_1   and f_2   all 1’s become 0 and all 0’s become 1. Therefore we get- f_1(x,y,z)^\prime = m_0 + m_2 +m_3 + m_5 + m_6   [Tex]f_2(x,y,z)^\prime = m_0 + m_1 + m_2 + m_4   [/Tex]On using De Morgans Law again- f_1(x,y,z) = (m_0 + m_2 +m_3 + m_5 + m_6)^\prime   [Tex]f_1(x,y,z) = m_0^\prime . m_2^\prime . m_3^\prime . m_5^\prime . m_6^\prime   [/Tex]f_1(x,y,z) = M_0 . M_2 . M_3 . M_5 . M_6   and f_2(x,y,z) = (m_0 + m_1 + m_2 + m_4)^\prime   [Tex]f_2(x,y,z) = m_0^\prime . m_1^\prime . m_2^\prime . m_4^\prime   [/Tex]f_2(x,y,z) = M_0 . M_1 . M_2 . M_4   We can conclude from the above that boolean functions can be expressed as a sum of minterms or a product of maxterms. “Boolean functions expressed as a sum of minterms or product of maxterms are said to be in canonical form.

  • Example 1 – Express the following boolean expression in SOP and POS forms- F=x+y^\prime z
  • Solution – The expression can be transformed into SOP form by adding missing variables in each term by multiplying by k+k^\prime = 1   where k   is the missing variable. It follows from the fact that – 1.x = x.1 = x   [Tex]F=x(y+y^\prime)+y^\prime z\\ F=xy+xy^\prime+y^\prime z\\ F=xy(z+z^\prime)+xy^\prime(z+z^\prime)+(x+x^\prime)y^\prime z\\ F=xyz + xyz^\prime + xy^\prime z + xy^\prime z^\prime + xy^\prime z + x^\prime y^\prime z   [/Tex]On rearranging the minterms in ascending order F=x^\prime y^\prime z + xy^\prime z^\prime + xy^\prime z + xyz^\prime + xyz\\ F=m_1 + m_4 + m_5 + m_6 + m_7   If we want the POS form, we can double negate the SOP form as stated above to get- F=M_0.M_2.M_3   The SOP and POS forms have a short notation of representation- F(x,y,z) = \sum(1,4,5,6,7)\\ F(x,y,z) = \prod(0,2,3)\\

Standard Forms – Canonical forms are basic forms obtained from the truth table of the function. These forms are usually not used to represent the function as they are cumbersome to write and it is preferable to represent the function in the least number of literals possible. There are two types of standard forms –

  1. Sum of Products(SOP)- A boolean expression involving AND terms with one or more literals each, OR’ed together.
  2. Product of Sums(POS) A boolean expression involving OR terms with one or more literals each, AND’ed together, e.g.
SOP- x^\prime + xy +yz^\primePOS- (x^\prime).(x + y).(y + z^\prime)
  1. Note – The above expressions are not equivalent, they are just examples.

GATE CS Corner Questions

Practicing the following questions will help you test your knowledge. All questions have been asked in GATE in previous years or in GATE Mock Tests. It is highly recommended that you practice them. 1. GATE CS 2010, Question 6 2. GATE CS 2008, Question 7 3. GATE CS 2014 Set-1, Question 17


Digital Design 5th Edition, by Morris Mano and Michael Ciletti If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing Data Science & AI as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.

Last Updated : 11 Apr, 2023
Like Article
Save Article
Similar Reads