Experiment No. 1: Binary Codes

1  Introduction

1.1  Modular Design

The first set of experiments involve an aspect of digital logic design you will need to master in order to fulfill the final goal - the construction of a simple LED digital clock. We will be building the clock using modular design. In modular design, the goal is to construct separated modules which operate to fulfill a specific, preferably simple task. Each module accepts certain inputs and provides certain outputs. For this project, I would suggest the following basic modules: A combinational-logic-based display unit, sequential logic counter units, and a pulse generator unit. The display units must accept a BCD number as an input and output its value in the form of and LED seven-segment display. The counter units are the ``meat'' of the clock - given an input clock pulse, they must be able to count off hours, minutes and seconds in the form of BCD numbers. The pulse generator unit must be able to output a clock pulse as close to 1 Hz as possible. This first experiment will be to design a display module.

1.2  Display Module

As you have learned, binary codes such as BCD (binary coded decimal) allow you to represent a single decimal digit using 4 binary digits (bits). A 7-segment display has seven inputs, each of which controls one LED `segment.' Your task is to design the combinational logic which will drive this display. In particular, you must design the circuits to implement each of seven boolean functions of the form
segmenti = f(A,B,C,D) 

2  Experiment

2.1  Common Anode 7-Segment Display

First you must familiarize yourself with the displays we will be using in the project. It comes in 14-pin package form and can be plugged directly into the breadboard. One or both of the pins marked ``Common Anode'' must be connected to +5V through a 47W resistor. In order to light up segment a, the top segment, for instance, connect pin 1 to ground. (See figure ).

Figure 1: Pin assignments for seven segment display.

The purpose of the resistor is to limit the current going through the diodes in the display. The maximum current through the display should not exceed 30 mA. Can you figure out why a 47W resistor will do the trick? What happens when you connect the cathode to 5V instead of ground?

2.2  Driver Circuitry

Design a circuit that will accept four inputs (i.e. the BCD number) and output the state of, say, segment a. Use the procedure that you learned in class to generate a simplified two-level NAND gate circuit. You will only need inputs of 0-9, or 0000-1001, and to keep the circuit simple you can treat any inputs 1010 or higher as ``don't cares.'' Remember when you are figuring out the minterms that the LED turns on when it's grounded, so you'll need a logic 0 output when you want it to turn on. You have chips containing NAND gates having from 2 to 8 inputs. See figures - for their pinout diagrams. Note that for these chips pin 14 is connected to +5V and pin 7 is connected to ground.

Figure 2: 7400 2-input NAND gates.

Figure 3: 7404 Inverters.

Figure 4: 7410 3-input NAND gates.

Figure 5: 7420 4-input NAND gates.

For more convenient testing, you can use the dip switch unit to control the inputs. Connect four switches on the numbered side to 5V. Connect 1kW resistors from the side that says ``OPEN'' to ground. If you run wires from the side that says ``OPEN,'' you can switch these wires from 0 to 5V. See figure .

Figure 6: Wiring of the DIP switches.

2.3  7447 Decoder

As you may have noticed, to implement the entire BCD-7 segment decoder circuit will take many NAND gates and a lot of messy wiring. Now that you know how to go about implementing the decoder, though, you can take a shortcut and use the 7447 decoder chip. The 7447 is a 16-pin MSI (medium-scale integration) chip which contains all the circuitry you would have had to wire up. Hook pin 16 to 5V and pin 8 to ground. The pins of interest include the BCD inputs:
Pin  Input 

and the seven outputs:
Pin  Output 
13 
12 
11 
10 
15 
14 

Hook this chip up along with the 7-segment display and the dip switches and verify the operation of the display. Eventually you will need to make several copies of this module for your clock.