Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Number System and Arithmetic
  • Algebra
  • Set Theory
  • Probability
  • Statistics
  • Geometry
  • Calculus
  • Logarithms
  • Mensuration
  • Matrices
  • Trigonometry
  • Mathematics
Open In App
Next Article:
Canonical and Standard Form
Next article icon

Representation of Boolean Functions

Last Updated : 11 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Boolean functions are expressions involving Boolean variables and operators, such as AND, OR, and NOT. These functions are fundamental in digital logic design, computer science, and engineering.

Table of Content

  • What are Boolean Functions?
    • Definition of Boolean Functions
  • Representation of Boolean Functions
  • Different representations of a Boolean function
  • Canonical and Standard Forms
  • Constructing Boolean Functions
  • Applications of Boolean Functions
    • Solved Examples
  • Practice Problems - Representation of Boolean Functions

What are Boolean Functions?

Boolean functions are mathematical expressions involving Boolean variables that take on values of true or false, typically represented as 1 and 0, respectively. These functions are fundamental in digital logic design, computer science, and engineering, as they form the basis of digital circuits and various computational processes.

Definition of Boolean Functions

A Boolean function is a function that takes one or more Boolean inputs and produces a Boolean output. It can be represented using Boolean algebra, which involves operations such as AND, OR, NOT, NAND, NOR, XOR, and XNOR.

Representation of Boolean Functions

  • Truth Tables: List all possible values of the variables and the corresponding function values.
  • Boolean Expressions: Use algebraic expressions with Boolean variables and operators.
  • Karnaugh Maps (K-maps): Graphical representation to simplify Boolean functions.
  • Binary Decision Diagrams (BDDs): Graph-based representation of Boolean functions.

An algebraic equation that includes binary variables, the constants 1 and 0, and the logic operation symbols +,., and ', describes a Boolean function. A boolean function can have a value of 1 or 0 for any set of binary variable values involved. For example, we can use the three binary variables x, y, and z to define the boolean function F = x'y + z. In the event where x = 0 and y = 1 or z = 1, the function would equal 1.

A boolean function can be expressed in terms of the Truth Table or by an algebraic expression similar to the one that was previously discussed. A function can be expressed using a variety of algebraic expressions because they are all logically identical.

Different representations of a Boolean function

(A) Each function has ν = 3 variables named a, b, and c. The truth table specifies the value fμ(a, b, c) ∈ {0, 1} for each of the 2³ possible combinations of 3 binary inputs (columns). Combinations corresponding to fμ = 1 are called minterms. A function is identified by its designation number X = 11101010 (last row). More readable representations are the full (top) and minimized (bottom) disjunctive normal forms.

Representation-of-Boolean-Functions---1
(A)

(B) Hypercube consists of a set of terms (nodes), minterms (gray nodes), and edges connecting the closest terms in the function.

Representation-of-Boolean-Functions---2
(B)

(C) A feed-forward Boolean network (FFBN) is a directed network made up of logic gates and wires that implement the function. The figure shows the FFBN of minimal cost.

Representation-of-Boolean-Functions---3
(C)

Canonical and Standard Forms

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 -

xyzf 1 f 2 
00000
00110
01000
01101
10010
10101
11001
11111

Applications of Boolean Functions

  1. Digital Circuit DesignBoolean functions are used to design and simplify digital circuits, including logic gates, multiplexers, adders, and more. Simplifying Boolean expressions reduces the number of gates required, optimizing circuit design.Example: Designing a digital circuit to perform arithmetic operations involves using Boolean functions to define the behavior of adders and subtractors.
  2. Computer AlgorithmsBoolean functions are integral to algorithms that involve decision-making, such as search algorithms, sorting algorithms, and error detection and correction algorithms.Example: In search algorithms, Boolean functions help determine whether a condition is met, guiding the search process.
  3. Fault DetectionBoolean functions are used in fault detection and diagnosis in digital systems. By comparing the expected and actual outputs of a digital circuit, faults can be identified and corrected.Example: Built-in self-test (BIST) techniques use Boolean functions to generate test patterns and compare the results to detect faults in integrated circuits.
  4. Control SystemsBoolean functions are used in control systems to define the logic for system operation, such as switching on or off, opening or closing valves, and more.Example: In an automated manufacturing process, Boolean functions control the operation of machinery based on sensor inputs.

Solved Examples

Example 1: Canonical Sum-of-Products (SOP) Form

Problem: Express the function F(A,B,C) = A + BC in canonical SOP form.

Solution: F(A,B,C) = A'BC + A'BC' + ABC + ABC'

Explanation: We expand the original function to include all minterms where F is true. This includes all terms where A is true (regardless of B and C) and the term where A is false but both B and C are true.

Example 2: Canonical Product-of-Sums (POS) Form

Problem: Express the function F(x,y,z) = x + y'z in canonical POS form.

Solution: F(x,y,z) = (x + y + z)(x + y + z')(x + y' + z)(x + y' + z')

Explanation: We find all the maxterms where the function is false and AND them together. The function is false only when x is false, y is true, and z is false.

Example 3: Algebraic Representation

Problem: Simplify the Boolean function F = AB + A'B + AB'.

Solution: F = A + B

Explanation:

F = AB + A'B + AB'

= AB + A'B + AB' + AB (adding AB doesn't change the function)

= B(A + A') + A(B + B')

= B(1) + A(1)

= B + A

= A + B

Example 4 : Express the function F(A,B,C) = A'B + BC' in canonical SOP form.

Solution: F(A,B,C) = A'BC' + A'BC + ABC'

Explanation: We expand the original function to include all minterms where F is true. This includes terms where A is false and B is true (regardless of C), and where B is true and C is false (regardless of A).

Example 5: Convert the function F(x,y,z) = x'y'z + xy'z' + xyz to canonical POS form.

Solution: F(x,y,z) = (x + y + z)(x + y' + z)(x' + y + z)

Explanation: We find all the maxterms where the function is false and AND them together. The function is false only when (x,y,z) is (0,1,0), (1,0,1), or (0,0,1).

Example 6 : Simplify the Boolean expression: G(a,b,c) = ab + a'c + bc

Solution: G(a,b,c) = ab + c

Explanation:

G = ab + a'c + bc

= ab + c(a' + b)

= ab + c(a' + b + ab) (adding ab doesn't change the result)

= ab + c(a' + b)

= ab + c

Example 7 : Express the function H(p,q,r) = p'q' + qr' in algebraic form using only NAND operations.

Solution: H(p,q,r) = ((p NAND p) NAND (q NAND q)) NAND ((q NAND (r NAND r)) NAND (q NAND (r NAND r)))

Explanation: We first convert OR to NAND using De Morgan's law, then replace AND with NAND, and finally replace NOT with a NAND of the variable with itself.

Example 8 : Express the function K(a,b,c) = (a + b')(a' + c) in canonical SOP form.

Solution: K(a,b,c) = a'bc + ab'c + abc

Explanation: We expand the expression and find all combinations that make it true. This includes when a is false, b and c are true; when a and c are true, b is false; and when all variables are true.

Problem 9 : Convert the function F(w,x,y,z) = wx + y'z + xyz' to Reed-Muller canonical form.

Solution: F(w,x,y,z) = 1 ⊕ y ⊕ z ⊕ wx ⊕ yz

Explanation:

Start with F = wx + y'z + xyz'

Replace y' with (1 ⊕ y)

F = wx + (1 ⊕ y)z + xyz'

Expand: F = wx + z ⊕ yz + xyz'

Combine xyz' and xyz: F = wx + z ⊕ yz + xy(z' ⊕ z)

Since (z' ⊕ z) = 1, we get: F = wx + z ⊕ yz + xy

Rearranging: F = 1 ⊕ y ⊕ z ⊕ wx ⊕ yz

The Reed-Muller canonical form uses XOR (⊕) and AND operations, with each variable appearing at most once in each term.

Example 10 : Represent the function G(a,b,c) = a'b + bc' + ac using a Binary Decision Diagram (BDD).

Solution: The BDD for this function would look like this (described textually):

Root node: a

If a = 0: go to node b

If b = 0: output 0

If b = 1: output

If a = 1: go to node c

If c = 0: go to node b

If b = 0: output 0

If b = 1: output 1

If c = 1: output 1

Explanation:

We start with variable a at the root.

If a is false (0), the function reduces to b, so we output 1 if b is true, 0 otherwise.

If a is true (1), we need to check c.

If c is true, the function is true regardless of b.

If c is false, we need to check b (because of the bc' term).

Practice Problems - Representation of Boolean Functions

1. Express the function F(x,y,z) = x'y + yz + xz' in canonical Sum-of-Products (SOP) form.

2. Convert the function G(a,b,c) = (a + b')(a' + c)(b + c') to canonical Product-of-Sums (POS) form.

3. Simplify the Boolean expression H(p,q,r) = pq + p'r + qr using algebraic methods.

4. Represent the function J(w,x,y,z) = Σm(0,1,3,4,5,7,8,9,11,15) using a Karnaugh map and find its minimal SOP form.

5. Express the function K(a,b,c) = a'b + bc' + ab'c in Reed-Muller canonical form.

6. Convert the function L(x,y,z) = x'y'z + xy'z' + xyz to a form using only NOR operations.

7. Draw a Binary Decision Diagram (BDD) for the function M(p,q,r) = pq + qr' + pr.

8. Find the dual of the function N(a,b,c) = (a + b')(a' + c).

9. Express the function P(w,x,y,z) = w'x + yz + wx'y' using Shannon's expansion theorem.

10. Given the truth table for function Q(a,b,c) where Q is true for minterms 1, 2, 4, and 7, express Q in minimal SOP and minimal POS forms.

Related Articles:

  • Boolean Algebra - Expression, Rules, Theorems
  • Boolean Functions

Conclusion - Representation of Boolean Functions

Boolean functions are a cornerstone of digital logic design and computer science. They provide a systematic way to represent and manipulate logical relationships between variables, enabling the design and optimization of digital circuits and computational processes. Understanding Boolean functions is essential for anyone working in fields related to digital electronics and computer engineering.


Next Article
Canonical and Standard Form

C

Chirag
Improve
Article Tags :
  • Engineering Mathematics
  • GATE CS
  • Mathematics
  • Digital Logic
  • Discrete Mathematics

Similar Reads

    Introduction of Logic Gates
    In Boolean Algebra, there are three basic operations, +,\:.\:,\:^\prime which are analogous to disjunction, conjunction, and negation in propositional logic . Each of these operations has a corresponding logic gate. Apart from these, there are a few other logic gates as well. It was invented by Geor
    9 min read
    Properties of Boolean Algebra
    The Boolean Algebra uses sets of rules for analyzing digital gates and circuits. In this article, we will be going through the Properties or Laws of the Boolean algebra. So first we will start our article by defining what are the properties of Boolean Algebra, and then we will go through what are Bo
    7 min read
    Minimization of Boolean Functions
    Boolean functions are used to represent logical expressions in terms of sum of minterms or product of maxterms. Number of these literals (minterms or maxterms) increases as the complexity of the digital circuit increases. This can lead to large and inefficient circuits. By minimizing Boolean functio
    4 min read
    Representation of Boolean Functions
    Boolean functions are expressions involving Boolean variables and operators, such as AND, OR, and NOT. These functions are fundamental in digital logic design, computer science, and engineering.Table of ContentWhat are Boolean Functions?Definition of Boolean FunctionsRepresentation of Boolean Functi
    10 min read
    Canonical and Standard Form
    Canonical Form - In Boolean algebra, the Boolean function can be expressed as Canonical Disjunctive Normal Form known as minterm and some are expressed as Canonical Conjunctive Normal Form known as maxterm. In Minterm, we look for the functions where the output results in "1" while in Maxterm we loo
    6 min read
    Functional Completeness in Digital Logic
    Functional Completeness is a crucial concept in digital logic design. A set of logical operators is functionally complete if it can be used to express any Boolean function. This means that any logical operation, regardless of complexity, can be constructed using only operators from a functionally co
    6 min read
    Introduction of K-Map (Karnaugh Map)
    In many digital circuits and practical problems, we need to find expressions with minimum variables. We can minimize Boolean expressions of 3, 4 variables very easily using K-map without using any Boolean algebra theorems. It is a tool which is used in digital logic to simplify boolean expression. I
    5 min read
    Various Implicants in K-Map
    An implicant can be defined as a product/minterm term in Sum of Products (SOP) or sum/maxterm term in Product of Sums (POS) of a Boolean function. For example, consider a Boolean function, F = AB + ABC + BC. Implicants are AB, ABC, and BC. There are various implicant in K-Map listed below :Prime Imp
    5 min read
    PDNF and PCNF in Discrete Mathematics
    PDNF (Principal Disjunctive Normal Form)It stands for Principal Disjunctive Normal Form. It refers to the Sum of Products, i.e., SOP. For eg. : If P, Q, and R are the variables then (P. Q'. R) + (P' . Q . R) + (P . Q . R') is an example of an expression in PDNF. Here '+' i.e. sum is the main operato
    4 min read
    Variable Entrant Map (VEM) in Digital Logic
    K-map is the best manual technique to solve Boolean equations but it becomes difficult to manage when number of variables exceed 5 or 6. So, a technique called Variable Entrant Map (VEM) is used to increase the effective size of k-map. It allows a smaller map to handle large number of variables. Thi
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences