Assignments | Course Home | Schedule & Lecture Notes | Submit | Tutoring Hours

Saint Louis University

Computer Science 140
Introduction to Computer Science

Michael Goldwasser

Fall 2007

Dept. of Math & Computer Science

Assignment 04

Data Representation and Compression

Contents:


Overview

Topic: Gates and Circuits
Related Reading: Ch. 4
Due: 8pm Tuesday, 25 September 2007


Internet Requirements

For this assignment, we will rely heavily on the Logic Simulator software demonstrated in class. You will need to have an external Internet connection to run this software.


Practice Problems


Problems to be Submitted (20 points)

  1. (4 points)

    Use the Logic Simulator software to construct the circuit represented by the Boolean Expression AB + (B'+C)'. Save your circuit in a file titled solnA.dat to be submitted.

  2. (8 points)

    Complete Exercise 62 of Ch. 4 (p. 115) as follows, making sure to pattern your answer in the style of pp. 102-103 of the text.

    Most notably, your truth table must include a column representing the output of each intermediate gate within the circuit, and the label at the top of each column should give the appropriate Boolean expression (e.g., AB for the output of the first AND gate) for that intermediate value.

    You may do the problem by hand or you may wish to use the Logic Simulator as a tool. In any event, the only thing that must be submitted for this problem is a writeup of the truth table.

  3. (4 points)

    Consider a circuit with three inputs, denoted as A, B, and C, and a single bit of output that is set as follows. If we interpret the input bits as numbers 0 and 1, we would like the output bit to be true when A ≤ B ≤ C, and false otherwise.

    There are eight possible combinations for the input settings. Please give a truth table that lists all eight combinations along with the output setting for each case.

  4. (4 points)

    Use the Logic Simulator software to build a circuit that implements the A ≤ B ≤ C semantics discussed in the previous problem. After testing its validity, save it in a file named "solnD.dat" for submission.

Please type your answers to questions B and C in a single document to be submitted electronically. Submit the Logic Simulator files for problems A and D as well. Please see details about the submission process.


Extra Credit (2 points)

Interestingly, any given boolean function can be calculated by a circuit consisting solely of NAND gates. For intuition, it is possible to build a single input NOT by feeding that input into both inputs of a NAND gate. With the NOT and DeMorgan's laws, all other gates can be simulated using a circuit of NAND gates.

To demonstrate this principle, redo Problem D from above, however this time using only NAND gates. Submit your solution as a file named "solnExtra.dat".


CSCI 140, Fall 2007
Michael Goldwasser
goldwamh at our university domain

Last modified: Wednesday, 19 September 2007
Assignments | Course Home | Schedule & Lecture Notes | Submit | Tutoring Hours