Analysis of real questions and answers in the morning for software designers in the first half of 2021 (1)

1. In the CPU, use ( ) to give the address in memory of the next instruction to be executed.
A. Program counter
B. Instruction register
C. Main memory address register
D. Status condition register
Reference answer: A
Answer analysis:

  • The program counter is where the address of the unit where the next instruction will be located is stored. Before the program is executed, the starting address of the program, that is, the address of the memory unit where an instruction of the program is located, must be sent to the program counter. When the instruction is executed, the CPU will automatically modify the content of the program counter, that is, the program counter increases every time an instruction is executed. A quantity that makes it point to the next instruction to point to. Operations such as program transfer are also implemented through this register.

  • The instruction register is generally used to save an instruction currently being executed.

  • The address register is generally used to save the address of the memory unit accessed by the current CPU to facilitate the read and write operations on the memory.

  • The state condition register (PSW, Program Status Word)saves various condition code contents established by the operation or test results of arithmetic instructions and logic instructions, such as operation result carry flag, operation result overflow flag, operation result is zero flag (C), (V)operation (Z)result is negative flag (N), interrupt flag (I), direction flags (D)and single-step flags, etc.

2. Among the following statements about RISC and CISC computers, the correct one is ( ).
A. RISC does not use pipeline technology, CISC uses pipeline technology
B. RISC uses complex instructions, CISC uses simple instructions
C. RISC uses few general-purpose registers, CISC uses many general-purpose registers
D. RISC uses combinational logic controllers, CISC generally adopts microcontrollers
Reference answer: D
Answer analysis:

  • The full English name of CISC is complex instruction set computerComplex Instruction System.
  • The full English name of RISC is reduced instruction set computerSimplified Instruction System.
  • Option A: RISC is suitable for pipelines, but CISC is not.
  • Option B: RISC is the abbreviation of Reduced Instruction Set System Computer, which uses simple instructions. CISC is the abbreviation of Complex Instruction Set System Computer, which uses complex instructions.
  • C option: RISC multi-register addressing, so general-purpose registers will be added in the implementation process, and CISC does not need to use many general-purpose registers.
  • D option: RISC is realized by hard-wired logic (that is, combinational logic controller), and CISC is realized by microcode (that is, microprogram). The statement in option D is correct.
    insert image description here

The addressing modes of instructions include sequential addressing mode and jump addressing mode:

  • In the sequential addressing mode, when a program is executed, it is executed sequentially one instruction after another.
  • The jump addressing mode means that the address code of the next instruction is not given by the program counter, but given directly by the instruction. After the program jumps, it starts to execute sequentially according to the new instruction address, so the content of the program counter must also be changed accordingly, so as to track the new instruction address in time.

The addressing modes of instruction operands include immediate addressing mode, direct addressing mode, indirect addressing mode, register addressing mode, and other addressing modes.

  • Immediate addressing mode: The address code field of the instruction indicates not the address, but the operand itself.

  • Direct addressing mode: Directly point out the address of the operand in the main memory in the address field of the instruction.

  • Indirect addressing mode: The address of the operand is stored in the storage unit pointed to by the instruction address code field.

  • Register addressing mode: The address code in the instruction is the encoding of the register.

The principle of the instruction pipeline is to divide the instruction into different segments, and each segment is processed by a different part, so it can produce a superimposed effect, and all components process different segments of the instruction.

3. When using DMA to transfer data, each data transfer needs to occupy one ( ).
A. Instruction cycle
B. Bus cycle
C. Storage cycle
D. Machine cycle
Reference answer: C
Answer analysis:

  • DMA stands Direct Memory Accessfor Direct Memory Access.
  • DMA transfers copy data from one address space to another, providing high-speed data transfers between peripherals and memory or between memory and memory. When the CPU initiates the transfer action, the transfer action itself is implemented and completed by the DMA controller.
  • The DMA transmission method does not require the CPU to directly control the transmission, nor does it retain and restore the scene process like the interrupt processing method, and opens up a channel for direct data transmission for RAM and IO devices through hardware, which greatly improves the efficiency of the CPU.
  • The storage cycle refers to the minimum time interval required between two start-up operations of the main memory, and is also called the main memory cycle time.
  • DMA obtains control of the memory bus simply for memory access, so only one access cycle is required.

4. In the following description about flash memory (Flash Memory), the wrong one is ( ).
A. Information will not be lost after power failure, which belongs to non-volatile memory
B. Delete operation is performed in units of blocks
C. Random access method is used, which is often used to replace main memory
D. Flash can be used instead of ROM in embedded systems Memory
reference answer: C
answer analysis:

  • Flash Memory (Flash Memory) is a long-life non-volatile memory (it can still maintain the stored data information in the case of power failure). Data deletion is not in single byte units but in fixed blocks. The block size is generally 256KB to 20MB.
  • Flash memory is a variant of electronically erasable read-only memory ( EEPROMEEPROM). Unlike EEPROM, it can 字节be deleted and rewritten horizontally instead of erasing the entire chip, so that flash memory can be updated faster than EEPROM. Because of its ability to retain data when power is lost, flash memory is often used to store setup information.
  • Flash memory does not rewrite data in units of bytes like RAM (Random Access Memory), so it cannot replace RAM, nor can it replace main memory, so option C is wrong. But in embedded, flash memory can be used instead of ROM memory.

According to the different storage principles on the hardware, Flash Memory can be mainly divided into two types: NOR Flash and NAND Flash. The main differences are as follows:

  • The reading speed of NAND Flash is similar to that of NOR Flash, and varies according to the interface;
  • The writing speed of NAND Flash is much faster than that of NOR Flash;
  • The erasing speed of NAND Flash is much faster than that of NOR Flash;
  • The maximum number of erasing times of NAND Flash is more than that of NOR Flash;
  • NOR Flash supports on-chip execution and can run code directly on it;
  • NOR Flash software driver is simpler than NAND Flash;
  • NOR Flash can read data randomly by byte, while NAND Flash needs to read by block;
  • The cost of NAND Flash under large capacity is much lower than that of NOR Flash, and the volume is also smaller.

5. If the rotational speed of the disk doubles, then ( ).
A. The average access time is halved
B. The average seek time is doubled
C. The rotation waiting time is halved
D. The data transmission rate is doubled
Reference answer: C
Answer analysis:

  • The average access time and data transfer rate of the disk are related to the disk rotation speed and arm movement scheduling time, so the efficiency cannot be directly improved by doubling the disk rotation speed.
  • The average seek time of the disk has nothing to do with the rotation speed of the disk, but is related to the arm movement scheduling, and it cannot be doubled.
  • Only in option C, the rotation delay time of the disk is related to the rotation speed of the disk. If the rotation speed is doubled, the time will be halved.

6. An exception is a special event that occurs inside the processor during instruction execution, and an interrupt is a request event from outside the processor. In the following statements about interrupts and exceptions, the correct one is ( ).
A. DMA传送结束, 除运算时除数为0both are interrupts
B. DMA传送结束are interrupts, 除运算时除数为0and are abnormal
C. DMA传送结束are abnormal, 除运算时除数为0and are interrupted
D. DMA传送结束, 除运算时除数为0are both abnormal
Reference answer: B
Answer analysis:

  • The DMA process is handled by the DMAC. After the transfer, a notification will be sent to the CPU. This is an external event of the processor, so it is an interrupt.
  • An exception refers to an interrupt event caused by the currently running instruction. Including failures caused by error conditions, such as division by zero arithmetic errors, page fault exceptions; also includes termination caused by unrecoverable fatal errors, usually some hardware errors.

7. Among the following protocols, which belongs to the secure remote login protocol is ( ).
A.TLS
B.TCP
C.SSH
D.TFTP
Reference answer: C
Answer analysis:

  • Option A: TLS is used to provide confidentiality and data integrity between two communicating applications.
  • Option B: TCP is a reliable transport layer protocol and has nothing to do with security.
  • Option C: SSH is the abbreviation of Secure Shell, formulated by the Network Working Group of IETF; SSH is a security protocol based on the application layer and the transport layer. SSH is currently the most reliable protocol designed to provide security for remote login sessions and other network services. Using the SSH protocol can effectively prevent information leakage in the remote management process. Choose option C for this question.
  • D option: TFTP (Trivial File Transfer Protocol, simple file transfer protocol) is a protocol in the TCP/IP protocol family used for simple file transfer between the client and the server, providing uncomplicated and low-cost file transfer Serve.

8. Among the following attack types, ( ) is the primary goal of the attacked object not being able to continue to provide services.
A. Cross-site scripting
B. Denial of service
C. Information tampering
D. Password guessing
Reference answer: B
Answer analysis:

  • Option A: cross-site scripting (XSS), a security attack in which an attacker maliciously embeds a code in a link that appears to come from a trusted source. It allows malicious users to inject code into web pages and other users will be affected while viewing the web pages. without affecting the provision of services.
  • Option B: Denial of service, where legitimate access to information or other resources is unconditionally blocked, causing the server to deny service. Choose option B for this question.
  • Option C: information tampering, which means that the active attacker modifies the eavesdropped information (such as deleting or replacing part or all of the information) and then transmits the information to the original recipient. Not related to the provision of services.
  • Option D: password guessing. When attacking the target, the attacker often starts the attack by deciphering the user's password. As long as the attacker can guess or determine the user's password, he can gain access to the machine or network, and can access any resources that the user can access. Not related to the provision of services.

9. Which of the following algorithms belongs to the asymmetric encryption algorithm is ( ).
A.DES
B.RSA
C.AES
D.MD5
reference answer: B
answer analysis:

  • Typical symmetric encryption algorithms: DES, 3DES, AES, etc.
  • Typical asymmetric encryption algorithms: RSA, ECC, etc. Choose option B for this question.
  • Typical digest algorithms: SHA, MD5, etc.

10. SQL is a database structured query language, and the primary target of SQL injection attacks is ( ).
A. Destroying Web services
B. Stealing confidential information such as user passwords
C. Attacking user browsers to gain access
D. Obtaining database permissions
Reference answer: D
Answer analysis:
SQL injection attack is to insert SQL commands into Web forms Submit or enter the domain name or query string requested by the page, and finally trick the server into executing malicious SQL commands. Its primary purpose is to gain database access.

Guess you like

Origin blog.csdn.net/johnWcheung/article/details/126531971