Chapter 3. Combinational Logic (Seven Segment Driver)

Chapter 3 Combinational Logic (Seven Segment Driver) 1 CHAPTER 3. COMBINATIONAL LOGIC (SEVEN SEGMENT DRIVER) 3.1 Section Overview Being able to...
41 downloads 0 Views 602KB Size
Chapter 3

Combinational Logic (Seven Segment Driver)

1

CHAPTER 3. COMBINATIONAL LOGIC (SEVEN SEGMENT DRIVER)

3.1

Section Overview

Being able to display numbers is useful for a variety of applications. Seven segment displays are used to display numbers in alarm clocks, VCRs, microwaves, and many other devices. Section 3 builds a seven-segment display decoder, which is described in Example 2.10 of the ECE 271 textbook. The decoder will take a 4 bit bus as input from buttons and output a 7 bit bus for the seven segment display.

3.2

Objectives

In this section, the following items will be covered: 1. Define the problem, what is the decoder really doing? 2. Define the inputs to the combinational logic. 3. Define the outputs from the combinational logic.

3.3

Materials

1. Lattice Diamond 3.5 software 2. MachXO2 Breakout Board 3. Seven segment display board (4digit.0) 4. Button board (8pushbtn.0) 5. USB to mini-USB cable

3.4

Procedure

There are 6 steps to digital logic design:

Figure 3.1: Use this process for designing the seven segment display.

3.5

Design

Figure 3.2 shows all of the different outputs that the seven segment decoder should produce. Shade in the segments that should be on for each input, 0-F.

Figure 3.2: The decoder should produce all 16 outputs

3.5. DESIGN

3.5.1

Make a block diagram

Turn in the block diagram as part of the study questions. Use clean paper and write neatly.

1. Add the power source used, if any, for each of the three blocks. See Figure 3.5 or 4digitSchematic in Appendix B f igureB.7 for information about how to power the 7 segment display board.

2. Label all FPGA pins that are used for this project on the block diagram.

Figure 3.3: Incomplete block diagram for the remote control

3.5.2

Make a functional truth table

1. Use the shading in Figure 3.2 and the diagram in Figure 3.4 to fill in the functional truth table below.

Figure 3.4: This diagram indicates which segments are which on the display (should match what was found in the pre-lab.)

CHAPTER 3. COMBINATIONAL LOGIC (SEVEN SEGMENT DRIVER)

Input Hex 0 1 2 3 4 5 6 7 8 9 a b c d e f

¯ C¯ D ¯ Inputs, A¯B 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

SegA 0

SegB 0

SegC 0

SegD 0

SegE 0

SegF 0

SegG 1

Make sure to double check the above table for accuracy. Errors this early in the design can lead to a lengthy debugging process.

3.5.3

Minimize the logic

1. Use seven K-maps to make minimized logic for SegA , SegB , SegC , SegD , SegE , SegF , and SegG . 2. Write out the minimized Boolean Equations for each output.

3.6

Design Entry

Enter the design using the same process as in Section 1. A larger workspace in Diamond will be needed to fit the entire minimized schematic. To change the schematic size click Edit → Sheet.

3.7

Design Simulation

Simulate the design to verify correct operation of the digital logic. Use Section 2 as a guide for this process.

3.8

Synthesize and Map Design

Follow the same process for using Spreadsheet View as in Section 1.

3.9

Program Hardware

1. Program the FPGA

3.10. STUDY QUESTIONS

3.9.1

Assemble Seven Segment Board,4digit.0

To assemble the Seven Segment Board, follow these steps. All required parts should be in the kit. 1. Open a webpage to tekbots.com. 2. Click on Hardware, and find the 4 Digit LED board. 3. Now that you are on the 4 Digit LED Board page click on Assembly Guide. Follow the guide to complete this task.

3.9.2

Test Hardware

1. Wire together the FPGA and Seven Segment Board as depicted in the block diagram made earlier. Refer to figure 3.5 for wiring instructions. Make sure that every labelled pin on the diagram is connected. The select pins should be attached according to the table on the left of the diagram. 2. Test to see if the buttons cause the correct outputs on the seven segment display.

Figure 3.5: Display Board wiring diagram.

TA Signature: (Seven Segment display is working and all lab steps are shown)

3.10

Study Questions

1. When is a simulation necessary? Was it useful for this section? 2. Attach the detailed block diagram, digital logic schematic, and simulation results for this project.

CHAPTER 3. COMBINATIONAL LOGIC (SEVEN SEGMENT DRIVER)

3.11

Challenge - Extra Credit

Connect the 7 segment display to the adder from section 2. Display the sum output from the adder onto the 7 segment display.