Computer Science 237
Computer Organization

Williams College
Fall 2005

Lab 4: Digital Design Lab I
Due: Wednesday, October 12, 2005 at 11:00 AM

Lab meets this week in TCL 312b - the digital logic lab. Due to equipment and space limitations, we will break into smaller lab sections. Please arrive promptly at your assigned time.

Homework Problems

Please complete each of the following problems, and turn them in on this sheet.

  1. Gray code is an alternative binary representation of integers. Interestingly, incrementing a number in gray code causes the representation to change by exactly one bit. Consider the following table used to convert 3-bit binary integers into their gray code equivalents:

    gray code000001011010110111101100

    1. Construct three combinational circuits that compute the 1's digit, the 2's digit, and 4's digit of gray code. Please use the general or-of-ands network.
    2. Construct the simplest, most elegant circuit you can to convert a binary number (on three inputs) to a gray code number (on three outputs).
  2. In class you saw how any boolean function could be expressed in disjunctive form -- as a disjunction (or) of a set of terms (often called min-terms), each of which is a conjunction (and) of inputs or their negations. This is a very handy result, if you happen to be a digital circuit designer that has a very large pile of and and not gates, and one big or gate. What are you to do, however, if you have large piles of or and not gates, but only a single big and? Demonstrate that it is possible to express any boolean function as the conjunction of a set of terms, each of which is a disjunction of inputs. You should consider the following steps en route to your solution:
    1. Prove that deMorgan's law for converting conjunctions to disjunctions (with negations) holds for n>2 inputs.
    2. Prove that deMorgan's law for converting disjunctions to conjunctions (with negations) holds for n>2 inputs.
    3. Finish the proof.
  3. Suppose you are interested in constructing a circuit that is high precisely when four input lines DCBA represent a prime in 4-bit unsigned binary.
    1. Use a Karnaugh map to generate a logical expression with the smallest number of terms that computes this function. Do not optimize the expression further.
    2. Suppose we didn't care if the function worked on the range 12..15. What expression would you then generate?

Digital Design Lab

Hand in this lab worksheet along with the written homework problems.

Objective: To familiarize yourself with the workings of the digital lab and various simple TTL circuits.

When you enter lab, you will be handed a collection of TTL chips in antistatic foam. When you are not using the chips, please remember to return them to their antistatic containers. When the environment is dry, static electricity is a significant problem. The antistatic foam helps to dissipate any charges that otherwise might damage the chips.

You should have a number of different chips, including (but not limited to):

74LS00 Quad 2-input NAND
74LS04 Hex inverter
74LS08 Quad 2-input AND
74LS32 Quad 2-input OR

For this lab, you should complete solutions to each of the following questions. Each has several questions, which you should answer and submit with your lab writeup. Before moving from one question to the next, have the instructor or a teaching assistant check our your circuit.

  1. Other than those described above, what other chips do you have? For each, indicate its purpose. (hint: see the attached chip overview)
  2. As a warm-up exercise, construct a circuit that is equivalent to a 5-input AND gate. It lights LED 0 when SW0 through SW4 are all high (1). Strive to use as few chips as possible. Draw the pin-numbered logical circuit you will use before you begin wiring.
  3. Implement a two-input exclusive-or gate. An exclusive-or gate generates a high signal when exactly one of its inputs is high. You may use any circuit you wish, but it should light LED 0 when exactly one of the two switches SW0 and SW1 are set high (1). Draw the circuit you will use before you begin wiring.
  4. Extend the circuit in the previous step to light LED 1 when both switches are set high (1). This circuit is, of course, a half adder and sums two one-bit values. Can you wire together two half adders to make a full adder - a device that adds three bits together, generating a two-bit sum? (You needn't actually wire it, but draw the logical circuit here.)

    Move the wire from LED 0 to input "A" of the 7-segment display, and the wire from LED 1 to the "B" input. Finally, ground the "D1" input. What happens?

  5. Implement - draw a pin-and-chip numbered logical diagram on paper only - the half adder of the previous step using only 74LS00 chips.
  6. (Extra credit) Connect SW0 through SW3 to inputs "A" through "D" respectively. Next, switch each of the blue dip switches in succession. What happens? Now, describe the purpose of the chip in the upper left corner of the board. How many gates do you think it requires?

Lab attachment: Integrated Circuit Handouts