# Teaching Digital Logic Fundamentals - Theory, Simulation and Deployment

## Überblick

Taking a hands-on approach to learning digital logic can be difficult without the need for students to learn complex hardware descriptive languages (eg. VHDL). Multisim Programmable Logic Diagram (PLD), along with support for leading Digilent teaching hardware, allows students to put the fundamentals of digital theory into practice. The PLD schematic allows educators and students to create graphical logic diagrams like those found in textbooks and deploy these to Digilent educational boards. In this set of tutorials we demonstrate how digital logic theory can be taught using educational hardware to provide a hands-on approach to learning.

View the complete Teaching Digital Logic Fundamentals tutorial series

## Introduction

Typically when students are learning digital logic fundamentals they are limited to theoretical understanding. Multisim allows students to put this theory into practice through schematic simulation and deployment to hardware. Multisim enables you to program your Digilent teaching boards directly from the Multisim environment, making the connection between theoretical concepts and hardware implementation more understandable.

This tutorial demonstrates the process a student can go through to learn Boolean logic and illustrates how, through using Multisim, students can apply this theory to hardware to see the physical response.

## Digital Logic Theory

When learning digital logic students will start with the three fundamental building blocks: AND, OR and NOT gates.

### AND

Boolean Expression: AB

### OR

Boolean Expression: A'B+AB'+AB

NOT

Boolean Expression: A’

Multisim allows students to interactively learn the action of these fundamental logic gates that make up the building blocks of all digital systems.

## Simulation of Digital Logic

In this tutorial we will learn the action of AND gates through simulation. Multisim provides interactive components and virtual instruments to help increase students' understanding.

1. Open a new blank schematic in Multisim.
2. Place down a two input AND gate from the component database. Right click and select Place Component. Choose the following parameters:

Database: Master Database
Group: Misc Digital
Family: TIL
Component: AND2

1. Place the component on the schematic.

`

1. In order to evaluate the behaviour of the component we will use a virtual switch and LED. Place the following components on the schematic.

1. Arrange the components on the schematic as below:

1. Wire the components together to create the digital logic circuit

1. Once we have completed our schematic we can evaluate the operation of the AND gate. The two switches and the LED are interactive components. Click Run on the tool bar shown below.

1. During execution toggle the switches and view the effect on the LED. The AND gate should respond according to the truth table below. When both switches are closed (high), the LED turns on. This allows the student to experiment with the switches to understand the AND gate operation.

1. Multisim also includes interactive instruments that we can connect to our schematic, as we would benchtop instruments. In understanding digital logic the Logic Converter is a powerful tool. The Logic converter allows us to obtain a truth table and Boolean expression for our circuit. Place a Logic Converter onto the schematic.

1. Connect the Logic Converter to the schematic as shown below. The Logic Converter allows multiple inputs with and a single output.

1. Double click the Logic Converter to open its user interface.
2. Click on the top conversion button as shown below. This is will analyze the schematic and create a truth table for the response.

1. Click on the next conversion button. This analyses the truth table and generates the Boolean expression. For an AND gate, the Boolean expression should be AB. The logic converter also allows students to input truth tables and Boolean expressions and generate logic diagrams.

1. This process can be modified to allow students to gain a comprehensive knowledge of different logic gates.

## Deployment of Digital Logic

Once students have gained insight through simulation of digital logic, they can continue this learning through deploying to Digilent Educational hardware.

This tutorial will provide an example of how students can create a Programmable Logic Design (PLD) and deploy this to Digilent hardware. The tutorial has been written using the Digilent Nexys 3 Board, but is the same process for all Digilent cards.

The Getting Started with Digilent Boards in Multisim tutorial will talk through the process for creating a PLD schematic for the Digilent board you are using.

1. Create a new PLD schematic for your Digilent board. Details of this process can be found within the Getting Started with Digilent Boards in Multisim. During the creation choose to Uncheck all when selecting the IO terminals to include on the schematic.

1. In this tutorial we are going to create an example that allows students to gain an understanding of the functionality of OR, AND and NOT logic gates. To add IO to the schematic, select either the input or output connector from the PLD toolbar. Click the input connector button.

1. This will display the input connector dialog and provide a list of all the IO on the Digilent board that has been designated as an input. From the list select switch 0 (sw_0) and click OK. Place the terminal on the schematic.

1. Repeat the process to add an input for switch 1 (sw_1).

1. Using the output connector button, create an output terminal for LED 0 (LED_0).

1. Open the Component Database (Right click > Place component), and place a 2 input AND gate.

Database: Master Database
Group: PLD Logic
Family: LOGIC_GATES
Component: AND2

1. Repeat this process to add inputs, outputs, and logic gates to demonstrate the OR and NOT gates. This will create a schematic similar to the image below.

1. Once the schematic has been created, we are ready to deploy the logic schematic to the Digilent board so students can physically manipulate the switches and view the response on the LEDs. Full details on deploying to Digilent cards can be found in the Getting Started with Digilent Boards in Multisim. Select: Transfer » Export to PLD from the menu bar. Here you will see the three export options. We want to export to physical hardware so select Program the Connected PLD. Click Next.
2. Choose the Xilinx tool to compile the Multisim PLD design to a programming file. If you installed the Xilinx ISE Tools to the default location, they should autopopulate. If not, click the Xilinx tool drop-down menu, select Manually select tool, and then browse to the file folder where the tools were installed. The Xilinx user constraint file contains directions that map the connectors in Multisim to the pins of the Xilinx FPGA, Part Number XC6SLX16.
3. At this point, you must connect the Digilent board to your computer. To check if all requirements have been met and the device is properly connected to Multisim, click the Refresh button. If the board is detected, the Device status displays Detected - Date and Time, as shown below.

1. To proceed, click Finish. This begins the 11-step process of programming the PLD. Multisim automatically invokes the Xilinx ISE Tools (Creates the Xilinx project, Checks syntax, Translates, Places & Routes, Generates the programming file, and so on).
2. Once the code had been generated and deployed to the Digilent board, the student can switch the switches and view the response on the integrated LEDs.

Using traditional teaching tools, a hands-on approach to learning Boolean logic is not possible until students have undertaken more advanced courses teaching them hardware description languages (eg. VHDL). Multisim simulation, PLD schematics and Digilent support provide an overall solution to allow students to learn through experimentation.