H2: Models and their Instances

A logic diagram consists of the following symbols (AND, OR, NOT) called gates:

Each gate has exactly one output (out) and 1 or 2 inputs (called left, right where the gate output is at the top and inputs are arranged at the bottom as shown above). A wire has 2 ports: from, to.  A wire connects from the output of one gate to the input of another. A pin is a label that is assigned to a gate input or output. 

A simple logic diagram D1 is shown below.  There are 5 pin labels (a, b, c, d, e).  There are 4 gates: and1, and2, or3, not4. Pin c corresponds to the left input of and2. There are 3 wires (w1, w2, w3). Wire w2 connects the output of and2 to the right input of or3.

Here is diagram D2 with 4 pins (a-d), 3 gates, 2 wires:

What to Submit

Submit a PDF with the following information, using the required format:
  1. define a UML class diagram to describe logic circuts.
  2. list constraints (in English) that would you want to enforce on your database.
  3. derive the database tables (no rows, only attributes) of your class diagram.
  4. populate your database with rows for diagram D1.
  5. populate another database with rows for diagram D2.