Download presentation
Presentation is loading. Please wait.
Published byStewart Dickerson Modified over 8 years ago
1
CINAPTUS Technology Consulting Programming Concepts Simulating Computer Programming with Legos
2
CINAPTUS Technology Consulting 3/5/20042 Do Computers Think? The CPU is the “brain” of the computer Like the human brain the CPU processes signals and sends commands to other parts of the “body” However the CPU is only capable of processing and commanding according to its design – it is not capable of independent thought or reasoning
3
CINAPTUS Technology Consulting 3/5/20043 Instruction Processing The CPU is designed to process instructions Instructions are structured in a specific manner so that the CPU can understand them
4
CINAPTUS Technology Consulting 3/5/20044 Programs A collection of instructions is called a program The CPU executes a program by sequentially processing the instructions
5
CINAPTUS Technology Consulting 3/5/20045 Fetch – Decode - Execute The CPU processes a program by: –First, fetching an instruction –Then decoding it to translate it into a language the CPU understands –And finally executing it or performing the specified task(s)
6
CINAPTUS Technology Consulting 3/5/20046 Our “Language” The CPU “speaks” a language of 0’s and 1’s (binary) known as machine code We have created a simple language out of 1x1 Lego bricks that is somewhat easier for us to understand Each instruction consists of 6 bricks Our CPU is designed to decode each brick based on its color and position Our languauge allows the CPU to translate the 6-brick instruction into some meaningful task or tasks
7
CINAPTUS Technology Consulting 3/5/20047 Exercise #1 In our first exercise, each team will play the role of the CPU You will be given a program and you must: –fetch instructions one at a time –decode each according to the rules of our language –and execute the specified task(s)
8
CINAPTUS Technology Consulting 3/5/20048 Objectives For #1 An appreciation for the simplicity of the CPU’s processing –The CPU simply processes, it doesn’t think –Decoding is tedious but the CPU has no such emotion so it can handle (lots of) it An understanding of instruction abstraction
9
CINAPTUS Technology Consulting 3/5/20049 High-Level Languages Our CPU understands the simple Lego- based language We can continue to abstract higher-level concepts into a more sophisticated language
10
CINAPTUS Technology Consulting 3/5/200410 Exercise #2 In our second exercise, you will play the role of a programmer Using our language, you will build a program to instruct the CPU to perform a series of tasks (a program)
11
CINAPTUS Technology Consulting 3/5/200411 Objectives For #2 An appreciation for the delicate nature of programming instructions –Simple errors can have disastrous results An appreciation for the tedium of encoding An understanding of the limitations of our language and a sense of how to expand it
12
CINAPTUS Technology Consulting 3/5/200412 Expanding Our Language Binary vs. Decimal vs. Hex Machine Code vs. High-level Languages (vs. human languages) Expansion Opportunities –Use more bricks per instruction –Insert layers of abstraction
13
CINAPTUS Technology Consulting 3/5/200413 Building a Higher-Level Language Create instructions that are closer to the tasks that we understand –e.g., “display an E” vs. color a pixel red
14
CINAPTUS Technology Consulting 3/5/200414 Storing Programs Storage devices only understand binary and rely on electronic, magnetic and optical methods
15
CINAPTUS Technology Consulting 3/5/200415 Fetching CPUs can decode and execute much faster than they can fetch if the program is still in its storage device Copying the program into memory allows for much faster fetching
16
CINAPTUS Technology Consulting 3/5/200416 Decoding Parsing Looking Ahead
17
CINAPTUS Technology Consulting 3/5/200417 Execution Communication with devices, memory, etc. Interruptions Errors
18
CINAPTUS Technology Consulting 3/5/200418 Lesson Summary
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.