Tags

Activity Industry Sector
Engineering & Design

Activity Originally Created By: Wes Dennison

Guided Practice 20min

Part of Lesson Plan: B7- When Does 3 and 6 = 7- How Computers Calculate

Activity Overview / Details

Tell the students “Take out a sheet of paper and write your name in the upper right corner. Title the paper “Boolean Algebra Lab”. Now let’s do a problem together.”

Write these bytes on the board:

0 1 1 0 1 1 0 1   (109) AND
1 0 1 1 0 0 0 1   (177)
 

Walk the students through the process, adding each bit with the bit beneath it. If you added the decimal numbers, you would get 109 + 177 = 286.

0 1 1 0 1 1 0 1   (109) AND
1 0 1 1 0 0 0 1   (177)
1 1 1 1 1 1 0 1   (253)

But when you AND them you get 253!

Now let’s OR the same numbers.

0 1 1 0 1 1 0 1   (109) OR
1 0 1 1 0 0 0 1   (177)
0 0 1 0 0 0 0 1     (33)

When we OR these numbers, we get 33! But subtracting them would have given  us -68.

Now have the students make up two decimal numbers of their own and have them add them together using normal addition and then convert them to binary and AND them together using Boolean logic. Have them compare the two answers. Now have them do the same thing subtracting the numbers and then ORing them. Now have them give their two decimal numbers to a partner and have the partner independently add and AND and subtract and OR them. Have the students compare their results.