12/6/2005Comp 120 Fall December 2 classes to go Lego Lab Assistant? Questions? CCR at end of class today
12/6/2005Comp 120 Fall Questions Why can’t some numbers be represented in floating point? How to tell? 11 is OK, why not 1.1? How does that control stuff work?
12/6/2005Comp 120 Fall Simplified R-type Datapath Read Reg Read Reg. 2 Write Reg. Write Data data 1 data 2 3 ALU Operation Inst Bits Inst Bits Inst Bits RegWrite 32 Implementing a R-type operation is simply a matter of routing signals to the right places at the right times.
12/6/2005Comp 120 Fall This complex one does the same thing!
12/6/2005Comp 120 Fall Control Don’t lose the forest! Each line is a set of wires transporting bits (1 wire per bit) Control signal to each MUX determines which way a signal will go The control lines all go back to the CONTROL block (our FSM) The FSM drives these lines at just the right times to route signals
12/6/2005Comp 120 Fall Representation What is 0x8FEFC000 if it represents: A 2’s complement integer? An unsigned integer? A float? An instruction?
12/6/2005Comp 120 Fall Representation What is 0x8FEFC000 if it represents: A 2’s complement integer? The sign bit is 1, so this is a negative number. We first take its two’s complement. A = –A = = 2^30 + 2^29 + 2^28 + 2^20 + 2^14 = 1,073,741, ,870, ,435, ,048, ,384 = 1,880,113,152 A = –1,880,113,152 An unsigned integer? A float? An instruction?
12/6/2005Comp 120 Fall Representation What is 0x8FEFC000 if it represents: A 2’s complement integer? An unsigned integer? A = 8FEFC000 = 8 * 16^ *16^ *16^ *16^ *16^3 = 2,147,483, ,658, ,680, , ,152 = 2,414,854,144 A float? An instruction?
12/6/2005Comp 120 Fall Representation What is 0x8FEFC000 if it represents: A 2’s complement integer? An unsigned integer? A float? s = 1 exponent = = 31 significand = (–1)^S * (1 + significand) * 2 ^(exponent–127) = –1x x2^–96 = –1 * ( * 16^– * 16^–2 + 2^–9) *2^–96 = –1.873 * 2^–96 = –2.364 * 10^–29 An instruction?
12/6/2005Comp 120 Fall Representation What is 0x8FEFC000 if it represents: A 2’s complement integer? An unsigned integer? A float? An instruction? Opcode (6 bits) = = lw RS (5 bits) = = 31 RT (5 bits) = = 15 Address (16 bits) = Address is negative so 2’s complement is Address = -2^14 = LW 15, (31)
12/6/2005Comp 120 Fall Quick Review Performance Assembly language programming Representation Arithmetic Logic gates Multiplication/Division Floating Point Control Pipelining Cache VM I/O, Interrupts, OS
12/6/2005Comp 120 Fall What is next in courses? Comp 160 Digital Logic (next semester!) Comp 140 Compilers Comp 142 Operating Systems Comp 130 Files and Databases Comp 181 Models of Language and Computation
12/6/2005Comp 120 Fall Classes to go 1