you'll get necessary handouts such as ISEM reference card and the CPU diagram
Format
The format will be the same as the midterm:
Multiple choices, fill in the blanks, define terms, maybe T/F
Work out some problems like:
Number conversions (small magnituded, pretty simple, arbitrary base)
Code an expression using one or more instruction formats (e.g., 3-address, stack-based, 1 1/2 address) and count the number of memory fetches, instruction bits, etc.
Space required for data structures
Something to do with Parity, Hamming Distance, Huffman code
CPU architecture: implement some instruction using the SAM CPU
Instruction encodeing: assemble and disassemble SPARC instructions
Programming in SPARC:
Flow of control construct
Accessing data structures (e.g. linked list, binary tree, array records, 3D array)
Subroutine linkage (especially stack-based)
Computer Architecture including I/O:
Trap, interrupt, & exceptions and associated handlers
Memory mapped v. isolated I/O
Programmed I/O v. interrupt-driven I/O
UARTs, DMA transfer
TOPICS
Number representation and conversion
binary, hex ** (mainly with regard to coding/decoding instructions)
unsigned binary
2's complement *** (mainly with regard to coding/decoding instructions)
sign-magnitude, BCD
ASCII
Parity, Huffman code, Hamming distance *
Machine language architecture
RISC v. CISC *
instruction formats, use of registers, LOAD/STORE *
addressing modes, effective address **
representation of instructions (e.g., SPARC) ***
CPU architecture
Condition codes, PSW, PC *
CPU bus **
registers, ALU
instruction fetch and execution ***
memory reads and writes, addressing modes and effective address calculation ***
Computer architecture
CPU-memory bus, memory mapped I/O v. separate I/O bus **
memory types: ROM, RAM, PROM, EPROM, access time, cylce time, volatility *
addressability: byte, word *
XOPs, exceptions, interrupts, handlers ***
user mode v. privileged mode *
UART, DMAs **
Programming techniques
flow of control constructs (if-then-else, while, case, etc.) **
lists, arrays, 2D arrays **
use of pointers, e.g., linked lists, binary trees **
records, fields, data structures **
space allocation, word alignment, '.equate' or '.set'
subroutine linkage, stacks, pass by reference, pass by value, returning values ***
recursive procedures **
Questions you can pretty much count on for being on final
given instruction, list CPU signals necessary to fetch and execute it
assembling and disassembling ISEM instructions
addressing modes, instruction formats, RISC v. CISC
programming techniques working wit flow-of-control constructes and/or addresses in memory, e.g., arrays, binary trees, linked lists
stack-based subroutine linkage
something about I/O: traps, exceptions, interrupts, UARTs, DMA, etc.
Sample Questions
Give the CPU signals necessary to execute the following instructions:
ADD R1,[R2]
MOV [R1]+,[R2]+
LD R3,[R2,R5]
If you got a job as an assembly programmer, would you rather program a RISC processor or a CICS processor? Why?
In a double linked list, a node is composed of a word integer value followed by a pointer to the previous node and a pointer to the next node.
Consider the following: R1 points to node A, R2 points to node B, and R3 points to a new node to be inserted between node A and B.
Give the instruction, in ISEM, to perform the insertion.
Write a subroutine using stack-based parameter passing to compute the average of two numbers.
The two numbers are parameters passed to the routine and the function value returned is the average.
Convert the following flow-of-control construct to SPARC assembly
if ( (a < b) AND (b > 0) ) b = -b;
For anarray using zero-based indexing, write the code to
load element (i,j,k) where:
the array is 3x4x5
each element is 2 bytes long
the array name is A and is word-aligned
i: %r1
j: %r2
k: %r3
First, diagram how the array is stored in memory.
Define the following terms:
BCD
DMA
parity
Huffman Code
Hamming Distance
PSW
UART
Disassemble or assemble the following.
842F800F
A49AA724
ld [%r4-2],%r10
sll %r20,18,%r30
What's the Huffman code for a two-letter alphabet with the following frequences:
A: 90%
B: 10%
A personnel record is to be formed from the following fields:
name: 10 characters
age: 1-125
social security number: 9 digits
salary: 0-200000
Do the following:
Design how a personnel record is stored in memory (try to be as memory efficient as possible),
Allocate memory for 1000 of these records,
write the code to access the salary of the ith person where i is in register %r1 and load it into %r2
When a program issues a 'ta 2' well after the user has typed in characters and hit <ENTER>, list the order of the following events (OS refers to the Operating System):
OS routine reads the character from the I/O controller and puts in the input buffer
CPU finishes executing current instruction
CPU explicity calls an OS routine
CPU determines what device generated an interrupt
I/O controller generates an interrupt
OS routine accesses the input buffer and gets a character from it
keyboard sends a character to the I/O controller (e.g. UART)