1 Answers
๐ Introduction to the Paper Computer
The paper computer is a physical model that mimics the fundamental components and operations of a real computer. It uses paper-based representations of memory, registers, and processing units to illustrate how instructions are fetched, decoded, and executed. This hands-on approach helps demystify computer architecture and programming concepts for beginners.
๐ฏ Objectives
- ๐ง Understand the basic architecture of a computer.
- ๐ข Learn how instructions are fetched and executed.
- ๐ Simulate simple programs using a physical model.
- ๐ก Develop problem-solving skills through hands-on activities.
๐ ๏ธ Materials
- ๐ Several sheets of paper
- ๐๏ธ Pens or markers
- โ๏ธ Scissors
- ๐ Ruler
- ๐งฎ Calculator (optional)
๐ฅ Warm-up (5 minutes)
Brainstorming: What are the main parts of a computer? (CPU, Memory, Input, Output). Briefly discuss each part's function.
๐จโ๐ซ Main Instruction
Step 1: Create Memory:
- ๐พ Divide a sheet of paper into equal-sized boxes (e.g., 16 boxes). Each box represents a memory location.
- ๐ท๏ธ Label each box with a unique address (e.g., 0 to 15).
Step 2: Create Registers:
- โ๏ธ Draw small boxes on another sheet of paper to represent registers. These will hold data and instructions temporarily.
- ๐ Label registers such as:
- Accumulator (ACC)
- Program Counter (PC)
- Instruction Register (IR)
Step 3: Instruction Set:
Define a simple instruction set. For example:
| Instruction | Opcode | Description |
|---|---|---|
| LOAD [address] | 1XXX | Load the value from memory address XXX into ACC |
| STORE [address] | 2XXX | Store the value from ACC into memory address XXX |
| ADD [address] | 3XXX | Add the value from memory address XXX to ACC |
| SUB [address] | 4XXX | Subtract the value from memory address XXX from ACC |
| HALT | 0000 | Stop the program |
Step 4: Write a Simple Program:
Write a program in memory using the instruction set. For example, to add two numbers (5 and 3) and store the result:
- ๐ Memory Address 0: 1009 (LOAD 9 - Load value from address 9 into ACC)
- ๐ Memory Address 1: 3010 (ADD 10 - Add value from address 10 to ACC)
- ๐ Memory Address 2: 2011 (STORE 11 - Store ACC value into address 11)
- ๐ Memory Address 3: 0000 (HALT - Stop the program)
- ๐ Memory Address 9: 0005 (Value 5)
- ๐ Memory Address 10: 0003 (Value 3)
- ๐ Memory Address 11: 0000 (Result will be stored here)
Step 5: Execute the Program:
- โ๏ธ Set PC to 0.
- ๐ Fetch the instruction at the address pointed to by PC (1009) and place it in IR.
- ๐ฆ Decode the instruction (LOAD 9).
- ๐ฅ Load the value from memory address 9 (5) into ACC.
- ๐ Increment PC to 1.
- ๐ Repeat the process for the next instructions (ADD, STORE, HALT).
- โ Observe how the values in ACC and memory change as the program executes.
๐ Assessment
Question 1: What is the purpose of the Program Counter (PC)?
Question 2: Explain the fetch-decode-execute cycle.
Question 3: Write a simple program to subtract two numbers using the paper computer.
Question 4: What happens if the HALT instruction is missing from the program?
Question 5: How does the paper computer simulate memory?
Question 6: What is the role of the Instruction Register (IR)?
Question 7: Can you modify the instruction set to include a new instruction (e.g., multiply)?
Join the discussion
Please log in to post your answer.
Log InEarn 2 Points for answering. If your answer is selected as the best, you'll get +20 Points! ๐