Pages created and updated by Terry Sturtevant Date Posted: May 12, 2017

PC/CP220 Digital Electronics Lab

Introduction to Logic Analysis using a Computer Algebra System

In this tutorial, we will show you how you can verify logic equations using a Computer Algebra System.

The Problem

We are designing a circuit for an automatic door like those you see at supermarkets. The door should open only when a person is detected walking through or when a person presses a switch (such as the wheelchair button) to have the door open. The door should only operate if it has been unlocked.

The resulting logic equation is:
f = hc' + pc'

We can verify that this equations works using a CAS (computer algebra system) such as Maple or Maxima. A related system is Wolfram Alpha truth tables.

Computer Algebra Systems

There are several computer algebra systems. Two common ones are Maple and Maxima. Either one of these can be used for this exercise, although the syntax will be slightly different.
Maple is available on campus, but it's commercial so elsewhere you'd have to pay to use it. Maxima is free, so you can use it at home. There's also a website where you can use it online without downloading anything.
In either system, once you've typed in the equation, you can simply edit the line to substitute values for the inputs for each of the possible combinations without retyping the original equation. This prevents a lot of errors.

Maple syntax

At the prompt, type in the the command as shown:
  f:= (h and not c) or (p and not c); 

                    (h and not c) or (p and not c)

You can substitute in specific component values:
 subs( h=false, c=false, p=false, f);

Edit and re-execute the previous line for each input combination.

Maxima syntax

f:(h and not c) or (p and not c);
                    (h and not c)) or (p and not c)


Edit and re-execute the previous line for each input combination.

Demonstrate the results to the lab demonstrator.
(Note: If you do it outside the lab, you can print out a transcript of your session and bring it to the lab or save the session and load it in the lab.)


To view pdf documents, you can download Adobe Acrobat Reader .
get Acrobat Reader
If you need to update a browser, you might try Firefox which is Get Firefox!
Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try LibreOffice which is Get LibreOffice!

Go to the main page for the Department of Physics and Computer Science.

Valid XHTML 1.1

Valid CSS!

WCAG 2.0
(Level AA)

Wilfrid Laurier University