Soft Examination - Principles of Computer Composition

Principles of computer composition

Original code inverse code complement code shift code

A positive number:

Original code = inverse code = complement code

Code shift: invert the sign bit of the complement code

negative number:

Original code -> Inverse code: the sign bit remains unchanged, and the rest of the bits are all inverted

Inverse code -> Complementary code: +1 on the basis of inverse code

Complement -> Shift: Invert the sign bit

Indicates the range:

insert image description here

8-bit case:

Original code: -127 ~ 127 In case of +0 and -0: 0000 0000 | 1000 0000

Inverse code: -127 ~ 127 In case of +0 and -0: 0000 0000 | 1111 1111

Complementary code: -128 ~ 127 +0 and -0 are both 8 0s, so one more bit can be represented: 0000 0000

floating point number

N = M*R^e, M is the mantissa, e is the exponent, and R is the base.

1.19 * 10^2, 1.19 is the mantissa, 2 is the exponent, and 10 is the base.

CPU structure (concept)

insert image description here

Flynn taxonomy (concept test)

insert image description here

CISC and RISC (concept test)

insert image description here

Pipeline computing (computing)

insert image description here

Find the pipeline cycle ▲t:

The pipeline cycle refers to the period with the longest execution time, here is 2ns

Find the pipeline execution time:

Theoretical formula (80% inspection):

Execution time = (t1+t2+...+tk)+(n-1)*▲t

Pipeline execution time: 1 instruction execution time + (number of instructions - 1) pipeline cycle *

(2ns+2ns+1ns)+(n-1)*2ns, when there are 100 instructions, 5ns+99*2ns = 203ns

Practical formula (20% inspection):

Execution time = (k+n-1) * ▲t

Pipeline execution time: (total part + number of instructions - 1) pipeline cycle *

(3+100-1)* 2ns = 204ns

Find the throughput rate TP of the pipeline

insert image description here

Throughput TP = number of instructions/pipeline execution time

​ = 100 bars / 203ns

Maximum throughput = 1 / pipeline cycle = 1 / ▲t

Find the speedup ratio S of the pipeline

insert image description here

The speedup ratio of the pipeline S = Execution time without pipeline / Execution time with pipeline

= (2ns + 2ns + 1ns) * 100 / 203ns

= 500 / 203ns

Find the efficiency E of the pipeline

insert image description here

Pipeline efficiency E = shaded part / total part

​ = (▲t + ▲t + ▲t + 3▲t) * 4 tasks / 15▲t * 4

​ = 24▲t / 60▲t

​ = 4 / 15

Random access memory and read-only memory (address units and bits are counted)

insert image description here
insert image description here

The working principle of the disk (the maximum and minimum time of scanning records will be calculated)

insert image description here

computer bus

insert image description here

Reliability Calculation of Series System and Parallel System

check code

insert image description here

Learn Yard Distance

The CRC cycle check code can only detect errors, but not correct them.

Hamming check codes can both detect and correct errors.

Learn to calculate cyclic checksum

Remember that it is a modulo 2 division, and each time it is an XOR operation.

insert image description here

Learn to Calculate Hamming Code

insert image description here

Guess you like

Origin blog.csdn.net/weixin_45930241/article/details/124538082