CSC 103: How Computers Work
HW 1: Digital Circuits with Boolean Logic
September 12 & 19, 2007
Exercise I: Practice using the Digital Circuit Simulator - in-class exercise on Sept 12
- To get started, download the
Circuit Simulator zip file
- Select "Open Using Winzip"
- When the zip file opens, double click simcir.jar
- Create a circuit with a single AND gate, and then with a single OR gate.
Test the input and output for each gate to make sure each is working correctly.
- A 'circuit' will have one power supply connected to all your input switches, which
are connected to the logic gates, and finally, the outputs from your logic circuit
are connected to LEDs, that will light up for an output of '1' and will remain
dark for an output of '0.'
- The 'toggle switch' is easier to use than the PushOn and PushOff switches.
- Have the truth tables handy for testing the inputs and outputs
- Use the switches for the inputs - try the different switches available (the toggle
switch is likely to be the most useful)
- Be sure to include a power source - you only need one - that is connected to each switch
- Add wires for connecting the gates by clicking on an ouput 'pin' and dragging
the wire to the desired input pin
- Use the LEDs for output
- To test the circuit, switch the inputs on and off to represent the input
sequences from the truth table, and check that the output LED is ON for
'1' and remains OFF for '0'
- Practice saving this file/circuit diagram and opening it up, so you are sure not to lose
your homework circuits below.
You DO NOT need to hand this part of the HW in - it is simply a good warm-up
Part II: Homework to Hand in - (1) Create a Half Adder Circuit
- Create the circuit for the one-bit half adder, with carry-out, from class.
- There is some information for this in the book on page 44.
- This circuit adds two 1-bit numbers.
- Have the truth table handy for testing the inputs and outputs
- To test the circuit, switch the inputs on and off to represent the input
sequences from the truth table, and check that the output LEDs respond
as expected.
- Save this file to hand in, and to use below. Check to see that
the .cml file is where you expect it to be and that you can open it.
(2) Create a Full Adder Circuit
- Now move on to creating a full-adder circuit. There is some information for this
in the book on page 46.
- A full-adder is also a circuit that adds two 1-bit numbers. The difference between the
full-adder and the half-adder is that the full-adder has a third input, for the
"carry-in" bit.
- For now, use a switch for the carry-in. For the final part of the
homework below, you will tie the "carry-out"
from one adder into the "carry-in" for the next one.
- Save this circuit and hand it in.
(3) Create a 2-Bit Adder Circuit - only do if you have time and interest
- A 2-bit adder is one that adds two 2-bit numbers
- We saw an example of this circuit in class - all you need to do is
implement it (this might be easier said than done though!)
- You may use a switch for the first carry-in. To connect the two
adder circuits, you will tie the "carry-out"
from one adder into the "carry-in" for the next one (as we saw in class).
- Save this circuit and hand it in.