Creating Circuit Diagrams

 


Introduction

In this activity you will experiment with digital logic design using the Logicly simulator.

There is no Markdown template for this assignment. As you create diagrams, save them to separate files (directions are below) or copy them into a document. When you are done, zip up your saved diagrams into a single file or save your document as a PDF. (Kit will accept a zip file or a PDF for this assignment.)

Reminder: A' means NOT A; A + B means A OR B; AB and A * B both mean A AND B.



Logicly

Start the Logicly simulator by going to https://logic.ly/demo/. If this does not work in your browser, you may download Logicly from https://logic.ly/.

  1. Experimenting with Creating Circuits
    AND circuit
    Add two Toggle Switches and an AND gate to your circuit board. Wire the two switches to the AND gate. Add a light bulb to your circuit board and wire the output of your AND gate to the light bulb. Once you have this simple circuit set up, experiment with flipping the switches to change the inputs to your AND gate. Make sure that the gate does what you expect it to do. Repeat the experiment with the OR gate and the NOT gate. There is nothing to turn in for this exercise.
  2. More Experimenting with Creating Circuits

    Here is the truth table for the Exclusive-Or (or "exactly-one") function (XOR):

    A  B  |  Out
    ------|----
    0  0  |  0 
    0  1  |  1
    1  0  |  1
    1  1  |  0 
    

    In the previous Circuit Diagrams assignment you identified 2 different Boolean expressions and circuit diagrams that implement the logic of the XOR function. Choose one of them and implement your expression using AND, OR, and NOT gates in Logicly. (In other words, do not use the built-in XOR gate.) Test your circuit to make sure that it generates the appropriate output for all possible inputs.

    Saving your work: You can take screenshots to capture circuit diagrams and copy them into a single document or save them as separate files to zip up later. Alternatively, if you have downloaded Logicly to your own machine, you can go to File->Save As to save your files. (Kit will accept a PDF or a zip file for this assignment.)

  3. Building a Half-Adder

    A "half-adder" adds two 1-bit numbers and produces 2 bits of output. The first bit, known as the "carry bit", is 0 except in the case of 1 + 1 = 10. The second bit is known as the "sum bit" (even though, technically, the actual sum is both bits together).

    Below you can see the four possible results from adding two bits (X and Y) as well as the truth tables for the sum and carry bits. Note that the truth table for the sum bit is the same as the Exclusive-Or (XOR) operation you have seen before, and the truth table for the carry bit is just an AND operation.

                                        Truth Tables for Sum and Carry Bits
            Addition of 2 bits:           
           --------------------            X   Y   Carry     X   Y   Sum
                                          -------|-------   -------|-----
       X:     0    0    1    1             0   0 |   0       0   0 |  0
       Y:     0    1    0    1            -------|------    -------|-----
             --   --   --   --             0   1 |   0       0   1 |  1
             00   01   01   10            -------|------    -------|-----
                                           1   0 |   0       1   0 |  1
                                          -------|------    -------|-----
                                           1   1 |   1       1   1 |  0
    

    In Logicly, build a circuit diagram for a half-adder that has two inputs and two outputs (the sum bit and the carry bit). Test that your circuit implements the truth tables above.

    Side Note: Why is it called a "Half-Adder"?

    The addition function in the Arithmetic/Logic Unit (ALU) is implemented as a chain of 1-bit adders. (Full adders, not half-adders.) To add 32-bit numbers, for example, an ALU would chain together 32 1-bit adders. Each adder adds together 2 bits (1 bit from each operand) plus the carry (if there was one) from the previous adder.

    A half-adder does approximately half the job of a full adder, adding just the 2 bits from the operands and ignoring the possibility of a carry from the previous bit.

  4. Building a Three-Input "Exactly One" Circuit The "exactly one" function can be generalized to any number of inputs. No matter how many inputs there are, the output is true if and only if exactly one of the inputs is true. In the previous Circuit Diagrams assignment you created a truth table and a Boolean expression for a three-input "exactly one" function. Implement your expression in gates using Logicly.

    Hint: Your Boolean expression probably included AND clauses with three terms. For example: A'B'C.
  5. Building a Half-Subtractor

    (IF YOU HAVE TIME) For this exercise build a "half-subtractor," as specified in the truth tables below. Like a half-adder, the half-subtractor has 2 inputs (X and Y) and 2 outputs, the amount and whether it is negative or not.

                                      Truth Tables for Neg? and Amount
         Subtraction of 2 bits:           
         ----------------------         X   Y   Neg?      X   Y   Amount
                                       -------|-------   -------|--------
       X:     0    0    1    1          0   0 | 0 (F)     0   0 |   0
      -Y:    -0   -1   -0   -1         -------|------    -------|-------
             --   --   --   --          0   1 | 1 (T)     0   1 |   1
              0   -1    1    0         -------|------    -------|-------
                                        1   0 | 0 (F)     1   0 |   1
                                       -------|------    -------|-------
                                        1   1 | 0 (F)     1   1 |   0
    

Submit your results

  1. Submit your solutions to the exercises above to Kit.