Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

VHDL Tutorial – 8: NOR gate as a universal gate

By Ashutosh Bhatt

Note: it’s recommended to follow this VHDL tutorial series in order, starting with the first tutorial.

In the previous tutorial, VHDL Tutorial – 7, we learned how to build different gates (such as AND, OR, NOR, NOT, etc.) by using the NAND gate in VHDL — proving that the NAND gate is universal.

In this tutorial, we will learn how to:

  • Write a VHDL program to build all other gates (AND, OR, NOT, XOR, NOR, etc.) by only using the NOR gates.
  • Verify the output waveform of the program (digital circuit) with the truth table of the AND, OR, NOT, XOR, or NOR gates.

Truth table

To summarize, we’ll write a VHDL program, compile and simulate it, and get the output in a waveform. We’ll also verify the output waveforms with the given truth table.

First, it’s important to review the step-by-step procedure provided in VHDL Tutorial – 3. In that tutorial, we learn how to design a project, edit and compile a program, create a waveform file, simulate the program, and generate the final output waveforms.

VHDL program

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity nor_uni_gate is
    Port ( a,b : in std_logic;
           y_not,y_and,y_or,y_xnor,y_nand: out std_logic
           );
end nor_uni_gate;

architecture nor_uni_gate_arch of nor_uni_gate is

begin
   y_not <= a nor a;
   y_and <= (a nor a) nor (b nor b);
   y_nand <= ((a nor a) nor (b nor b)) nor ((a nor a) nor (b nor b));
   y_or <= (a nor b) nor (a nor b);
   y_xnor <= (b nor (a nor a)) nor (a nor (b nor b));
end nor_uni_gate_arch;

Note:

  • “entity” describes the input-output connections of the digital circuit. As per the circuit given above, we only have two inputs (‘A’ and ‘B’) and five outputs for the five circuits of the different gates built using the NAND gate. 
  • “architecture” describes the operation of the circuit, which refers to how the output is generated from the given input. 

To refresh your memory about how this works, go through the first two VHDL tutorials (1 and 2) of this series.

Next, compile the above program, creating a waveform file with all of the necessary inputs and outputs that are listed, and simulate the project. 

Here are the results…

Simulation waveform

From the output waveform, it’s easy to see that the output of the different gate circuits (built using only the NOR gates) is the same as the output of a particular gate.  

That means we can design all of the other gates by using only the NOR gate — meaning, the NOR gate is a universal gate. 

In the next tutorial, we’ll design a digital circuit from a given Boolean equation in VHDL. 


Filed Under: Tutorials, VHDL

 

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.

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!


Featured Tutorials

  • PS2 Keyboard To Store Text In SD Card Using Arduino Circuit Setup On Breadboard
    How To Use PS2 Keyboard To Store Text In SD Card Using Arduino- (Part 42/49)
  • Wireless Path Tracking System Using Mouse, XBee And Arduino Circuit Setup On Breadboard
    How To Make A Wireless Path Tracking System Using Mouse, XBee And Arduino- (Part 43/49)
  • How to Make a Wireless Keyboard Using Xbee with Arduino- (Part 44/49)
  • Making Phone Call From GSM Module Using Arduino Circuit Setup On Breadboard
    How to Make Phonecall From GSM Module Using Arduino- (Part 45/49)
  • How to Make a Call using Keyboard, GSM Module and Arduino
    How To Make A Call Using Keyboard, GSM Module And Arduino- (Part 46/49)
  • Receiving SMS Using GSM Module With Arduino Prototype
    How to Receive SMS Using GSM Module with Arduino- (Part 47/49)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What is a low power design?
  • Renesas partners with Tata to accelerate progress in advanced electronics
  • STMicroelectronics’ new touchscreen controller for smartphones enables longer runtime
  • Samsung unveils ISOCELL image sensor with industry’s smallest 0.56μm pixel
  • Renesas and Cyberon to deliver integrated voice-user interface solutions

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Atrduino IDE ompilation Error
  • Cadence Layout (LVS error in bulk connections)
  • FPGA LVDS with separate clock
  • Limits of duty cycle for ICM7555 IC?
  • 12V 5A needed

RSS Electro-Tech-Online.com Discussions

  • Lighting a .010 green fiber optic with led
  • Bridge purpose in connecting the two functional circuit
  • ICM7555 IC duty cycle limit at high frequency?
  • How to quickly estimate lead acid battery capacity ?
  • intro to PI
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 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 | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering