Overview
This lecture introduces programs, programming languages, and explains the differences between machine language, assembly language, and high-level languages, including their translation processes.
Programs and Programming Languages
- A program (software) is a set of instructions that tells a computer what to do.
- Programming languages are used to write programs so computers can understand and execute instructions.
- Computers do not understand human language; instructions must be in a programming language.
Machine Language
- Machine language is the computer’s native language, written in binary (0s and 1s).
- It is machine dependent, meaning code differs between types of machines.
- Every program must be translated into machine language to be executed by a computer.
Assembly Language
- Assembly language uses keywords (like ADD, SUB) to make programming easier than machine code.
- It is also machine dependent.
- Assembly code must be translated to machine code using a program called an assembler before it can be executed.
High-Level Languages
- High-level languages use English-like statements, making them easier to learn and use.
- They are machine independent, so the same program can run on different machines.
- Each instruction in a high-level language is called a statement.
- Programs written in high-level languages are called source code.
Translation to Machine Code
- High-level language statements cannot be executed directly; they must be translated to machine code.
- A compiler translates the entire source code into machine code, creating an executable file.
- An interpreter translates and executes each statement one at a time, rather than the whole program at once.
Key Terms & Definitions
- Program (Software) — a set of instructions for a computer.
- Programming Language — system for writing programs computers can understand.
- Machine Language — binary code (0s and 1s) understood by a computer’s hardware.
- Machine Dependent — code that only works on a specific type of computer.
- Assembly Language — a low-level language with human-readable keywords, still machine dependent.
- Assembler — software translating assembly code to machine language.
- High-Level Language — programming languages using English-like syntax, machine independent.
- Statement — a single instruction in a high-level language.
- Source Code — a program written in a high-level language.
- Compiler — software that translates all source code to machine code at once.
- Interpreter — software that translates and executes source code one statement at a time.
- Executable — machine code file that can be run by a computer.
Action Items / Next Steps
- Review examples of machine, assembly, and high-level language code.
- Prepare for an introduction to variables and basic Java programming in the next lecture.