作者:Harkerbest
声明:本文章为原创文章,本文章永久链接:https://www.harkerbest.cn/p/986, 转载请注明原文地址,盗版必究!!!
COMP1003 Computer Organization – Lecture 1: What is a Computer
1. Definition of Computation and Algorithm
- Computation: Any arithmetic or non-arithmetic calculation that follows a well-defined model, such as an algorithm.
- Algorithm Example: Euclid’s Algorithm for computing the greatest common divisor (GCD).
2. Human Computers
- Before modern computers, “computer” referred to a person performing mathematical calculations.
3. Comparison of Different Computing Devices
- Abacus vs. Modern Computer: Differences lie in speed, accuracy, and automation.
- Mechanical Computers vs. Modern Computers: Mechanical devices are limited in functionality compared to modern digital machines.
- Calculators vs. Modern Computers: Calculators perform specific mathematical tasks, while computers are general-purpose machines.
- Human Computers vs. Modern Computers: Machines replaced human labor for efficiency and complexity in computation.
4. Definition: Modern Computer
- A digital electronic general-purpose machine that automatically follows instructions (program) to solve problems.
5. Hardware vs. Human Brain Analogy
- Brain (CPU), Paper (Storage), Eyes (Input), and Hands & Pen (Output).
6. The Turing Machine
- Developed by Alan Turing in 1936, it is an abstract model of computation.
- Consists of a tape, read/write head, state register, and instruction table.
- The Church-Turing Thesis states that everything computable can be computed by a Turing machine.
7. Generations of Computers
- Generation Zero: Mechanical calculating machines (1642-1945).
- Generation One: Vacuum tube computers (1945-1953).
- Generation Two: Transistor computers (1954-1965).
- Generation Three and Four: Integrated Circuits (IC) and Very-Large-Scale Integration (VLSI) computers (1965-1980+).
8. The von Neumann Architecture
- Stored-program architecture: Both data and programs are stored in memory.
- Consists of CPU, ALU, registers, memory, I/O system.
- Von Neumann bottleneck: CPU faster than memory, forcing the CPU to wait for data.
9. Abstraction in Computing
- Abstraction: Simplifying a concept by focusing on important aspects and ignoring irrelevant details.
- It allows us to manage complexity by dividing systems into levels (hardware, software, etc.).
10. Levels of Abstraction in Computing
- User Level: Applications such as executable programs.
- High-Level Language: Programming languages like C, Java.
- Assembly Language: Low-level programming.
- Machine Language: Instruction set architecture.
- Control Level: Micro-code or hardwired.
- Digital Logic: Circuits and gates.
11. Hardware vs Software
- Hardware is faster but fixed, whereas software is more flexible but slower.
12. Transformation Levels
- Problems are broken down into algorithms and then implemented into programs. These programs are further transformed into machine instructions and circuit operations.
Lecture 2: Bits: Data Representation and Manipulation
1. Introduction
- Computers are essentially number-crunching machines that input, manipulate, and output numbers.
- Various number systems have been developed over time, such as Egyptian, Roman, Chinese, and Hindu-Arabic systems.
2. Binary System
- The binary system (base 2) is the foundation of computer operation, consisting of only two digits: 0 and 1.
- Leibniz’s Dream: Leibniz envisioned a machine using binary numbers for logical calculations, allowing problems to be solved like mathematical equations.
3. Bits and Bytes
- A bit (Binary Digit) is the smallest unit of data in a computer, representing either 0 or 1.
- Byte: A group of 8 bits. Computers handle data in chunks like bytes, words, etc.
4. Numeric Data Representation
- Unsigned Integers: Represent non-negative integers using binary digits.
- Signed Integers: Represent both positive and negative integers using a sign bit.
- Sign-magnitude, 1’s complement, and 2’s complement methods are used to represent signed integers.
- Two’s complement is the most commonly used method for representing negative numbers.
5. Base Systems
- Base 10 (Decimal): Human-readable numbering system.
- Base 2 (Binary): Used by computers.
- Base 16 (Hexadecimal): Common in computing for representing binary numbers more compactly.
6. Two’s Complement Representation
- A method for representing negative numbers by inverting all bits (1’s complement) and adding 1.
7. Real Numbers Representation
- Floating-point numbers: Real numbers are represented with a floating decimal point, enabling the representation of very large or small numbers.
- Example: IEEE 754 Standard for representing floating-point numbers (single and double precision).
8. Non-numeric Data Representation
- Computers also represent non-numeric data like text, audio, images, and video:
- ASCII Code: Represents text using binary values.
- Unicode: A larger character set supporting international characters.
- Digital Audio: Represented by sampling analog signals into binary.
- Images and Video: Represented as streams of pixels with color values in binary.
9. Operations on Bits
- Binary Arithmetic: Computers perform operations such as addition and subtraction using binary rules.
- Boolean Logic: Logical operations (AND, OR, NOT, XOR) are fundamental in computing.
10. Overflow and Sign Extension
- Overflow: Occurs when a calculated result exceeds the number of bits available.
- Sign Extension: Extending the number of bits of a signed integer by replicating the sign bit.
11. Boolean Logic Operations
- Developed by George Boole, these operations form the basis of decision-making in computers.
- Truth Tables: Used to evaluate the result of logical operations.
12. Exercises and Examples
- Practical examples are given on binary addition, subtraction, and conversion between base systems.
- Exercises focus on applying two’s complement representation, floating-point representation, and Boolean logic.
Lecture 3: Boolean Algebra – From Bits to Logic:
1. Introduction to Boolean Logic
- Computers use bits (0 and 1) to represent data, and Boolean logic is the system used to manipulate these bits.
- Boolean logic operations correspond to algebraic operations, making it a critical component in computer operations.
2. Boolean Algebra
- Algebra: The study of mathematical symbols and their manipulation. The term comes from the Arabic “al-jabr,” meaning “reunion of broken parts.”
- George Boole (1815-1864) created Boolean algebra, bridging logic and mathematics in his 1854 work, “An Investigation of the Laws of Thought.”
3. Boolean Variables and Operators
- Boolean Variables: Can only have two values (true/false, or 1/0).
- Boolean Operators:
- AND (A ∧ B)
- OR (A ∨ B)
- NOT (¬A)
4. Boolean Functions
- A Boolean function takes at least one Boolean variable and operator to produce a Boolean result (0 or 1).
- Example: F=X+YZ′F = X + YZ’F=X+YZ′
- Precedence: Operations follow the precedence of NOT > AND > OR.
5. Simplifying Boolean Functions
- Boolean functions are simplified to reduce the complexity of digital circuits, leading to cheaper, faster, and more power-efficient designs.
- Boolean Identities: These identities, such as (X+Y)′=X′Y′(X + Y)’ = X’Y'(X+Y)′=X′Y′, help simplify expressions.
6. DeMorgan’s Law
- DeMorgan’s law is useful for finding the complement of Boolean functions:
- (A⋅B)′=A′+B′(A \cdot B)’ = A’ + B'(A⋅B)′=A′+B′
- (A+B)′=A′⋅B′(A + B)’ = A’ \cdot B'(A+B)′=A′⋅B′
7. Canonical Forms
- Sum-of-Products (SOP): Logical expressions where different “product” terms are “summed.”
- Example: F=AB+A′CF = AB + A’CF=AB+A′C
- Product-of-Sums (POS): Logical expressions where different “sum” terms are “multiplied.”
- Example: F=(A+B)(A′+C)F = (A + B)(A’ + C)F=(A+B)(A′+C)
8. Binary Addition in Boolean Algebra
- Binary arithmetic operations differ from Boolean operations. Binary addition can be expressed using Boolean algebra and simplified for digital circuits.
9. Karnaugh Map (K-Map)
- A Karnaugh map is a visual method to simplify Boolean expressions, reducing the need for extensive Boolean identities.
10. Truth Table for Boolean Functions
- Truth tables represent all possible inputs and their corresponding outputs for Boolean expressions. They are essential for verifying the accuracy of simplifications.
11. Importance of Simplification
- Simplified Boolean expressions lead to more efficient hardware design, as simpler circuits require fewer components and resources.