Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Digital Design

Schematics Due Wed April 3rd by 11:59pm in your Lab06 GitHub repo

Tests: https://github.com/USF-CS631-S24/tests

Autograder: https://github.com/phpeterson-usf/autograder

Requirements

You will learn the basics of digital logic and digital circuits with the goal of learning enough to build a working computer processor. We will use the Digital application to build and simulate digital circuits:

https://github.com/hneemann/Digital

For this lab your are going to build and simulate some simple circuits.

Circuit 1: LEDs

  1. You will build a circuit in with two inputs and 4 LED output that shows how 4 basics gates work: NOT, AND, OR, and XOR.
  2. The LED will turn red when the input is high (1) and black when in the input is low (0).
  3. Here is a screen shot of the circuit you need to build and simulate. Note that you need to add labels to the inputs (A and B):

lab06-part01

Circuit 2: Max2

Consider the C code fragment below:

if (a > b) {
    r = a;
} else {
    r = b;
}
  1. We will assume that a, b, and r are 2-bit values. That is, the only values a, b, and r can be are 0 (0b00), 1 (0b01), 2 (0b10), or 3 (0b11).
  2. Your job is to use sum-of-products to come up with a Boolean algebra equation and a circuit that will compute the max value r (which is also a 2-bit value).
  3. Your inputs will be a1, a0, b1, b0 and your outputs will be r1 and r0. So, you will have two Boolean equations, one for r1 and one for r0.
  4. Since there are 4 inputs you will have 2^4 (16) rows in your truth table.
  5. Submit a working circuit that correctly produces the max value of the two inputs. You do not need to submit the truth table or Boolean algebra equation.
  6. Your circuit must have input names a1, a0, b1, and b0.
  7. Hint: you can build your sum-of-products by only considering the rows with output of 0, then invert the resulting equation. This will minimize the number of product terms.
  8. Your file must be called max2.dig

Circuit 3: 1-bit full adder

  1. In lecture, we built a 1-bit half adder (that is, an adder which does not have a carry-in) and showed the Boolean Algebra equation for a 1-bit full adder.
  2. You will build a 1-bit full adder in Digital, including a carry-in (cin) and a carry-out (cout). Your circuit must have inputs named a, b, and cin, and outputs named sum and cout.
  3. Your file must be named 1-bit-full-adder.dig
  4. Here are the truth table and sum-of-products equations for sum and cout

lab06-part03

Circuit 4: 8-bit Ripple Carry Adder

  1. Using your 1-bit full adder, build an 8-bit Ripple Carry Adder.
  2. Configure the 1-bit full adder symbol so that the cin is on the top and the cout in on the bottom. You will have to increase the height and width of the 1-bit full adder symbol in Edit -> Circuit Specific Settings.
  3. Your 8-bit Adder should have two 8-bit inputs (a and b), a 1-bit carry-in (cin), an 8-bit sum output, and a 1-bit carry-out (cout) output.
  4. You can configure inputs and outputs to be multiple bit inputs.
  5. You can use a splitter (in the wires section) to split an n-bit wire (a bus) into multiple 1-bit wires (actually the splitter is very flexible and can do more than this). You can also use a splitter to combine multiple 1-bit wires to create a n-bit wire (bus).
  6. Your file must be called 8-bit-ripple-carry-adder.dig
  7. Here is a picture of what a 4-bit Ripple Carry Adder looks like. Yours does not need to be identical.

lab06-part04

Circuit 5: SR Latch

A set-reset latch uses “cross coupling” to allow the two NOR gates to store 1-bit of information. Here are valid SR Latch states:

S R | Q notQ
0 0 | 0    1
1 0 | 1    0
0 0 | 1    0
0 1 | 0    1
0 0 | 0    1
1 1 | X    X (UNDEFINED)

Note the SR Latch does not have the clock as an input.

lab06-part05

Circuit 6: D Latch with Clear

The D Latch is built using the SR Latch. The clock is used to latch the D value. When the clock is high, the value D is stored in the SR Latch. When the clock is low, the D Latch holds its previously stored value. The CLR (clear) line sets the SR Latch to 0.

lab06-part06

Circuit 7: 1-bit 2-input Multiplexor (MUX)

The multiplexor is an extremely useful circuit that is used to select between multiple inputs. We need a MUX to build the D Flipflop with Enable and Clear.

lab06-part07

8: D Flip-flop with Enable and Clear

Unlike the D Latch, the D Flip-flop only stores the input value D on the rising edge of the clock (edge triggered). Using an edge triggered latch allows us to know when the state element will be updated.

lab06-part08

9: 8-bit Register with Enable and Clear

We can build an N-bit register using N D Flip-flops.

lab06-part09

Circuit 10: 8-bit Counter

We can now build and 8-bit counter using an 8-bit adder and an 8-bit register. Name your file 8-bit-counter.dig.

lab06-part10

Grading Rubric

Automated testing

100 pts: Automated tests

Circuit Quality

Keep your circuits organized and symmetric. Do not use diagonal wires even though Digital allows you to do so. For the circuit labs we will not look at circuit quality, but for the projects we will. However, it is best just to build clean circuits from the beginning. You also need to have a clean repo with no extra files.