| Courses Wayne State University College of Lifelong Learning Interdisciplinary Studies Program Computers and Society courses, Winter 2001 ( http://www.cll.wayne.edu/isp/drbowen/casw01) Mondays, 6 - 9:40 PM in 113 Rackham GST 2710, Section 988, Call Number 95241, 4 credits AGS 3360, Section 983, Call Number 98319, 4 credits Office hours: Mondays 4 - 6 PM in 113 Rackham |
|
|
| David R. Bowen 2311 A/AB Wayne State University Detroit, MI 48202 |
Daytime tel: (313)
577-1498 Evening tel: (248) 549-8518 FAX: (313) 577-8585 Home Page: http://www.cll.wayne.edu/isp/drbowen Email: d.r.bowen@wayne.edu |
|
![]()
Last updated: 2/25/01
Link back to course Welcome...
Worksheet: Doing Binary Arithmetic With Switches

We start with a simple electrical circuit with a battery, a switch A and a light bulb C,
as in the figure above.

With the circuit shown, if the switch is up, there is a complete path for the current, the
current flows, and the bulb is on. Test the existence of a complete circuit by starting
out from the "+" battery terminal - the one with the little bump on the end, and
tracing around with your finger. The switch, "A", has a pivot or joint (the
little circle at the left), two contacts (the upper and lower little circles on the right)
and a switch element (the straight line, which pivots at the joint and is in contact with
either the uppor or lower contact). The switch provides a current path from the pivot to
whichever contact the switching element is touching. Electricity, and your finger, can
pass right through the pivot and contacts, but cannot jump between them - it can only take
the path laid out by the switching element. If you can find a complete path with no gaps,
then there is a complete circuit.

For the circuit shown, if the switch is down, there is no path for the
current, current cannot flow, and the bulb is off. Here, there is a gap when your finger
reaches the end of the down-pointing switch; there is no path from there to the rest of
the circuit on the right side.
In binary notation, if switch A is down, we will call that a zero; up and we will call it one. If bulb C is off, we will call that zero; on and we will call it one. The table below, that illustrates this, is called a "truth table." This is because, in logic, zero is frequently associated with False and one with True.
| A | C |
| 0 | 0 |
| 1 | 1 |
Fill out the truth table for the switch combination below. Now there are
two switches, A and B, and either one can be up (1) or down (0, for a total of four
combinations. Frequently there are switches at the top and bottom of a set of stairs,
wired in this parallel combination. If the light is off, flipping either switch turns the
light on. Similarly, if it is on, flipping either switch turns it off. NOTE: In this style
of electrical diagram, wires cross without making electrical contact.

| A | B | C |
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
Now fill out the truth table below for binary addition (C = A + B)
| A | B | C = A + B |
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
Homework:
Below there are two switches, A and B, wired in a combination known as
"series." Fill out the truth table for this arrangement. As before, either
switch A or switch B can be on or off, making for a total of four combinations. This
combination is used, for example, for a car radio, where both the ignition switch and the
radio switch have to be on, in order for the radio to be on.

| A | B | C |
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
Now fill out the truth table below for binary multiplication (C = A x B)
| A | B | C = A x B |
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |