2019-2020-1 20175209 "Information security system design basis" the second week of learning summary

2019-2020-1 20175209 "Information security system design basis" the second week of learning summary

Textbook knowledge summary

  • Unsigned, complement, floating-point numbers are the three most important figures of our study indicate. In fact, note that complement coding is the most common method of signed integers, negative numbers are used in the form of a computer to store the complement; with two floating-point numbers as the base.
  • Due to the limited accuracy of the representation of floating-point operations are not bonded
  • C language allows between various data types do casts. Note, however, will be converted to an unsigned negative number may get zero results and force type conversion of bit values ​​remain the same, just change the way interpret these bits.
  • Zero extension and sign-extended: unsigned integer zero extension is applied, the sign extension is applied to signed integers.
  • Truncating numbers: In contrast with the expansion, truncation is used to reduce the number of digits of a number. When cut, abandoned high. For a digital x-bit, bits to be truncated to y, xy high bit abandoned. Which is equivalent to xmod2 power of y.
  • And operation method to distinguish the difference between the bit arithmetic and logical operations.
  • Logical Shift Right: >>> arithmetic right shift: >>
  • Unsigned multiply and complement, like the division is shifted. Unsigned division shifted up after 0, the division of the shifted complement S.1.

Textbook learning problems and solutions

  • Question 1: Exercises on page 48, looking at the list of disassembly time, do not understand the complement hexadecimal $,% rsp,% rax,% rid What does it mean
  • Solution: $ denotes an offset address, rsp, rax, rid pointer register is
  • Question 2: Float in the computer storage is what?
  • solve:
现代计算机中,浮点数一般采用IEEE制定的国际标准,形式如下:
Sign bit s Exponent e mantissa Total mantissa
Short real (single precision) 1 8 23 32
Real long (double-precision) 1 11 52 64
Temporary Real 1 15 64 80
  • Question 3: textbook on page 31 there is a previously had contact with the data type "size_t", explained the book is "the type of data that represents the preferred size of the data structure," but I still do not understand where the "data structure size "What means.
  • Solution: According to the analysis of the code, show_bytes function for printing each byte, size_t type variable i is the loop control variable, the maximum value of the number of bytes occupied by a type variable, I guess so size_t should be a similar variable of type int , then what is its relationship with integers is it? By searching for information, I found "size_t the value range is the maximum possible size of the array at the target platform," so it can be "cross-platform."
    Size_t different platforms will be implemented in different types, rather than using size_t or unsigned int can write better code extension lines. "

Last week, the wrong question summary

Compiled with gcc hello.c -o hello hello.c, hello does not exist () section

A..debug
B..text
C..line
D..rodata

The correct answer: A C

13. To construct an executable file, the main task of the connector with a ()

Generating a static library A.
B. symbol resolution
C. libraries were generated
D. relocations

The correct answer: B D

Guess you like

Origin www.cnblogs.com/wangzihong0213/p/11609463.html