Midterm 1 topics

You should be able to answer questions or solve problems related to the following topics:

  1. What is Moore's Law, how it has been impacting the computer industry and how it has been used for predicting computer performance starting from 1970s. Another question that can be answered by Moore's Law is: Why do computer industry and technology advance so fast? For example, it is common that a new generation of computer, CPU, smartphones are produced in every two years.
  2. Understand how a program (application software) written in high-level programming languages is being executed by the hardware. First, compilers translate programs written in high-level programming languages into machine instructions (assembly code). From the assembly codes, assemblers translate symbolic notation of the instructions to the binary. Operating system launches the program of the binary format onto the hardware to execute. The hardware execute the program instruction by instruction.
  3. Know how the idea of abstraction is exploited in computer hardware/software? E.g. in the layers of high-level language, ISA and ABI, and hardware implementation, low-level details are hidden from the higher level.
  4. Understand the three major components of a computer? processor, memory and I/O interfaces.
  5. Know the relationship between variables of a program, memory location and memory address (pointers); the relationship between C array, pointers, and memory in C programming; array references are memory access; Know how to calcualte the memory address of an 1-D or 2-D array element.
  6. Understand the formula to compute CPU time, CPU time = Clock cycles * Cycle time, CPU Time = Instruction Count * CPI * Cycle time. Know how to use the fomula to solve different performance related problems and perform quantitative analyslis of CPU performance. You should be able to solve the problem with book and note closed. A problem may ask you to calcuate one of the three, CPU time, Cycle time/frequency, required CPI. Know how to compute CPI and CPU time under the condition that multiple classes of instructions should be taken into account. For the three factors (Indtruction count, CPI, and Cycle time (clock rate)), know which one(s)are impacted by software and algorithms (IC and CPI), and which ones (s) are impacted by architecture and technologies (CPI and clock rate).
  7. Number systems: conversion between unsigned binary number, decimal number and hexdecimal numbers; and know the logic operations (AND, OR, and XOR) of binary numbers. Representing signed (positive and negative) decimal numbers in 2's-complement format; calcuate the decimal values (positive and negative) of binary numbers that are in 2's-complement; perform addition of binary numbers that are in 2's-complement. Sign extension of 2's-complement binary numbers.
  8. What is Instruction Set Architecture (ISA) and give examples of known ISA that are used in today's CPU. Understand the relationship between memory and registers, e.g. memory are slow/large compared with registers. Data must be loaded to register in order to be processed. There are 32 registers in the RISC-V, and x0 is always 0.
  9. Three major classes of instructions in most RISC-V ISA: Arithmetic-logic instructions, Memory load/store instructions, and control transfer instructions.

    1. Arithmetic/logic instructions (add, sub, addi, sll, slli, srl, srli, or, ori, and, andi and xori ) all have three operands, two of which are source operands, named rs1 and rs2 (or immediate for I-type instructions) and one is destination operand named rd.
    2. Memory access instructions, which are load and store instructions (lw and sw, ld and sd for example). These instructions have three operands. The format for load is lw rd, offset(rs1) and the format for store is sw rs2, offset(rs1). There is no rs2 operand for load and there is no destination operand (rd) for store. Know that the effective address (EA), the address to access the memory for load/store instruction, is calcuated by the processor by adding up the number in register rs1 and the offset. Know access memory requires two pieces of information, memory address and data size. Data size is represented by instruction mnemonics (e.g. ld for doubleword, and sw for word). For high-level language, data size is represented by the variable data type (e.g. int for a word, double int for a double word, char for byte, and short for half-word).
    3. Conditional branch instructions (e.g. bne, beq, blt, and bge). The format of those instructions is beq rs1, rs2, L1 and label L is the symbol that point to an instruction. A label is actually the memory address for the instruction the symbol points to.
  10. Familar with converting core high-level language expressions or statements in C style to instruction sequence: 1) expressions that use +, -, ||, && operators in C; 2) if-else, for and while loop statements; 3) expressions that have array references (e.g. A[4], B[i]) and know how to convert array reference B[i] to instruction sequences that has load or store instructions; 4) the combination of the above three kinds of statements or expressions.