Midterm I Review

Number Systems & Conversions

Notes: Number Systems and Conversions (CS2640)

Decimal to Binary

Q1: Convert to binary.

Answer

Q2: Convert to binary.

Answer

Q3: Convert to binary.

Answer

Binary to Decimal

Q4: Convert to decimal.

Answer

Q5: Convert to decimal.

Answer

Q6: Convert to decimal.

Answer

Binary to Hexadecimal

Q7: Convert to hexadecimal.

Answer

Q8: Convert to hexadecimal.

Answer

Q9: Convert to hexadecimal.

Answer

Positional Notation

Q10: Rewrite in positional notation.

Answer

Q11: Rewrite in positional notation.

Answer

Q12: Rewrite in positional notation.

Answer

Q13: Rewrite in positional notation.

Answer

Binary Range

Q14: How many bits do you need to represent values?

Answer

Q15: What is the biggest number you can represent with bits?

Answer

Binary Groupings

Q16: What is the smallest addressable unit of information?

AnswerByte

Q17: What is a byte?

Answer8 consecutive bits

Q18: What is a word?

Answer4 consecutive bytes

Binary Operations

Notes: Binary Operations (CS2640)

Bit Shifts

Q19: What happens to a binary number when you shift left bits?

Answer

Q20: What is the difference between logical and arithmetic shift?

Answer

Q21: Which shift should you use to divide a integer?

Answer

Sign Extension

Q22: What are the steps to converting an unsigned binary number to two’s complement?

Answer
  1. Apply NOT to every bit.
  2. +1

Q23: Find the 8-bit two’s complement of

Answer

Q24: Find the 8-bit two’s complement of

Answer

Q25: Convert the two’s complement bit pattern to decimal:

Answer

Q26: Convert the two’s complement bit pattern to decimal:

Answer

Q27: Perform using binary addition.

Answer

Q28: Perform using binary addition and twos complement.

Answer

Computer Systems

Notes: Computer Systems (CS2640), Von Neumann (CS2640)

Q29: Which is NOT a main functional unit of the CPU?

  1. Register File
  2. Memory Unit
  3. Control Unit
  4. Arithmetic and Logic Unit
Answer
  1. Memory Unit

Q30: During the execution of a program, what is the primary function of the PC (Program Counter)?

  1. Store the result of each instruction
  2. Maintain a count of the clock cycles
  3. Manage the CPU’s power supply
  4. Keeps track of the memory address of the next instruction
Answer
  1. Keeps track of the memory address of the next instruction

Q31: Which of the following statements best describes the von Neumann architecture?

  1. Separate memory units for data and instructions
  2. Allows parallel processing of data and instructions
  3. Uses a single memory unit for both data and instructions
  4. Relies solely on cache memory for data storage
Answer
  1. Uses a single memory unit for both data and instructions

Q32: What are the three phases of the execution cycle in the CPU? What registers are used in each phase?

Answer
  1. Fetch
    • PC
    • IR
  2. Decode
    • IR
  3. Execute
    • REGS
    • PC
    • IR

Q33: What are three factors affecting performance?

Answer
  1. Hardware Design
  2. Instruction Set
  3. Compiler

Q34: What is a buffer?

AnswerA region of memory that stores information temporarily.

Q35: What do RISC and CISC stand for?

Answer

Q36: What are the basic functional units of a computer?

Answer
  1. CPU
  2. Main Memory
  3. Input Devices
  4. Output Devices
  5. Secondary Storage
  6. Buses

Q37: List the three busses.

Answer
  1. Address Bus
  2. Data Bus
  3. Control Bus

Q38: How much memory can a CPU with n address lines hold?

Answer2^n bytes

Q39: How much memory can a 32-bit CPU hold?

Answer4 GB

MIPS Architecture

Notes: MIPS Architecture (CS2640)

Instruction Set Architecture

Notes: ISA (CS2640)

Assembler, Linker, Loader

Notes: Assembler, Linker, Loader (CS2640)

MIPS Assembly

Notes: MIPS Assembly (CS2640)

Assorted Questions

Q39: Fill in the memory accesses needed for the following instructions:

InstructionOperandsData CountInstruction Count
ADDM3,M2,M1
ADDR1,R2,R3
Answer
InstructionOperandsData CountInstruction Count
ADDM3,M2,M134
ADDR1,R2,R301
35

Q40: Instruction Set Architecture is __

  1. A bus specification
  2. Abstract model of a computer
  3. The building block of a computer
  4. Instructions processed by the control unit
Answer
  1. Abstract model of a computer

Q41: Why do we use assembly language?

  1. Speed and size of the program is critically important.
  2. Assembly language is easy to read.
  3. Access to specialized instructions that are not available in high-level language
  4. Assembly language is machine independent
Answer
  1. Speed and size of the program is critically important.
  2. Access to specialized instructions that are not available in high-level language

Q42: What are the parts/fields in a machine instruction?

Answer
  1. Opcode Fields
  2. Address Fields

Q43: What are the different types of MIPS instruction formats? What field do they all share?

Answer
  1. R
  2. I
  3. J
They all have an opcode field.

Q44: What is an assembler directive?

Answer

Tells the assembler where in memory to place thing.

Q45: Which is the following is NOT a pseudo-instruction?

  1. li $t1, 0
  2. li $ao, hello
  3. move $to, $t1
  4. addi $t0, $t1, 0
Answer
  1. addi $t0, $t1, 0

Q46: translate the following pseudocode to assembly. c and f are memory locations.

c=5*(f-32)/9

Answer
lw  $t0, f
sub $t0, $t0, 32
mul $t0, $t0, 5
div $t0, $t0, 9
sw  $t0, c