Fall 1998 Computers and Society
Tuesdays 6 - 9:40 PM in 113 Rackham: GST 2710, Section 990 and AGS 3360, Section 983
Mondays 5:30 - 9:10 PM at NWAC: GST 2710, Section 984

Last updated: 10/13/98
Link back to course Welcome...

Worksheet: Doing Binary Arithmetic With Switches

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


switch1.gif (579 bytes)
If the switch is up (closed) closed, there is a path for the current, the current flows, and the bulb is on.


switch0.gif (563 bytes)
If the switch is down (open), there is no path for the current, current cannot flow, and the bulb is off.


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.
parallel.gif (672 bytes)

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  

Assignment:

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.
series.gif (612 bytes)

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