Peanut Butter and Jelly

Related classroom topics

Reverse Engineering, Computer Science, Electrical Engineering

Supplies Needed

  • A sample microprocessor to show the class
  • Chalk/chalkboard or white board pens or flip chart
  • Peanut butter
  • Jelly
  • Slices of bread
  • Dull knife
  • Spoon


1. Background

  • The microprocessor is the Central Processing Unit for the computer. It controls what the computer does.
  • Microprocessors follow a precise set of instructions called a program.
  • Microprocessors do very complex tasks by breaking them down into simple steps.
  • Microprocessors are often called the brain of the computer, but they are very different from a human brain.
  • This CPU is the central place where information is processed and it tells the other parts of the computer what to do by taking input and directing output. It only does what it is told to do.

2. Tell the class they are going to write instructions to program microprocessor that controls a robot. The program will be a set of instructions for making a peanut butter and jelly sandwich.

3. Place the bread, an open jar of peanut butter, an open jar of jelly, a knife, and a spoon on the front table.

4. You, the experiment presenter, will be the robot.

5. Ask the students to think about how to make a PBJ sandwich and how they would write the program. Students then write the program

  • 40 minute version—students work in small groups to prepare their program. Each group submits one set of instructions.
  • 25 minute version—ask the student for their first instruction, second, and so on. Write the instructions on the board. After the first four or five instructions tell the class you will now try the first few

6. Follow the instructions exactly. The instructions will be unclear and steps will be missing (like using a knife or the bread). If the instruction says “put the peanut butter on the bread” you might put the jar of peanut butter on the bread. The students should quickly see that instructions were not specific enough or possibly whole steps were omitted.

7. Once the class sees that more precious instructions are needed, have the students “reprogram”

8. Try the program again, summarize the lesson by reviewing the following:

  • Microprocessors can perform complex tasks when given a precise set of instructions that break that task down into simple steps.
  • The microprocessors can be programmed to handle different situations but unlike a human brain, the microprocessor cannot make decisions. Therefore the instructions or program must be very exact.


To make this more interesting and harder for older students have them “program” for more complex tasks. I.e. tying a shoe, putting on a coat, possibly changing a car battery.

Related Discussion topics

Computer Science, Programming, Computers, and General Engineering


Come up with detailed instructions so that you can prompt students to be more detailed in their suggestions.