Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

VHDL Tutorial 6: Design and verify De Morgan’s Theorem using VHDL

By Ashutosh Bhatt May 21, 2024

In previous tutorial VHDL tutorial 5, we built NAND, NOR, XOR, and XNOR gates using AND-OR-NOT gates in VHDL.

(If you are not following this VHDL tutorial series one by one, please go through all previous tutorials of these series before going ahead in this tutorial)

In this tutorial,

  • We shall write a VHDL program to build a digital circuit to prove De Morgan’s Theorem.
  • Verify the output waveform of the program (digital circuit) with the truth table of De Morgan’s Theorem

First, let us see review the statements of De Morgan’s Theorems.

Theorem 1
The complement of the sum of two or more variables is equal to the product of the complement of the variables. Means

Theorem 1
The complement of the product of two or more variables is equal to the sum of the complement of the variables. Means…
Let us start with the digital circuit for which we shall write a VHDL program.

Digital Circuit

Here is the truth table for the above circuits.


Now we shall write a VHDL program, compile it, simulate it, and get the output in the form of a waveform. Finely, we shall verify those output waveforms with a given truth table.

(Please go through step by step procedure given in VHDL-tutorial 3 to create a project, edit and compile the program, create a waveform file, simulate the program, and generate output waveforms.)

VHDL Program
library IEEE;

use IEEE.STD_LOGIC_1164.ALL;

entity DMorgan_ckt is
    Port (a,b : in std_logic;
               and_not_op,not_or_op,or_not_op,not_and_op : out std_logic
              );
end DMorgan_ckt;

architecture DMorgan_arch of DMorgan_ckt is
       begin
                and_not_op <= not (a and b);
                not_or_op <= (not a) or (not b);
                or_not_op <= not (a or b);
                not_and_op <= (not a) and (not b);
end DMorgan_arch;

“entity” describes input-output connections of a digital circuit. As per our circuit given above, we have only two inputs ‘A’ and ‘B’ and four outputs for four circuits.

“architecture” describes the operation of the circuit – means how the output is generated from a given input.

(To know more and get more details about VHDL program(s), please go through the first two tutorials VHDL tutorial 1 and VHDL tutorial 2 of these series.)

Next, compile the above program – create a waveform file with all inputs and outputs listed – simulate the project, and you will get the following result:

Simulation Waveform

From these output waveforms, we can easily say that the output of OR+NOT is the same as NOT+AND. It is highlighted in the figure. The other two outputs are also the same.

That means De Morgan’s theorems are proven.

In the next tutorial, we shall prove the NAND gate as a universal gate by designing AND, OR, NOT, XOR, and XNOR gates using only NAND gate.

You may also like:

  • beginners guide
    Basic Electronics 01 – Beginners guide to setting up an…
  • VHDL
    VHDL Tutorial 1: Introduction to VHDL
  • VHDL
    VHDL Tutorial 2: VHDL programs

  • What is an SoC?

  • What is electronic design automation?

  • What is an Integrated Circuit? Specifications to tapeout

Filed Under: Featured Contributions, Tutorials, VHDL, VHDL

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • 12VAC to 12VDC 5A on 250ft 12AWG
  • Engineer's own PCB layout software guide?
  • Zeropole...
  • Does mobility carrier ratio changes with Wn? (0.18um) inverter design
  • I think i have devised a new type of "super_transformer" for the Electricity grid?

RSS Electro-Tech-Online.com Discussions

  • Lightbox circuit
  • I want to make a CRT with some modifications But i have no Idea where to start
  • Kawai KDP 80 Electronic Piano Dead
  • LT3511 Isolated Flyback Converter
  • Funny Images Thread!

Featured – Designing of Audio Amplifiers part 9 series

  • Basics of Audio Amplifier – 1/9
  • Designing 250 Milli Watt Audio Power Amplifier – 2/9
  • Designing 1 Watt Audio Power Amplifier – 3/9
  • Designing a Bass Boost Amplifier – 4/9
  • Designing a 6 Watt Car Audio Amplifier – 5/9
  • Design a low power amplifier for headphones- 6/9

Recent Articles

  • ITG Electronics releases gate drive transformers with 200 – 450 V DC capability
  • Stackpole introduces HCJ jumpers with 70.7 amp continuous current capability
  • Infineon releases MCU with 128K flash and multi-sense capabilities
  • ST introduces 600V GaN gate drivers with 300 ns start-up time
  • ABLIC releases S-19116 automotive voltage detector with 6.8μs response time

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe