CSE 495D



CSE 171 Lab 5. October 11-13, 2004. Rev. A

EXPERIMENT: 4-Bit Gray Code to Decimal Converter

PRE-LAB

1. Study Section 6.4 Decoders and Encoders, pages 91-109.

2. Write an ABEL program BinToBCD.abl for a module Bin4BCD as a functional block with a 4-bit unsigned binary number input B3..B0 and a 5-bit BCD output P4..P0 where P4 is the ten's digit with a value of 0 or 1 and P3..P0 are the unit's digit with a range of 0 to 9. Include an interface statement and declarations for these inputs and outputs but do not assign pin numbers. Write equations to convert the 4-bit unsigned binary number input to a 5-bit BCD number output and write test vectors to test all possible states of the 4-bit binary input. Print out a copy of your BinToBCD.abl listing.

3. Write an ABEL program called GrayToBCD.abl as a top-level module Gray4BCD that combines the Gray4Bin module written for Group Homework #3 and the above Bin4BCD module to produce a 4-bit Gray code to decimal converter module. This GrayToBCD.abl program also incorporates the hex7seg module developed for Lab 3.

Using Figure 2 as a guide, declare the functional blocks shown, input signals Gray = [S7T1..S7T4] for the four toggle switches on S7, and the output signals shown. Write equations to connect the modules as shown. Do not include test vectors for this module. Print out a copy of your GrayToBCD.abl listing.

LAB

1. Create a new project Graycode in a folder called under C:\CSE171 using the Xilinx Project Navigator program and add a copy of your GrayDecode.abl file. Simulate your ABLE program and print out the BLIF Simulation Report, the Compiled Equations file, and the GrayDecode.abl file.

2. Create a new project, Lab5 in a folder called under C:\CSE171 and add a copy of your ABEL source BinToBCD.abl. Simulate your ABLE program and print out the BLIF Simulation Report, the Compiled Equations file, and the BinToBCD.abl file.

3. Add a copy of your GrayToBCD.abl file, a copy of your GrayDecode.abl file, and a copy of your 7-segment display decoder, hex7seg.abl. Generate a programming file and print out the GrayToBCD.abl file.

4. Connect the PC printer port cable to the PLDT-3 board, and then connect the 9V DC power module. Download your program to the Xilinx chip. The PLDT-3 board should now function as a 4-bit gray code to decimal converter.

5. The four right-most toggle switches provide the 4-bit Gray code input, the four right-most red LEDs display the four-bit unsigned binary equivalent, and the 7-segment display module displays the decimal equivalent of the Gray code input. Set the toggle switches to each of the given test values and observe the module output values displayed in the four red LEDs and on the 7-segment display. Record your observations in Table 1 below.

Table 1 – Experimental Observations

|Gray Code |Toggle Switch |Red LED Display Values |7-Seg. Display |

|Test Values |Settings (Binary) | |Values (Decimal) |

|(Hex) | | | |

| | |(Binary) |(Hex) | |

|0 | | | | |

|1 | | | | |

|3 | | | | |

|2 | | | | |

|6 | | | | |

|7 | | | | |

|5 | | | | |

|4 | | | | |

|C | | | | |

|D | | | | |

|F | | | | |

|E | | | | |

|A | | | | |

|B | | | | |

|9 | | | | |

|8 | | | | |

|0 | | | | |

6. Collect the following together with your name(s) on the front, demonstrate your design to your lab instructor and obtain his/her signature for your work.:

a) GrayDecode.abl and BinToBCD.abl listings.

b) BLIF Simulation Report listings GrayDecode.sm1 and BinToBCD.sm1 files.

c) Compiled Equations listings Gray4Bin.eq0 and Bin4BCD.eq0.

d) GrayToBCD.abl listing.

7. Erase your program and remove power from the Xilinx CPLD, delete the directory C:\CSE171\ that you created at the beginning of this lab, remove any other files or folders you put on the system and empty the Recycle Bin.

-----------------------

[bb,cc]

Figure 2. Top-level Module, GrayToBCD.abl.

[a,b,c,d,e,f,g]

(P4)

(P3..P0)

[Gray]

7

4

4

4

BCD

Bin4BCD

d7R

hex7seg

GtoB

Gray4Bin

4

1

[LED13..LED16]

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download

To fulfill the demand for quickly locating and searching documents.

It is intelligent file search solution for home and business.

Literature Lottery

Related searches