Review for Midterm 1 CPSC 321 Computer Architecture Andreas Klappenecker
Administrative Issues Office hours have been moved: Wednesday October 15 and 22 canceled Thursday October 16 and 2:00pm- 3:00pm Talk by Bjarne Stroustrup 4:10pm, HRBB 124
Reading Assignments Chapter 1,2,3,4, Appendix B How does the algorithm work? What is the complexity of the algorithm? Work some examples Get familiar with number representations Assembly programming, the gory details Combinatorial circuits Read keyword list first, then the chapter
Early History 1938 Zuse’s Z1 electromechanical, experimental Zuse’s Z2 almost identical to Z Zuse’s Z3 first reliable, freely programmable computer memory based on relays did not have stored program concept Turing-complete
Early History Mark 1 Colossus memory based on vacuum tubes special purpose machine, not Turing complete but it had some flexibility used in Bletchley Park to break the fish cipher
Early History 1944 Harvard Mark I by Aiken and team decimal number system memory based on relays 1945 ENIAC by Eckert and Mauchly memory based on vacuum tubes 1945 von Neumann et al. introduce the stored program principle incorporated in EDVAC design
Questions How was the memory of xyz realized? Was xyz Turing-complete? Who designed xyz? …
MIPS Assembly Language Complete a template program What does the code fragment do? Stack usage for recursive procedures know every nut, bolt and screw slightly different skills needed Know your [pseudo]instructions Is blt a,b,c an instruction?
MIPS Addressing Modes Immediate addressing Register addressing Base displacement addressing PC-relative addressing address is the sum of the PC and a constant in the instruction Pseudo-direct addressing jump address is 26bits of instruction concatenated with upper bits of PC
Addressing Modes Register Addressing add $s1, $s2, $s3 $s1 = $s2 + $s3 Immediate Addressing addi $s1, $s2, 100 $s1 = $s
Addressing Modes Base addressing lw $s1, 100($s2) $s1 = Memory[$s2+100] PC-relative branch beq $s1, $s2, 25 if ($s1 == $s2) goto PC
Addressing Modes Pseudo-direct addressing j 1000 goto 1000 concatenate 26bit address with upper bits of the PC Study section 3.8 for further details In particular, get used to Figure 3.18
Arithmetic Know how to add and subtract Know when overflow occurs Be able to construct an ALU or something like that Carry lookahead
Idea of Carry Lookahead c in a b c out s c out =ab+c in (a xor b) =ab+ac in +bc in =ab+(a+b)c in = g + p c in Generate g = ab Propagate p = a+b
Carry Lookahead Iterate the idea, generate and propagate c i+1 = g i + p i c i = g i + p i (g i-1 + p i-1 c i-1 ) = g i + p i g i-1 + p i p i-1 c i-1 = g i + p i g i-1 + p i p i-1 g i-2 +…+ p i p i-1 …p 1 g 0 +p i p i-1 …p 1 p 0 c 0 Two level AND-OR circuit Carry is known early!
Booth’s Multiplication Looking at 2 bits of multiplier If the bits are 00 => do nothing 10 => beginning run of 1’s: subtract 01 => end of run of 1’s: add 11 => do nothing
Booth’s Multiplication Multiply 0010 by 0110 = sub [= add ] add [= add ]
Floating Point Know the IEEE 754 representation sign bit s exponent E with 8 bits significand S with 23 bits bias 127 (-1) s x (1+S)x2 (E-127) Given: 32 bits, interpret Know all conversions
Final Remarks Use exercises at end of chapter to check knowledge Answers are usually easy to figure out with the help of the text Do not cheat! Read the text carefully, then attempt to solve the problems Appendices A and B are useful bedtime reading There is a need for speed!