Top Banner
Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 [email protected]
57

Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 [email protected].

Dec 25, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Advanced Digital CircuitsECET 146

Week 3

Professor Iskandar Hack

ET 221B, 481-5733

[email protected]

Page 2: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

This Week’s Goals

Designing a Combinational Circuit from Truth Table

Introduction to the Programming Hardware Verifying a design in Hardware

Page 3: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Designing from a Truth Table

Write a Sum of Product Equation straight from the truth table

Draw the schematic from the Equation No Need to minimize equation (the software

will find the minimum solution for the Altera architecture)

Page 4: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Writing the Equation

Look at the Truth Table and everywhere the output is a one then you will generate a term in the Sum of Products

The term generated will depend on the values of ABCD in the table for that term.

If the value for an input is a zero then the term would contain an T-not

If the value for an input is an one then the term would contain T

Page 5: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Table Equivalent Terms

The Term for each of the entries is shown here

A B C D Term

0 0 0 0

0 0 0 1

0 0 1 0

0 0 1 1

0 1 0 0

0 1 0 1

0 1 1 0

0 1 1 1

1 0 0 0

1 0 0 1

1 0 1 0

1 0 1 1

1 1 0 0

1 1 0 1

1 1 1 0

1 1 1 1

DCAB

DCAB

DABC

ABCD

CDBA

DCBA

DCBA

DCBA

DCBA

CDBA

DCBA

DCBA

DBCA

BCDA

DCBA

DCBA

Page 6: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Example 1

Write the Equation for the following table

A B C D X

0 0 0 0 0

0 0 0 1 0

0 0 1 0 1

0 0 1 1 1

0 1 0 0 1

0 1 0 1 0

0 1 1 0 0

0 1 1 1 1

1 0 0 0 1

1 0 0 1 0

1 0 1 0 0

1 0 1 1 1

1 1 0 0 1

1 1 0 1 0

1 1 1 0 1

1 1 1 1 0

Page 7: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Comments regarding Example 1

There were 8 – ones in the table, thus there would be 8 terms in the equation

Each one will create exactly one term, that can be easily written by looking at the table and writing the term by looking at the values

Example if you look at the third line of the table A = 0, B=0, C=1, and D=0 and the output is 1. That would generate the term DCBA

Page 8: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Solution to Example 1A B C D X

0 0 0 0 0

0 0 0 1 0

0 0 1 0 1

0 0 1 1 1

0 1 0 0 1

0 1 0 1 0

0 1 1 0 0

0 1 1 1 1

1 0 0 0 1

1 0 0 1 0

1 0 1 0 0

1 0 1 1 1

1 1 0 0 1

1 1 0 1 0

1 1 1 0 1

1 1 1 1 0

DABCDCABCDBADCBABCDADCBACDBADCBAX

Page 9: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Drawing Schematic

Open Altera Quartus II Software File->New->Schematic File Insert Inputs and inverters to create inputs for

AND gates Draw AND gates, selecting appropriate inputs

for each OR the output of the eight AND gates Insert Output

Page 10: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Insert Inputs and Inverters

Draw the following circuit using INPUT and Inverters and draw the wires out ofeach inverter as shown

Page 11: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Name Pins and Nets

As in previous labs name the pins A-D

Click on each wire from the inputs and name them A-D

Click on each wire from the inputs and name them Anot-Dnot

Page 12: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Add AND4 Gates

Insert 8 – AND4 gates (remember one AND gate per term)

Page 13: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Connect Inputs to AND Gates Connect the four inputs to

the AND gates according to the equation.

This is done by drawing a small wire from each input and naming it as before.

Name them according to the equations from the previous slide

DCABDCABCDBADCBABCDADCBACDBADCBAX

Page 14: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

The AND gates Connected

Page 15: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Add OR8 and connect the Product Terms

Page 16: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Insert Output (and name it)

Page 17: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Completed Schematic

Page 18: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Save File

Click this to Create project

Page 19: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Creating the Project -1

First two screens take default and hit next

Page 20: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Device Number

Part Number (EP3C16F484C6N)

Page 21: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Creating the Project – II (Select Device)

Cyclone II Family

Need a specific device

Hit OK when done

EP2C20F484C7 isthe chip on the board

Page 22: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Compiling the Project

Hit the hot key on the top of the screen to start compiling your project.

Page 23: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

The Compiler

If you did everything right thus far you should see something like this:

Page 24: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Compiler Reports

The compiler creates a number of reports, which at this point would mean nothing to you, but you may want to explore them.

I/O pin info Boolean EQ

Page 25: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Comments regarding errors

It is very possible that you’ll get errors on this drawing. If so look for two connections on a wire to one of the AND gate inputs. This is the most common error. This often happens on the last AND gate if the wires brought down end at the same point you draw the wire across. Just delete the wire and redraw it.

Page 26: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Assigning Pins - I

Open the Pin Planner to

Assign the pins

Page 27: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Assigning Pins II Look at the data sheet for the

board and determine what your pin numbers need to be.

Page 28: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Assigning Pins III

Use four of the switches for the inputs Use one of the LEDs for the output

Page 29: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Assigning the Pins IV

Page 30: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Tristate Unused Pins

Device and Pin Options

Page 31: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Tristate Unused Pins II

Page 32: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Recompile after Assigning Pins and tristating unused pins

Page 33: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Check New Pin Assignments

Open the resource files to look at the pin assignment after recompiling.

Click to look at input pins Input pin assignments

Output pins

Page 34: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

NOTE:

The following slides were copied from Lecture two and the waveforms DO NOT match this example. They are included for instructional purposes only.

Page 35: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Drawing Waveforms for Simulation

We now need to create a new file to hold our simulation input waveforms. This done by hitting new and selecting Other and vector waveform file (vwf)

Page 36: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Entering Nodes

You will need to double click in the node area of the display – this will bring up the following dialog box

Select Node Finder

Page 37: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Entering Nodes II

(1) Start by selecting Pins: all

(2) Then hit List

(3) Move all pins to the rightby hitting >>

(4) Hit OK

Page 38: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Check if all nodes are selected

Verify in the waveform editor that all nodes are shown

Inputs

Output

Page 39: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Change Grid and End Time

Select Edit, Grid time, and change it to 50 nS

Select Edit, End time and change it to 1.6 uS

Page 40: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Grouping Inputs

Select all the inputs, right click, hit ‘Group’ and use inputs[3..0] for the name of the inputs, Hex as radix, and uncheck grey count

Page 41: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Display after Grouping

+ will expand group to show the individual pins- will hide individual pins

Page 42: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Using Count Function

Select the Group, and then hit the count button on the left side of the screen. Take the defaults (start at 0, incr by 1, End value F)

Page 43: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Display after Count

You should see the following after hitting OK

Page 44: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Save Simulation File

Up to now you should have seen that the output is neither high or low. That is because it has not been simulated yet.

In order to simulate you must first save the file as example1.vwf

Leave checked

Page 45: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Simulate

This is the easy part – Hit the simulate button on the top of the screen.

Simulate

Page 46: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Verify Simulation

You should have a value for the output for each input condition.

Manually determine (using techniques from ECET 111) what the output should be for each condition and verify that the output matches that.

Page 47: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Simulation Display

Page 48: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Connect the Altera Board to the PC

Check out an Altera Board from the Lab Tech office

Page 49: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Connect Board to PC I

When checking out board also check out DC wall pack. Ensure that the wall pack is of the correct polarity (+ is the center, - is the outside) and is between 9 and 12 volts.

Also get a Male -> Female DB25 cable to connect between the computer and the PC

Page 50: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Connect to PC II

Notice the location of the connectors used, the other DB25 connector is used for experiments.

DB25 Cable to PC DC Power connector

Page 51: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Open the Programming Module

Select the Programmer Hot Button

Page 52: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Select Programming Hardware

Once the programmer is opened – hit hardware setup

Then select Add Hardware

Selected USB Blaster

Page 53: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Select Programming Options

Select Program/Configure and Verify

Page 54: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Program the Part

Hit the start button You should see the

progress bar move during programming

Page 55: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Verify the Design

Switch the inputs thru the 16 possible combinations (0000 to 1111) to verify that the design matches the truth table

Page 56: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Summary

This week we covered how to go from any truth table to a schematic very quickly in the Altera software

We also went thru the procedure to specify a device, lock our input/output pins to particular pins and program the device

We also we over how to verify a combinational logic design using the Altera hardware

Page 57: Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B, 481-5733 hack@ipfw.edu.

Lab Two

Design a circuit and verify it using the techniques covered in this week’s lecture that will have the following truth table.

Turn in your printouts from the schematic editor and simulator.

Have myself or the TA initial the schematic to verify that your circuit worked

A B C D X

0 0 0 0 1

0 0 0 1 1

0 0 1 0 0

0 0 1 1 0

0 1 0 0 1

0 1 0 1 0

0 1 1 0 0

0 1 1 1 0

1 0 0 0 0

1 0 0 1 0

1 0 1 0 0

1 0 1 1 0

1 1 0 0 0

1 1 0 1 0

1 1 1 0 1

1 1 1 1 1