Engineers Garage

  • Electronic Projects & 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

How to compile, simulate, and verify a Verilog program using MAX+II-Part 3

By Ashutosh Bhatt March 17, 2025

In the previous two tutorials, we covered the basics of Verilog and explored several example programs using different modeling styles. In this tutorial, we will focus on how to simulate and verify Verilog programs.

To edit, compile, execute (simulate), or verify a Verilog program, you will need a software tool like Xilinx’s ISE, Mentor Graphics’ ModelSim, Aldec’s Riviera, or Altera’s Quartus-II, among others. These are commercial simulators. For this tutorial, we will use Altera’s MAX+II, a VHDL simulator particularly suited for educators and students.

Follow these step-by-step instructions to build and simulate a Verilog program for any digital circuit using MAX+II:

Step 1. Launch the MAX+II software from the Start menu. The following screen will appear on your computer.

Step 2. Create a file (File Menu → New) and a new dialog box will open. Select text editor file and click OK.

This will open the text editor where you can write our Verilog program.

Step 3. Let’s begin with a simple half-adder program.

module half_adder(a,b,sum,carry);
  input a,b;
  output sum,carry;
    xor(sum,a,b);
    and(carry,a,b);
endmodule

Write this code in the editor area and save it

Step 4. To save the program, click the save button (or go to File → Save). A save dialog box will appear. Select the appropriate directory and folder (e.g., E:\verilog_programs\half_adder).

It’s recommended to create a new folder for each Verilog program. Also, avoid using spaces (” “) in the complete path of the program. Name the file the same as the module name, “half_adder,” and choose the .v extension. Refer to the following figure for guidance.

Once saved, you’ll see all of the keywords, such as “module,” “endmodule,” etc., are highlighted.

Step 5. Now, let’s set this to an active project. Go to File → Project. Set the project to the current file.

Note that MAX+PLUS II automatically sets the project name to match the current file. In this case, it’s half_adder.

Step 6. Compile the file by navigating to MAX+PLUS II → Compiler. The compiler window will appear. Press the Start button to initiate the compilation process.

When the compilation is complete, it shows “0” errors and “0” warnings. Click OK to finish the compilation.

Step 7. Next, we must create a waveform editor file to visualize the input and output waveforms. This displays the simulation results.

To create the waveform editor file, go to MAX+PLUS II → Waveform Editor.

The following waveform editor window should open.

Step 8. Right-click on the blank area. From the pop-up menu, select “enter node from SNF.”

A new dialog box will appear. First, select List, then click the ‘⇒’ button. Press OK to confirm your selection.

You’ll see all of the input and output signal waveforms (“a,” “b,” “sum,” and “carry”) appearing on the waveform editor window.

Here, the “xx” lines indicate the output signals, which cannot be edited. However, it’s possible to edit the “a” and “b” input signals.

Step 9. Zoom out of the waveform by pressing the minimizer icon (labeled “Zoom out” below) on left-hand side.

Enter the values “a” and “b” as “1” and “0” by selecting the appropriate areas (press and hold your mouse button to select). You can elect the values “1” or “0” from the let-hand side.

Set the “1” or “0” values of “a” and “b” as desired. Then, make all four combinations “00,” “01,” “10,” and “11” as shown here.

Step 10. Save the waveform file. By default, its name is “half_adder.swf”. Click OK.

Step 11. For the simulatation, go to MAX+II → Simulator.

 

Click Start on the simulator dialogue box. The dialogue box appears as “0” errors and “0” warnings if the simulation is successful.

Step 12. Click OK, and then open the wavefrom editor file to verify the result of the half-adder.

This is the step-by-step procedure to edit, compile, simulate, and verify any Verilog program.

In the upcoming tutorials, we’ll focus on simulating various digital circuits in Verilog using MAX+PLUS II.

 

You may also like:


  • What is Verilog, its features, and design flow?- Part 2

  • What are the fundamentals of Verilog programs?-Part 1

  • How to design a digital circuit using VHDL

  • What are the top tools for developing embedded software?

  • What is an embedded system?

Filed Under: Tutorials
Tagged With: max+II, simulate, software, tutorial, verilog
 

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

  • Reducing "shoot-through" in offline Full Bridge SMPS?
  • High Side current sensing
  • How to simulate power electronics converter in PSpice?
  • Voltage mode pushpull is a nonsense SMPS?
  • Layout IRN reduction in Comparator

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

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

  • Electronic Projects & 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