CS 2733/2731
Computer Organization II -- Spring 2003
Review for Exam 1 (28 February 2003)
Topics:
- Overview (Chapters 1, 2)
- 1: Nothing directly asked about this, just for orientation.
- 2: Skip Chapter 2.
- ints (4.1, 4.2)
- Conversions between binary, decimal, hexadecimal
- Integers: 2s complement for negative numbers
- -13: write 13 in binary, complement, add 1
- doubles (4.8)
- Conversions between scientific notation and internal
bit representation of a double, using
the IEEE standard.
- MIPS Assembly Language (Chapter 3, 4.4)
- Format, constants in hex or decimal, comments following #
- Registers, 32: $0-$31, with symbolic names
- Basic instructions
- Arithmetic (add, sub, and, or)
- Arithmetic immediate (addi, ori)
- Load/Store (lw, sw) --
uses offset in bytes to form an address
- Load address (pseudo: la, uses lui
and ori)
- Branches
- bne, beq (offset in words from PC)
- slt
- all other branches are pseudo instructions
- Jumps
- j, jal (absolute addr in words)
- jr (jump to address in a register)
- Pseudo-instructions, and simulating them with real instructions:
li, move, la,
blt, mul, b)
- Coding loops
- Arrays, and their access (in memory, must use lw
or sw.
- Functions and function calls (use jal to call
and jr $ra to return.
- Parameters to functions ($a0 - $a3),
returned values ($v0,
$v1), or on the stack.
- Use of the stack: local variables, local (automatic) arrays,
values saved
- Recursion [example in class, but since the recursion lab is
not complete, there won't be questions about recursion]
- Logical instructions (shifts (sll,
srl), and, or, etc.)
- The assembly and compilation processes:
- High-level source(C/C++), transformed by
compiler to:
- Assembler language program, transformed by
assembler to:
- Object file in machine language, transformed along
with other object files by linker to:
- Executable module, loaded into a computer by
loader and executed.
- MIPS Machine Language (Chapter 3)
- Basic types
- R-type (register), usually 3 registers (arithmetic, logical,
slt, jr)
- I-type (immediate), lw, sw,
beq, bne, addi,
lui)
- J-type (jump), j, jal
- Hand conversion of machine language into assembly (dis-assembly)
[Not emphasized, since this is in Lab 8]
- Hand conversion of assembly into machine language (assembly)
[Not emphasized, since this is in Lab 8]
- Construction of NAND, NOR, NOT, AND, OR gates from CMOS transistors
- Combinational Logic (B.1, B.2, B.3)
- Truth tables, boolean algebra, logic equations
- AND, OR and NOT gates
- Combinational logic
- Decoders
- Multiplexors
- Creating a logic circuit to represent an arbitrary
truth table. (Skip PLAs and Don't Cares)
Possible Questions
(see also previous exams online):
- About binary integers (especially 2s complement)
and about formats for doubles.
- Asking for MIPS assembler programs, including
loops, arrays (loads and stores), functions (including
register conventions and saving/restoring registers using the stack).
- Use of other assembler instructions, including
slt and la (and how it uses
lui and ori to create
a 32-bit constant).
- About other pseudo-instructions.
- Format of MIPS machine instructions.
- About the assembly process.
- About the construction of gates for CMOS transistors (from handout).
- About converting a truth table to a combinational logic circuit.
- Multiplexors, decoders.
- The 32-bit ALU, with emphasis on how a 32-adder is made up
of 32 1-bit adders, and how such an adder can be easily modified
to handle subtration as well.