Computer Science-Introduction

    ## 计算机的运算基础
  • Symbology
    1. The positive and negative of the number means: "0" means positive and "1" means negative in the computer.
    2. Three representation methods of numbers: original code, one's complement and complement
    (1) The original code, complement and one's complement of a positive number are exactly the same.
    (2) The original code of a negative number is normal eg: 10001111 (-15)
    The inverse code of a negative number: The original code of the number is inverted except for the sign bit. eg: 11110000 (-15)
    The complement of a negative number: Inverse code plus 1 eg : 11110001 (-15)
  • Supplement: 1. The addition and subtraction of the original code must be calculated separately, and the symbol cannot participate in the calculation. 2. Inverse code addition and subtraction are combined, but the symbol cannot participate in the operation. 3. Complement code addition and subtraction combined, symbols can also participate in operations.
  • Floating point representation: 135.246=0.135246×10 to the third power.
  • Common information coding
    1. BCD code
    (1) Each decimal digit is represented by 4-digit = hexadecimal code: 0000~1001 represent 0~9.
    (2) When the decimal number is expressed by BCD code, it cannot be directly used for calculation or bit weight expansion.
    2. ASCII code
    3. Chinese character encoding (specified by GB2312-80, namely national standard code)
    (1) The binary encoding of 6763 commonly used Chinese characters is specified. (2) National standard code-location code. (3) Internal code: information coding. (4) Foreign code: the input method. (5) Font library
  • What is an algorithm?
    1. Features (1) finiteness: an algorithm must end after executing finiteness.
    (2) Certainty: Every step of the algorithm must be defined, and there must be no ambiguity.
    (3) Input: The algorithm has zero or more inputs.
    (4) Output: The algorithm has one or more outputs.
    (5) Feasibility: The calculations and operations to be performed by the algorithm must be quite basic, that is, it can be calculated accurately and can be completed.
  • Algorithm representation method
    1. Natural language (technology cannot be fully used)
    Disadvantages: (1) ambiguity (2) sentence length makes the algorithm long (3) serialization: it is difficult to clearly express (4) computer inconvenient translation
    2. Flow chart (Ie high school program block diagram)
    3. Pseudo code (text and symbols between natural language and computer language to describe computer tools)
    4. Computer programming voice (C++, C voice)

(Reposting is not allowed)

Guess you like

Origin blog.csdn.net/weixin_51535930/article/details/109333206