Software designers, referred to as software designers, are listed belowArticleI took some notes when preparing for the software designer exam, mainly reviewing the records of difficult problems encountered in this thick "Software Designer tutorial.
Directory
I. source code, anti-code, complement code and transfer code
Ii. Disk Storage Structure
Before talking about concepts
Before understanding these four terms, you must understand some basic knowledge: A value is expressed in the form of a machine number in a computer. It uses binary counting. Why is binary used? The computer only recognizes 0 and 1. Of course, the reason is that the high and low current pulses are used to represent 1 and 0, in this way, tens of thousands of transistors in the CPU use complex circuits to perform various complex operations.
Machine numbers are divided into unsigned and signed numbers. The signed numbers are also divided into pure integers and pure decimals. For example, 1234.04 and 3.14 are pure integers, and 0.01 are pure decimals. For the number of symbols, the highest bit of the number of machines is used to represent the positive and negative signs, where 0 indicates the positive number and 1 indicates the negative number.
Why do you need to use the original code, anti-code, and other operations? How do you have the basis of Electronic Circuits? I believe the teaching materials must have told you how to use the original code, anti-code, and complement code for a simple explanation.
In addition, you need to understand the concept of machine font length, which refers to the number of digits that the computer can perform in parallel operations. That is, the maximum number of BITs that can be performed by the computer generator at a time. The longer the machine word length, the higher the computing accuracy. Generally, the number of digits in the operating system is designed for the machine font length, such as Windows 32-bit operating system and 64-bit operating system. The 32-bit machine font can be considered as the 32-lane road of the CPU, and also because there is a road from CPU to memory (Front-End bus ), as well as the memory section (main memory font), there is memory to the peripheral chip (North Bridge south bridge) This section of the road (External Bus ).
Here, we will add another way to convert decimal places to binary decimal places: multiply the decimal places by 2 to get the integer part and the decimal part. The integer part is the corresponding binary digit, and then multiply the decimal part by 2, return an integer until the decimal part is 0 or the precision is reached. The first result is the highest bit, and the last result is the lowest Bit.
For example, calculate the binary value of + 0.52:
1. 0.52*2 = 1.04 (get an integer of 1)
2. 0.04*2 = 0.08 (get an integer to 0)
3. 0.08*2 = 0.16 (get an integer to 0)
4. 0.16*2 = 0.32 (get an integer to 0)
5. 0.32*2 = 0.64 (get an integer to 0)
6. 0.64*2 = 1.28 (get an integer of 1)
7. 0.28*2 = 0.56 (get an integer to 0)
......
If the length of the machine word is 8, the binary value of + 0.52 is 01000010. If it is 32 bits, it will take a while.
For decimal places smaller than-1, you need to split them into integer parts and decimal parts. The integer uses the division of the base and then the inverted remainder. The decimal point is described above. The following uses-6.25 as an example:
A. the integer is 6:
1. 6/2 = 3 (take the remainder 0)
2. 3/2 = 1 (take remainder 1)
3. 1/2 = 0 (the remainder is 1)
The binary value of integer 6 is 110.
B. the fractional part is 0.25.
1. 0.25*2 = 0.5 (take integer 0)
2. 0.5*2 = 1.0 (take integer 1)
Therefore, the decimal part 0.25 binary is 01. (This is a 6.25 binary representation without a signed bit) that is:
-6.25 indicates adding decimal places to the front, namely:
Original code
Defines the machine length as n. If the value x is a pure integer
If the value x is a pure decimal number, the original code of the pure decimal number is first converted to binary (required ~)
For example, if the machine word length is 8, then:
[+ 1] original = 0 0000001 [-1] original = 1 0000001 [+ 7] original = 0 0000111 [+ 127] = 0 1111111
[-127] original = 1 1111111 [-7] original = 1 1111000 [+ 0.5] original = 0♢1000000 [-0.5] original = 1♢1000000
For 0, the original code has two Representation Methods: [+ 0] original = 0 0000000, [-0] original = 1 00000000
Reverse code
The back code of the number of machines can be obtained from the original code. If the number of machines is positive, the reverse code is the same as the original code. If the number of machines is negative, the reverse code is obtained for the original code (except the symbol bit. It can also be expressed by a formula. If X is a pure integer, then:
If X is a pure decimal, then:
For example, if the machine word length is 8, then:
[+ 1] = 0 0000001 [-1] = 1 1111110 [+ 7] = 0 0000111 [-7] = 1 1111000 [+ 127] = 0 1111111 [-127] inverse = 1 0000000
[+ 0.5] inverse = 0♢1000000 [-0.5] inverse = 1♢0111111
For 0, there are two reverse code Representation Methods: [+ 0] = 0 0000000 [-0] = 1 1111111
Complement
The number of machines can be obtained by the original code. If the number of machines is positive, the complement code is the same as the original code. If the number of machines is negative, the complement code is the inverse of the original code (except the symbol bit,Add 1 moreAnd get (that is, add 1 to its anti-code ). It can also be expressed by a formula. If X is a pure integer, then:
If X is a pure decimal, then:
For example, if the machine word length is 8, then:
[+ 1] fill = 0 0000001 [-1] fill = 1 1111111 [+ 7] fill = 0 0000111 [-7] fill = 1 1111001 [+ 127] fill = 0 1111111 [-127] fill = 1 0000001
[+ 0.5] fill = 0♢1000000 [-0.5] fill = 1♢1000000
For 0, the complement code has a unique representation: [+ 0] fill = 0 0000000 [-0] fill = 0 0000000
Code Transfer
The shift code of the number of machines is defined by adding an offset to the number X. It is often used to represent the order code in the floating point number. The relationship between the QR code and the supplemental code is that the signed bits are the inverse codes of each other. If the machine word length is N, the offset is 2n-1. The transfer code is defined as follows:
If X is a pure integer, [x] shifts to 2n-1 + x (-2n-1 ≤ x <2n-1)
If X is a pure decimal, [x] shift = 1 + x (-1 ≤ x <1)
For example, if the machine word length is 8, then:
[+ 1] shift = 1 0000001 [-1] shift = 0 1111111 [+ 7] shift = 1 0000111 [-7] shift = 0 1111001 [+ 127] shift = 1 1111111 [-127] shift = 0 0000001
[+ 0.5] shift = 1♢1000000 [-0.5] shift = 0♢1000000
For 0, the complement code has a unique representation: [+ 0] shift = 1 0000000 [-0] shift = 1 0000000
Because there is a certain Conversion Relationship between the four data types, it is recommended that the original code be obtained first and then converted to the code system according to the relationship.
Refer:
Software Designer tutorial (Third edition), chapter 1, computer system knowledge, P4 ~ 6