Module 2 Unit 4 - Algorithms and Hardware#
Unit Learning Objectives#
By the end of this unit, you will be able to
Distinguish between software and hardware
Cooking with Code#
In a way, the cook who follows a recipe is the hardware that runs the algorithm. Without the cook, nothing happens. Same thing with the computer hardware. Without the computer (with its keyboard and screen, its memory, and processor), nothing would happen.
The input/output devices
Keyboard, monitor, microphone, camera, etc.
The Memory
Stores data: numbers, words, pictures, and code
Central Processing Unit (CPU)
Follows those instructions in memory
The Arithmetic Unit
Knows how to “do math” on numbers.
The CPU is the part that does all the work. It is at the center of all the activity in the computer. It follows the instructions in memory that might tell it to take numbers from the keyboard, display them on the screen, move them to memory, or do some math on them in the arithmetic unit.
So the algorithm is a list of instructions. The software are these instructions put into a language the computer can understand. This software is put into the computer memory, so the hardware (CPU) can follow those instructions and actually do something.
Activity#
If you think of the cook as “a computer,” her eyes and ears are input devices - like a computer camera and microphone. Her voice and hands are output devices – like the computer speaker, and maybe a robot arm. What is the cook’s memory unit? What is her “central processing unit?”
Is it possible that the cook’s brain has one part dedicated to memory, another part dedicated to following instructions?
A computer (or cook) might fail to complete a task because they miss a step in the algorithm. This could be because of an error in the software, or an error in the hardware. Can you describe what could cause these two types of errors?