Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

DS-A Lab 1: Combinational Circuits Part I

1Introduction

This lab consists of 3 parts. There exists a software tool called QuestaSim which can simulate the behavior of circuits described with SystemVerilog. In the first part of this lab, you will use QuestaSim to simulate a simple circuit. In the other parts, you will perform a few experiments to gain more insight in the behavior and design of combinational circuits.

2Homework

2.11A: QuestaSim Tutorial

Familiarize yourself with QuestaSim by going through the tutorial in the background material on Questasim.

2.21B.1: Logic Expressions

Determine the logic expressions for W, X, Y and Z in the circuit of Figure 1. Which logic function is realized with the circuit?

A circuit with NANDs

Figure 1:A circuit with NANDs

2.31B.2: Timing

The expressions of the assignment above give only the behavior in static condition. That is, the state that is finally reached after one or more inputs have changed. However, as we will see in this assignment, when going to the final state, temporarily transient effects (spikes) may occur at some nodes of the circuit.

Suppose that every gate has a gate delay time of tp = 10 ns (= 10-8 seconds). Complete the timing diagram of Figure 2 and indicate where spikes will occur.

Timing diagram

Figure 2:Timing diagram

2.41C: Design Combinational Circuit

Prime number generator

Figure 3:Prime number generator

This homework assignment prepares you to design a combinational circuit. The input is a 4-bit binary-coded number / vector that encodes the number sequence 0, 1, ..., 15. (See Figure 3) The output x should be 1 when the input represents a prime number, and 0 if not. Note that we don’t consider the numbers 0, 1, and 2 prime numbers. Complete the following steps:

Note: if you’re unable to install and run Espresso on your own computer, please perform the following steps during the course lab session in the Tellegen Hall.

Espresso is a two-level minimization program, which means that the minimized circuit has two levels (AND and OR, apart from any inverters for the input signals). When we allow multiple levels (for example by doing factorisation on the minimum logical expression) we can further reduce the number of components and inputs.

3Assignments

3.11A: Introduction SV and QuestaSim

In this assignment we will describe a circuit in SV and simulate it with QuestaSim. The circuit realizes the AND function by connecting an inverter to the output of a NAND gate, as shown in Figure 5.

The AND circuit

Figure 5:The AND circuit

Unzip labsDSA.zip (if you did not do so yet) and go to labsDSA/lab_1/a_introduction. The files you need in this assignment are and_circuit.sv and and_circuit_tb.sv. Go through the following steps:

3.21B: Spikes

In homework assignment 1B.2, you completed the timing diagram of the circuit in Figure 1 with gate delays of zero and 10 ns. The presence of a gate delay was able to cause short pulses in the output signal. We call these short pulses “spikes”. In this assignment you will simulate the a SV description of the circuit in QuestaSim, and measure a physical copy of the circuit using a function generator and an oscilloscope in the Tellegen Hall.

Spikes in QuestaSim

Open the file labsDSA/lab_1/b_spikes/spikes.sv. The delay time chosen here for each NAND is 10 ns. Simulate this file for 400 ns using QuestaSim using the included testbench. Compare the results with your answer for homework assignment 1B.2.

Repeat the simulation, but now make the delay time of each NAND gate 1 ns instead of 10 ns. What happens to the spikes?

Spikes in Real Life

You’ve been provided with a PCB with the circuit on it. Connect the PCB to the function generator, power supply and oscilloscope as shown in Figure 6:

Connecting the PCB

Figure 6:Connecting the PCB

3.31C: Minimization and implementation

Open the file labsDSA/lab_1/c_minimization. The file contains module descriptions of the following gates: a 2-input and a 4-input NAND gate, an inverter, and an XOR gate. The file also contains a module called prime, which is going to be an SV description of the prime circuit derived in homework assignment 1C.