Grade 8
Grade 8
In computers, we write programs using special languages like Python, C, or Java, but the
computer only understands machine language (binary: 0s and 1s). So, we need something to
translate our code into machine language. That’s where interpreters, assemblers, and
compilers come in!
An interpreter is like a person who translates a speech line by line while someone is talking.
Example: If you write a program in Python, an interpreter reads and runs each line one at a
time. If there’s a mistake, it stops right there and tells you.
A compiler is like a person who translates an entire book before giving it to you.
Example: If you write a program in C, the compiler translates everything at once. If there are
mistakes, it shows all of them at the end.
An assembler is a translator for a special language called assembly language, which is already
very close to machine language.
Example: It’s like translating simple phrases instead of full sentences, making it easier for the
computer to understand.
Quick Summary:
• Interpreter → Translates and runs the code line by line. (Slower but easier to debug)
• Compiler → Translates everything at once before running. (Faster but needs to fix all
errors first)
• Assembler → Translates special low-level code to machine code.
1
The fetch-decode-execute cycle
The Fetch-Decode-Execute Cycle is the process that a computer’s CPU (Central Processing Unit)
follows to run instructions.
• Fetch → The CPU gets an instruction from the computer's memory (RAM).
• Decode → The CPU figures out what the instruction means.
• Execute → The CPU carries out the instruction (like doing a calculation or moving data).
After that, the cycle repeats for the next instruction. This happens extremely fast, allowing the
computer to run programs smoothly.
A CPU has three main components, and it uses these components when it is carrying out the
instructions in a computer program.
1. Arithmetic Logic Unit (ALU) - This part of the CPU performs calculations (addition,
subtraction, etc.) and makes decisions (comparisons like greater than or equal to).
2. Control Unit - The brain of the CPU that controls how data moves.
It fetches, decodes, and executes instructions by telling the ALU, memory, and
input/output devices what to do.
3. Registers – Store data about memory locations, instructions, and data used during the
execution of an instruction.
• Accumulator (ACC) - Stores the results of calculations from the ALU before sending
them to memory or other registers.
• Program Counter (PC) - Keeps track of the next instruction to be fetched. It increases by
1 after each instruction.
• Current Instruction Register (CIR) - Stores the current instruction that the CPU is
decoding and executing.
• Memory Address Register (MAR) - Holds the memory location (address) where the CPU
needs to fetch or store data.
• Memory Data Register (MDR) - Holds the actual data that is being fetched from or sent
to memory.
2
Machine learning
Machine Learning (ML) is a type of technology where computers learn from experience instead
of just following fixed instructions. The more data they get, the smarter they become at making
predictions or decisions.
Examples:
Self-driving cars → Learn how to recognize stop signs and traffic signals.
Voice Assistants (Siri, Alexa) → Learn to understand and respond to your voice.
Spotify/YouTube → Suggests songs/videos based on what you like.
Computerisation
Computerisation is when we use computers to do tasks that were once done by hand. It helps
make work faster, easier, and more accurate.
Examples of Computerisation
Saves time
Reduces mistakes
Makes work easier
Helps people communicate better