Summary
Highlights
A computer is a general-purpose machine that performs computational tasks through programs, which are sets of instructions. Without programs, a computer is essentially useless. There are system programs for managing hardware and application programs for specific user tasks. If existing programs don't meet a need, users can write their own.
Computers understand instructions in binary, a number system with only two digits: 0 and 1. This is because binary is easy to simulate in electrical hardware; for example, current flowing (1) or not flowing (0). A single binary digit is called a bit, and combining multiple bits allows for more complex values and data storage.
The Central Processing Unit (CPU) executes instructions. These instructions must be in machine language, which is a specific pattern of bits (1s and 0s) following predefined specifications for a given CPU architecture. An instruction is made up of an operation code (opcode) and operands. Machine language is specific to each CPU architecture, meaning a program in machine language for one CPU may not work on another.
Assembly language brought improvement by allowing more human-readable representations of machine language instructions, using keywords for opcodes and decimal numbers for operands. An assembler program translates assembly language into machine language. However, assembly language still remains strongly tied to specific machine architectures, limiting portability.
High-level languages were developed to be independent of machine architecture, providing more abstraction and making programming easier. Examples include C, C++, Java, and Python. These languages have more natural language elements, and while they still need to be translated into machine code, they offer greater portability.
High-level languages can be compiled or interpreted. Compiled languages like C use a compiler to translate source code into an executable machine code file. Interpreted languages like Python use an interpreter to analyze and run the source code directly, without creating a separate executable file.
C was developed around 1970 by Dennis Ritchie, who also created the UNIX operating system. C is a compiled, high-level language that is still very popular. Many other prominent languages derive their basic structure from C. Learning C provides low-level control over the machine and offers insights into computer architecture, making it valuable for computer science engineers.