UW CSE
Winter 2004
CSE467 Advanced Digital Systems Design
Instructor: Carl. Ebeling

Lab #2
DUE: One week from today at 1:30

Goal:

In this lab you will practice implementing a circuit using multi-level logic. You will also have to debug your circuit to make sure that it behaves correctly.

Read the entire lab assignment first before starting any design. If you don’t, you’ll have to do your design all over again because you’ll make assumptions that are wrong.

Design Problem:

Design a circuit that translates a 4-bit binary code to a 7-segment display code. You will only have to decode the digits 0-9; you may display anything for the inputs 10-15. Shown below is how the 7-segments are labeled by convention, and how the digits are formed.

 

  a     faaab   b   aaab   aaab  f   b  faaa   faaa  aaab  faaab  faaab

f   b   f   b   b      b      b  f   b  f      f        b  f   b  f   b

  g                 ggg    ggg    ggg    ggg    ggg         ggg    ggg

e   c   e   c   c  e          c      c      c  e   c    c  e   c      c

  d     edddc   c  eddd    dddc      c   dddc  edddc    c  edddc   dddc

Implementation:

You must design your circuit using only the logic gates in your design kits. This includes the following:

’00 : 4x 2-input NANDs

’02 : 4x 2-input NORs

’04 : 6x inverters

’08: 4x 2-input AND

’10: 3x 3-input NAND

’20: 2x 4-input NAND

‘138 : 3-8 decoder (with enable)

‘139 : 2x 2-4 decoder

‘151: 8-1 multiplexer

‘153: 2x 4-1 multiplexer

‘157: 4x 2-1 multiplexer

‘163: 4-bit counter (for testing)

 

You will need to look at the chip pinouts and the logic databook to figure out how these chips work. Don’t make assumptions. Remember, your design needs to use these, and only these chips. Your goal is to do the design with as few chips as possible. It is possible to do this with only 4 chips (plus the counter that will be used to test your circuit). The chance of failure rises quadratically with the size of the design, so it is in your best interests to keep your design small. Besides, we’ll give small amount of extra credit for especially good designs.

 

Take a look at the 7-segment display datasheet. You will see that each segment is an LED that shares a common anode with other LEDs. Actually there are two anodes. The LED is turned on by current flowing from the anode to the cathode. You do this by connecting the common anode to Vdd and the cathode of the segment to a chip output *through a 1K ohm resistor*. When the chip output is “high”, no current flows and the LED is off. When the chip input is “low”, current flows and the LED turns on. The resister keeps too much current from flowing. You need a resistor for each of the 7 segments.

 

Part 1: With Vdd of 5v and a resistor of 1K ohms, how much current flows? What is the max current per segment according to the 7-segment display datasheet? What is the max current that your chip outputs can “sink” when the output is low? (Note that the LEDs really need more current than we can provide with a logic gate, and drivers are usually used for this. But we will cut corners here to avoid wiring up even more chips.)

 

To test your circuit, connect the 4-bit counter to the inputs of your circuit and the outputs to the 7-segment display. Use a very slow clock from your clock generator to drive the counter. Note that this counter will produce all 16 values, including the 6 we do care about. Extra credit: Figure out how to get the counter to count from 0-9.

Constructing your circuit:

Take your time when putting together your circuit. It is best to draw a schematic of the circuit you want to implement, labeling each gate with the chip number and pin numbers so that you can easily check your wiring. You can label your chips with a sticky label, or you can assign labels based on location on your protoboard. Place your chips on the board to minimize the amount of wires, particularly long wires. When you wire your signals together, don’t route the wires over the chips. If you do, you won’t be able to change the chips if you fry one or it turns out to be bad. A careful job of wiring will pay you dividends when it comes to testing and debugging your circuit. Remember, do your wiring with the power turned off. Work in pairs, with one putting in the wires (use needle-nosed pliers) and the other reading the pin-numbers and choosing the appropriate length wire. Take turns.

Debugging your circuit:

You will find that incremental design generally works best. Construct and test a part of the circuit and make sure that works before adding to it. For example, you might implement a single segment just make sure you’re on the right track. Also, if the circuit doesn’t work, you know that the problem lies in what you’ve just added.

If you are lucky, your circuit will work first time. Otherwise, you’ll have to do some debugging. It’s not that different from software. Trace backward from the error to see what logic is wrong or where you’ve made a wiring error. Do this tracing using the logic probe. Note that the probe detects when a signal is not driven, i.e. tristated, and turns off both the red and green LEDs. You may also use the scope, but it’s overkill for this.

Deliverables:

Part 2: Turn in a copy of the schematic for your design. It is fine for this to be handwritten.

Part 3: Demo your circuit to the TA or instructor and have them sign your schematic that you turn in. Without this signature, you’ll have to do it again!