Adder Design using Behavioral, Dataflow and Structural modeling Simulation using Xilinx Vivado – JNTUH CMOS VLSI LAB 06

87 / 100
Reading Time: 10 minutes
adder
Adder Implementation Schematic

Welcome to our latest blog post, where we delve into the fascinating world of digital design using Xilinx Vivado. Today, we’re focusing on a fundamental yet incredibly versatile component of digital electronics: the full adder. This tiny powerhouse plays a crucial role in the arithmetic logic units at the heart of most digital systems, including computers and mobile devices.

Thank you for reading this post, don't forget to share! website average bounce rate Buy traffic for your website

 

In this blog, we will guide you through an experiment designed to not only teach you the workings of a full adder but also introduce you to three different modeling styles in Verilog: Behavioral, Dataflow, and Structural. Each style offers unique insights and benefits, and understanding them is key to becoming proficient in digital circuit design.

We’ll start by defining what a full adder is and the role it plays in complex digital systems. Then, we’ll explore how to design a full adder using each of the three Verilog modeling styles. The culmination of our experiment will be a practical session in Xilinx Vivado, where we will simulate a full adder.

Whether you’re a student, a budding engineer, or just a technology enthusiast, this experiment will equip you with the skills and knowledge to embark on your own digital design projects. So, let’s get started and dive into the exciting world of digital electronics with Xilinx Vivado!

Lab Report

AIM: Design of Full adder using 3 modeling styles

Apparatus / Software required:

  • Xilinx Vivado Design Suite
  • Windows Machine
  • Notepad or any text editor

Theory:

A full adder is a digital circuit that computes the sum of three binary bits, producing a sum and a carry output. It is essential in creating more complex arithmetic circuits like adders and multipliers. In Verilog, there are three primary modeling styles: Behavioral, Dataflow, and Structural. These styles not only offer different levels of abstraction but also help in understanding the flexibility and power of Verilog for designing digital systems. Below, we explore the design of a full adder using these three styles, and simulating it using Xilinx Vivado.

Behavioral Modeling uses high-level programming constructs similar to C or Python, making it straightforward to write and understand. It describes the circuit in terms of how the output relates to the input logically. For a full adder, this can involve using if-else conditions or case statements to determine the sum and carry based on the inputs.

Dataflow Modeling expresses the circuit in terms of data flow between operators. This style uses continuous assignments to describe relationships between inputs and outputs directly. It’s more hardware-oriented than behavioral, as it closely represents how data moves through the circuit.

Structural Modeling describes the circuit as a composition of lower-level components (like gates) and their interconnections. This is the most explicit way of describing a circuit and closely matches the actual hardware.

The table illustrating how inputs relate to the outputs in a full adder:

Input AInput BCarry InSumCarry Out
00000
00110
01010
01101
10010
10101
11001
11111

The full adder serves as a building block in designing more complex systems like the 4-bit comparator, where multiple full adders can be interconnected to compare two 4-bit numbers. The practical experience in simulation will help reinforce the theoretical concepts and demonstrate the practical usage of these modeling styles in real-world applications.

Procedure:

  1. Open Notepad or any text editor on a Windows machine and write the Verilog code for Full Adder using Behavioral, Dataflow and Structural modeling and corresponding testbench.
  2. Save the files with a .v extension, selecting “All Files” as the save type.
  3. Launch Xilinx Vivado from the desktop or start menu.
  4. Create a new project, naming it appropriately (e.g., full_adder_lab06) and choosing the project’s storage location.
  5. Ensure “RTL Project” is selected and specify sources at this time by pointing to the Verilog source code and testbench files you’ve created.
  6. Select the FPGA board or part targeted for this project using the search function.
  7. Run Behavioral Simulation to compile the Verilog files and execute the simulation based on your testbench.
  8. Inspect the waveform viewer to verify that the outputs match the expected results based on your testbench scenarios.
  9. Proceed with Synthesis and Implementation phases to optimize the design for performance and resource utilization.
  10. Analyze the simulation results, synthesized schematic, and implementation reports, making necessary adjustments to refine your design.

Code

Full Adder Behavioral Modeling:

Full Adder Dataflow Modeling:

Full Adder Structural Modeling:

Top-level module integrating all full adder designs:

Testbench for the Top module:

Results:

After following the steps correctly, the simulation in Xilinx Vivado will show the expected behavior for adder circuit, aligning with the input and output relations defined in the theory section.

Conclusion:

This lab experiment solidifies the understanding and application of adder digital design, showcasing the practical use of Xilinx Vivado in simulating complex VLSI components.

Viva-Voce Questions:

Here are ten viva-voce questions based on the experiment “Design of Full adder using 3 modeling styles” simulated using Xilinx Vivado:

Q1: What is the primary function of a full adder in digital electronics?

  • The primary function of a full adder is to add three bits of binary numbers: two significant bits and a carry bit from a previous addition, and it outputs a sum and a carry out.

Q2: Can you describe the three different modeling styles used in Verilog for designing a full adder?

  • In Verilog, the three modeling styles are Behavioral, which uses high-level programming constructs; Dataflow, which models the circuit based on the flow of data using expressions; and Structural, which constructs the circuit using interconnected lower-level components like gates.

Q3: What outputs do you expect from a full adder, and how are they derived?

  • A full adder outputs two bits: one is the ‘Sum’ bit that represents the sum of the three input bits, and the other is the ‘Carry Out’ bit that indicates whether there is an overflow that passes to the next highest bit position.

Q4: How do you use Xilinx Vivado for simulating a full adder?

  • Xilinx Vivado is used by setting up the Verilog code for the full adder, creating a simulation environment, compiling the design, running the simulation, and observing the output in the waveform viewer.

Q5: Why is it important to understand different modeling styles in Verilog when designing circuits like a full adder?

  • Understanding different modeling styles helps in choosing the right abstraction level for different stages of circuit design, optimizing for readability, reusability, and synthesis efficiency.

Q6: How do the inputs and outputs of a full adder relate to its function in a multi-bit adder system?

  • The inputs to a full adder (two addend bits and a carry-in) are fundamental in multi-bit adders where each full adder handles a bit position’s addition, and the carry-out connects to the carry-in of the next higher bit position, allowing for cascading sums across multiple bits.

Q7: What are some common errors to watch out for when simulating a full adder in Vivado?

  • Common errors include incorrect connections in structural models, miswritten expressions in dataflow models, or logical errors in behavioral models that could lead to incorrect sum or carry outputs.

Q8: How does the carry-out of one full adder connect to another in a multi-bit adder setup?

  • The carry-out from one full adder is connected to the carry-in of the next full adder in sequence, enabling the propagation of the carry through each bit position in multi-bit arithmetic operations.

Q9: What advantages does Xilinx Vivado offer for digital circuit design and simulation?

  • Xilinx Vivado offers robust debugging tools, a comprehensive simulation environment, hardware integration capabilities, and optimization tools that enhance the efficiency and accuracy of digital circuit design and testing.

Q10: How can the concepts learned from designing a full adder be applied to other digital design projects?

  • The concepts of bit-wise addition, carry propagation, and modular design using different modeling styles can be applied to designing more complex systems such as multipliers, counters, and arithmetic logic units in digital electronics.

Complete Detailed Procedure for Simulation in Xilinx Vivado

  1. Preparation: Before opening Vivado, ensure all Verilog source files and testbenches are correctly written and saved.
  2. Project Creation: Launch Vivado, create a new project, and specify your project’s name and location.
  3. Adding Files: Include your Verilog source and testbench files in the project setup.
  4. Selecting Target Device: Choose the FPGA board or part you’re targeting, based on your project requirements.
  5. Running Simulation: Utilize the Behavioral Simulation feature to compile and simulate your Verilog files.
  6. Synthesis and Implementation: After verifying the simulation results, proceed with synthesis and implementation to optimize your design.
  7. Analysis: Review synthesized schematics, implementation reports, and simulation results to ensure the design meets all criteria.
  8. Adjustments and Finalization: Make any necessary design adjustments based on your analyses and save your project.

Additional Reading:

  • FPGA Design Fundamentals
  • Verilog for Beginners
  • Advanced Digital Design with the Verilog HDL

FAQ

FAQ: Xilinx Vivado

Here are 10 additional frequently asked questions (FAQs) about Xilinx Vivado that expand beyond the basics previously provided:

Here are ten frequently asked questions (FAQs) regarding Verilog coding and modeling styles:

Q1: What is Verilog and why is it used in digital circuit design?

  • Verilog is a hardware description language (HDL) used to model and design digital systems at various levels of abstraction. It is used for creating, testing, and documenting digital designs.

Q2: What are the main modeling styles in Verilog?

  • The three primary modeling styles in Verilog are Behavioral, Dataflow, and Structural. Each style serves different purposes in terms of abstraction and control over the hardware design.

Q3: Can you explain Behavioral Modeling in Verilog?

  • Behavioral Modeling in Verilog uses constructs similar to traditional programming languages, like if-else statements and loops, to describe how the output of a circuit depends on its current state and inputs, focusing on what the circuit should do.

Q4: What is Dataflow Modeling in Verilog and when is it most useful?

  • Dataflow Modeling involves describing the flow of data through the circuit using continuous assignments with expressions. It is particularly useful for designing combinational logic where the outputs are directly related to inputs through some expression.

Q5: How does Structural Modeling differ from other modeling styles?

  • Structural Modeling in Verilog represents circuits as a series of interconnected components, such as gates and modules. This style directly reflects the physical layout of the hardware and is used for detailed, low-level circuit design.

Q6: What are the benefits of using Verilog for circuit design and simulation?

  • Verilog allows for precise control over hardware design, facilitates easy changes and iterations, supports both high-level and low-level design approaches, and integrates well with simulation and synthesis tools for testing and implementation.

Q7: How can one simulate a Verilog design?

  • Simulating a Verilog design typically involves writing a test bench that applies inputs to the Verilog module, simulating the module’s operation, and then observing the outputs to verify correct behavior.

Q8: What are some common pitfalls when writing Verilog code?

  • Common pitfalls include race conditions, non-synthesizable constructs, improper handling of non-blocking and blocking assignments, and misunderstanding the scope and lifetime of variables.

Q9: How do you choose the right modeling style for a Verilog project?

  • The choice depends on the complexity of the design, the level of abstraction desired, the specific requirements of the system being modeled, and the designer’s familiarity with the project’s goals.

Q10: What are best practices for debugging Verilog code?

  • Best practices for debugging include using simulation extensively, incorporating assert statements, checking for synthesis-simulation mismatches, modular testing, and utilizing linter tools to find syntax and logic errors.

Reference:

  • Official Xilinx Vivado Documentation
  • Digital Design and Computer Architecture by Harris & Harris
  • FPGA Prototyping by Verilog Examples by Pong P. Chu

Here are the reference links formatted for inclusion in your blog:

CMOS VLSI LAB CYCLE 01:

CMOS VLSI LAB CYCLE 02:

These resources provide a comprehensive overview and practical insights into various aspects of CMOS VLSI design, offering valuable information for students and enthusiasts interested in exploring the field of VLSI design using Xilinx Vivado and Microwind.

Dr. Honey Durgaprasad Tiwari, both the CTO at INKOR Technologies Private Limited, India, and a dedicated academic researcher, brings a wealth of expertise. With a Post-Doctoral stint at Sungkyunkwan University, Ph.D. in Electronic, Information and Communication Engineering from Konkuk University, Seoul, South Korea, and M.Tech in Embedded Electronic Systems from VNIT Nagpur, his research legacy spans wireless power transfer, medical imaging, and FPGA innovation. Notably, he has authored 40+ SCI papers, conference contributions, and patents, leaving an indelible mark on these fields. Holding pivotal Academic Administrative roles, including Head of Department and IQAC Coordinator, he passionately channels his insights into concise and impactful blogs, enriching the tech discourse. 🚀🔬📚

Leave a Comment

Adder Design using Behavioral, Dataflow and Struct…

by Dr. Honey Durgaprasad Tiwari time to read: 11 min
0