The notes come from the Wangdao postgraduate entrance examination video
Chapter One
Transmit information through electrical signals (low level represents 0, high level represents 1)
computer system
Computer system = hardware + software
software
system software | application |
---|---|
Operating system, database management system (DBMS), standard library (library functions used in programming), network software (implementing such as TCP/IP protocol), language processing program (converting high-level language into low-level language), service program ( Debugger) | WeChat, QQ |
Used to manage the entire computer system | Various programs compiled according to task needs |
Hardware development (logic element)
- The first digital computer: ENIAC (1946)-electronic tube
- Transistor (prototype with operating system)
- Small and medium scale integrated circuits
- Large-scale, very large-scale integrated circuits (operating systems appear)
- In 1947, Bell Laboratories invented the "transistor" (Shockley)
- In 1959, Fairchild Semiconductor Company invented "Integrated Circuit" (Eight Renegade)
- Moore, the creation of Intel (Moore's Law: The number of transistors that can be accommodated on an integrated circuit doubles every 18 months, revealing the speed of information technology progress)
Software development
Machine language -> assembly language -> high-level programming language
Current development trend
- More miniature, multi-purpose
- Bigger, super high speed
The basic composition of computer hardware
Early von Neumann machine
Features of von Neumann machine
- The computer consists of five major components
- Instructions and data are stored in the memory with the same status and can be accessed by address
- Instructions and data are expressed in binary
- The instruction is composed of opcode and address code
- Stored procedure
- Arithmetic center
Modern computer architecture
- Because the arithmetic unit and the controller are closely related, we integrate it into a whole CPU
- Input devices and output devices are collectively called I/O devices
- So the modern computer structure can be divided into:
- CPU
- Main memory (CPU and main memory are also called host)
- I/O device
Main memory: such as mobile phone running memory 8GB
Auxiliary storage: such as 128GB of body memory
Main memory
Storage> Storage Unit> Storage Unit
Arithmetic unit
Controller
Computer working process (example)
Computer system hierarchy
The program that translates high-level language into machine language is called translation program (including two types)
- Compiler: Translate all the statements of the high-level language program (source program) written by the user into a machine language program at once, and then execute the machine language program. Therefore, as long as the source program remains unchanged, there is no need to translate again
- Interpreter program: Translate a statement of the source program into a statement corresponding to the machine language, and execute this statement immediately, then translate the next statement of the source program, execute this statement, and repeat. Therefore, translate it once and execute it once, even if the sentence is repeated next time, it must be translated again.
The difference between computer architecture and computer composition principles
Computer performance indicators
Memory performance index
CPU performance indicators
Overall system performance indicators
Thinking
review
Chapter two
Base conversion
Convert other bases to decimal
Binary<–> Octal, Hexadecimal
Three binary digits correspond to one octal digit
Four binary digits correspond to one hexadecimal digit
Decimal -> Arbitrary
- Integer part: Divide the base and take the remainder
- Decimal part: multiply the base and take the remainder
Truth value and number of machines
BCD code
ASCII code
Chinese character representation
String representation
Parity check code
- Can only detect errors, not correct errors
Hamming check code
Cyclic Redundancy Check (CRC)
- Can detect errors, but cannot correct errors (in fact, when there are few information bits, sometimes it has the ability to correct errors)
Fixed-point representation
Unsigned number
All binary bits of the word length of the entire machine are numeric bits, without sign bits, equivalent to the absolute value of the number (usually an integer)
Signed number
Original code
Complement
Complement
Frameshift
- Can only represent integers
to sum up
The method of [-x] complement by [x] complement- sign bit, all value bits are inverted, and the last bit is increased by 1
The role of original code, complement, and frameshift
The role of the complement: transform the subtraction operation into an equivalent addition (that is, when adding a negative number, it is equivalent to adding the complement of the negative number)
The role of frameshift: easy to compare size
Fixed-point operations
Arithmetic shift right
Arithmetic shift left
Arithmetic shift
Arithmetic shift of complement
Arithmetic shift summary
For example
Logical shift
Cyclic shift
Addition and subtraction operations and overflow judgment
Addition and subtraction
- In the complement operation, the sign bit also participates in the operation
Overflow judgment
- After the operation, the double sign bit 01-indicates overflow; 10-indicates underflow
Sign extension
Source code multiplication
- The shift of the original code multiplication is a logical shift, and the sign bit also participates in the shift
Two's complement multiplication
Machine realization
- The last addition, because the sign bit also participates in the operation
- Complementary multiplication is arithmetic shift, and the sign bit is fixed.
- Shift right arithmetic for positive numbers, add 0 to high bits
- Negative number arithmetic shift right, high bit complement 1
Original code division
Machine realization: restoring remainder method
Restoring remainder method
No recovery remainder method (addition and subtraction alternate method)
- If the remainder is negative, the quotient is 0 directly, and the remainder is shifted one place to the left (multiplied by 2), and the divisor is added to obtain the new remainder
- The divisor must be smaller than the dividend, because the decimal binary digits cannot represent a number greater than 1, which means that the quotient in the first step must be 0
Two's complement division
Forced type conversion
Data storage and sorting
Large and small storage
Border alignment
Representation of floating point numbers
The range of fixed-point numbers is limited
The above floating-point number representation will lose precision, we can normalize its representation to reduce precision loss
Zuogui and Yougui
- When overflow, the highest bit of the double sign bit is the correct sign
Floating point number normalization characteristics
IEEE 754
triple
The true value of -128, -127 has other uses
So the true value range is -126~127
- Hidden represents the highest bit 1, in order to meet the characteristics of floating-point number normalization
Example
Maximum and minimum absolute value of IEEE single-precision floating-point number
Floating point operations
Forced type conversion
logic operation
Arithmetic Logic Unit (ALU)
Gate circuit
Compound logic
Adder
One full adder
Serial adder
Parallel adder
Adder, ALU improvement
Optimization of Parallel Adder