2019-2020-1 semester 20,192,423 "Introduction to cyberspace security professionals," the third week of learning summary

2019-2020-1 semester 20,192,423 "Introduction to cyberspace security professionals," the third week of learning summary

First, the study concluded

Chapter Six:
  1. Computer operations : programmable storage, retrieval, and processing
  2. Important characteristics of the virtual machine Pep / 8
    VM : the virtual machine to an important feature of the machine designed to simulate a real
    virtual machine Pep / 8: seven registers, comprising:
  • Program Counter (PC) , which contains a next instruction to be executed address.
  • Instruction register (the IR) , which contains a copy of the instruction being executed.
  • Accumulator (a special memory register), to store data and results of operations
  1. Instruction format  is generally a basic configuration instruction comprises two aspects: the operation code and operands, the operation code decision operations to be performed, the operand address data refers to participate in computing unit and located. Opcode and operands, the operation code decision operations to be performed, the operand address data refers to participate in computing unit and located. In the computer, and operations required operand address binary number represented by, respectively, the operation code and address code referred to, the entire instruction stored in the memory in the form of binary coded.

1, the program counter will be understood as a guideline, depending on the number of bits of memory address bits of the instruction memory.
2, when a predetermined number of bits depends on the length of the encoded instructions.
3, a general register bits depending on the machine.

  • Immediate addressing

The address field of the instruction operand address number is not indicated, but the operand itself, this addressing is called immediate addressing. H Features immediate addressing mode is an instruction execution time is very short, because it does not take the number of memory access, thus saving memory access time.

  • Direct addressing

Direct addressing is a basic addressing method, which is characterized by: an operand address in memory indicated directly in the address field in instruction format. Since the address of the operand is given directly without going through a transformation, this so called direct addressing mode addressing. Given directly involved in computing in the instruction operands and operation results are stored in the main memory address, i.e., the effective address is given directly in the instruction.

4. The machine language and assembly language

  • Machine language

The computer is not directly recognize what we write C programs or Java programs. It can only identify machine language, machine language and the computer is represented by a binary code to identify and directly executed by a machine instruction refers to a collection order.

Early computer refers to machine instructions may be executed, for machine operation. We used a PC, there is a chip, that is, we often say that the CPU can complete the previously mentioned features of your computer, but each of these microprocessors due to the different hardware design and internal structure (CPU), to require different levels of pulses to control, make it work. Therefore, each machine has its own microprocessor instruction set, which is the machine language. Written in machine language program, the programmer must first memorize the meaning of all the instruction code and the code used by computers. When the hand-programmed, programmers have their own storage allocation and processing each instruction and each input and output data have to remember what state during programming unit of work used in each step. This is a very tedious work. Time spent programming is often several times or several hundred times the actual running time, intuitive poor, but also prone to error. Then what should be done? This time it had assembly language.

  • Assembly language
    assembly language of the body is the assembly instructions. Machine instructions and assembler instructions difference is the representation of the instructions, assembler instructions are easy to remember machine instructions written format. Assembly language is a direct-to-processor programming language. The processor is operated under the control of instructions, the processor may identify the called machine instructions each instruction. Each set of instructions may be identified has its own processor, the instruction set is called. When the processor executes instructions to take different actions depending on the instruction, perform different functions.
  • To run an assembly language program steps :

Assembly language program into the assembler input, the output of the assembler machine code program

The branch circulation procedures and procedures

  • Branch program

int i = 5;
if (i == 5) {
// TODO
} else {
// TODO
}

  • 循环程序 循环结构是指在满足某一条件下进行循环操作,直到不满足条件,或者在循环体内break跳出循环,比如说:

for (int i = 0; i < 10; i ++) {
System.out.println(i);
if (i == 5) {
break;
}
} 上述就是一段循环结构,i在小于的前提下不断输出i的值,如果遇到i等于5,则退出循环。

6.伪代码:一种表示算法的语言

  • 变量:出现在伪代码算法中的名字,引用的是内存中存储值的位置。
  • 赋值:把值放入变量的方法.
  • 输入/输出:从外部世界向计算机中输入数据,将结果输出到屏幕上。
  • 选择:用选择结构可以选择执行或跳过某项操作。
  • 重复:用重复结构可以重复执行指令

代码覆盖测试法通过仔细检查程序的代码来决定程序的输入。
数据覆盖法则通过考虑所有可能的输入值来决定程序的输入。)

第七章:

1.计算机问题求解过程

  • -分析和说明阶段
  • 算法开发阶段
  • 实现阶段
  • 维护阶段

2.方法总结

  • 分析问题
  • 列出主要任务
  • 编写其余的模块
  • 根据需要进行重组和改写

3.有简单参数的算法:带有选择的算法、带有循坏的算法(技术控制循环、事件控制循环)
技术控制循环:可以指定过程重复的次数
事件控制循环:循环中重复的次数是由循环体自身内发生的事件控制的循环

数据有两种形式:不可分割的和复合的。数组是一种同构的结构,给出了一个有名称的元素的集合和允许用户访问个别元素在结构中的位置

4.有序数组中的顺序搜索

二分检索: 二分检索算法假设要检索的数组是有序的,其中每次比较操作可以找到要找的项目或把数组减少一半。二分检索不是从数组开头开始顺序前移,而是从数组中间开始。如果要检索的项目小于数组的中间项,那么可以知道这个项目一定不会出现在数组的后半部分,因此只需要搜索数组的前半部分即可。
然后再检测数组的“中间”项(即整个数组1/4处的项目)。如果要检索的项目大于中间项,搜索将在数组的后半部分继续。如果中间项等于正在搜索的项目,搜索将终止。每次比较操作都会将搜索范围缩小一半。当要找的项目找到了,或可能出现在这个项目的数组为空的情况,整个过程将终止。

5.排序

  • 选择排序:工作原理是:第一次从待排序的数据元素中选出最小(或最大)的一个元素,存放在序列的起始位置,然后再从剩余的未排序元素中寻找到最小(大)元素,然后放到已排序的序列的末尾。以此类推,直到全部待排序的数据元素的个数为零。选择排序是不稳定的排序方法。
  • 冒泡排序:它重复地走访过要排序的元素列,依次比较两个相邻的元素,如果他们的顺序(如从大到小、首字母从A到Z)错误就把他们交换过来。走访元素的工作是重复地进行直到没有相邻元素需要交换,也就是说该元素列已经排序完成。
  • 插入排序:每步将一个待排序的记录,按其关键码值的大小插入前面已经排序的文件中适当位置上,直到全部插入完为止。
  • 快速排序:通过一趟排序将要排序的数据分割成独立的两部分,其中一部分的所有数据都比另外一部分的所有数据都要小,然后再按此方法对这两部分数据分别进行快速排序,整个排序过程可以递归进行,以此达到整个数据变成有序序列。                                                                                                                                                                                                                                                 6.递归算法:是指可以在子程序自身中出现子程序名的算法。阶乘和二分检索实际上就是递归算法。

二、心得体会

通过对第六章的自我学习,了解了机器语言和汇编语言的概念,用伪代码编写算法的功能,了解了循环与选择的概念,并在Pep/8中以伪代码的方式出现。而第七章则是介绍了人类和计算机问题求解的方法,该章也介绍了子算法语句。

三、思考问题

1、对分支程序的概念存有模糊

2、如何运行汇编语言程序,这和源代码有什么关系?

Guess you like

Origin www.cnblogs.com/ayano/p/11723641.html