Beruflich Dokumente
Kultur Dokumente
CPS104 Lec23.1
GK Spring 2004
Admin.
CPS104 Lec23.2
GK Spring 2004
CPS104 Lec23.3
op 6
Main Control
func 6 ALUop N
ALUctr 3 ALU
CPS104 Lec23.4
GK Spring 2004
In this exercise, ALUop has to be 2 bits wide to represent: u (1) R-type instructions u I-type instructions that require the ALU to perform:
To implement the full MIPS ISA, ALUop hat to be 3 bits to represent: u (1) R-type instructions u I-type instructions that require the ALU to perform:
(2) Or, (3) Add, (4) Subtract, and (5) And (Example: andi) R-type R-type 1 00 ori Or 0 10 lw Add 0 00 sw Add 0 00 jump Subtract xxx xxx 0 01
GK Spring 2004
beq
ALUop (Symbolic) ALUop<2:0> 31 R-type funct<5:0> 10 0000 10 0010 10 0100 10 0101 10 1010 op 26
R-type R-type 1 00 21 rs
sw Add 0 00 6
jump Subtract xxx xxx 0 01 0 funct ALU Operation Add Subtract And Or Set-on-less-than
GK Spring 2004
beq
ALU
CPS104 Lec23.6
CPS104 Lec23.7
GK Spring 2004
ALUctr<2> = !ALUop<2> & ALUop<0> + ALUop<2> & !func<2> & func<1> & !func<0>
CPS104 Lec23.8
GK Spring 2004
CPS104 Lec23.9
GK Spring 2004
ALUctr<0> = !ALUop<2> & ALUop<0> + ALUop<2> & !func<3> & func<2> & !func<1> & func<0> + ALUop<2> & func<3> & !func<2> & func<1> & !func<0>
CPS104 Lec23.10
GK Spring 2004
ALUctr<2> = !ALUop<2> & ALUop<0> + ALUop<2> & !func<2> & func<1> & !func<0>
ALUctr<0> = !ALUop<2> & ALUop<0> + ALUop<2> & !func<3> & func<2> & !func<1> & func<0> + ALUop<2> & func<3> & !func<2> & func<1> & !func<0>
CPS104 Lec23.11
GK Spring 2004
:
ALUop 3 00 0000 R-type 1 0 0 1 0 0 0 x R-type 1 0 0
func 6
ALUctr 3
op RegDst ALUSrc MemtoReg RegWrite MemWrite Branch Jump ExtOp ALUop (Symbolic) ALUop <2> ALUop <1> ALUop <0>
CPS104 Lec23.12
00 1101 10 0011 10 1011 00 0100 00 0010 ori lw sw beq jump 0 0 x x x 1 1 1 0 x 0 1 x x x 1 1 0 0 0 0 0 1 0 0 0 0 0 1 x 0 0 0 0 1 0 1 1 x x Or Add Add Subtract xxx 0 0 0 x 0 1 0 0 x 0 0 0 0 x 1 GK Spring 2004
00 0000 R-type 1
RegWrite = R-type + ori + lw = !op<5> & !op<4> & !op<3> & !op<2> & !op<1> & !op<0>(R-type) + !op<5> & !op<4> & op<3> & op<2> & !op<1> & op<0>(ori) + op<5> & !op<4> & !op<3> & !op<2> & op<1> & op<0>(lw)
op<5>
..
op<5>
..
op<5>
..
op<5>
..
op<5>
..
<0>
op<5>
..
op<0>
<0>
<0>
<0>
<0>
R-type
ori
lw
sw
beq
jump RegWrite
CPS104 Lec23.13
GK Spring 2004
..
op<5>
..
op<5>
..
op<5>
..
op<5>
..
<0>
op<5>
..
op<0>
<0>
<0>
<0>
<0>
R-type
ori
lw
sw
beq
jump
RegWrite ALUSrc RegDst MemtoReg MemWrite Branch Jump ExtOp ALUop<2> ALUop<1> ALUop<0> GK Spring 2004
CPS104 Lec23.14
:
Rt Rs Rt 5 5
Rt Zero
Rs
Rd
busW 32 Clk
MemWr
32 32 WrEn Adr
1 32
imm16 Instr<15:0> 16
Data In 32 Clk
Data Memory
ALUSrc
CPS104 Lec23.15
ExtOp
GK Spring 2004
ALUctr ExtOp ALUSrc MemtoReg RegWr busA busB Addres s busW CPS104 Lec23.16
Instruction Memoey Access Time New Value Delay through Control Logic New Value New Value New Value New Value
New Value Register File Access Time New Value New Value ALU Delay
New Value
Long cycle time: u Cycle time must be long enough for the load instruction:
PCs Clock -to-Q + Instruction Memory Access Time + Register File Access Time + ALU Delay (address calculation) + Data Memory Access Time + Register File Setup Time + Clock Skew
Cycle time is much longer than needed for all other instructions
CPS104 Lec23.17
GK Spring 2004
Memory
Outline Big Picture of Memory Memory Technology u SRAM u DRAM Reading Chapter 7
CPS104 Lec23.18
GK Spring 2004
Big Picture
Output
CPS104 Lec23.19
GK Spring 2004
Circuit Design
Hardware
CPS104 Lec23.20
GK Spring 2004
Memory is a large linear array of bytes. u Each byte has a unique address (location). u Byte of data at address 0x100, and 0x101 Most computers support byte (8-bit) addressing. Data may have to be aligned on word (4 byte) or double word (8 byte) boundary. u int is 4 bytes u double precision floating point is 8 bytes 32-bit v.s. 64-bit addresses u we will assume 32-bit for rest of course, unless otherwise stated
2n-1
2n-1-4 2n-1
CPS104 Lec23.21
GK Spring 2004
Clk
Ideal
Instruction Memory
32 Clk
Rw Ra Rb 32 32-bit Registers
32 32 B ALU 32
Ideal
Data Memory
DataOut
CPS104 Lec23.22
GK Spring 2004
Question
CPS104 Lec23.23
GK Spring 2004
System Organization
Processor interrupts
Cache
Memory Bus
I/O Bridge
Disk Disk
Graphics
Network
GK Spring 2004
Control
External Cache
To main memory
CPS104 Lec23.25
GK Spring 2004
Memory
SIMM Slot 0 SIMM Slot 1 SIMM Slot 2 SIMM Slot 3 SIMM Slot 4 SIMM Slot 5 SIMM Slot 6
Memory Controller
SIMM Slot 7
Memory Bus
DRAM SIMM
DRAM DRAM DRAM DRAM DRAM DRAM DRAM DRAM DRAM DRAM
CPS104 Lec23.26
GK Spring 2004
Memory Technology
Random Access: u Random is good: access time is the same for all locations u DRAM: Dynamic Random Access Memory
u
High density, low power, cheap, slow Dynamic: need to be refreshed regularly Main memory Low density, high power, expensive, fast Static: content will last forever(until lose power) Caches
Not-so-random Access Technology: u Access time varies from location to location and from time to time u Examples: Disk, CDROM Sequential Access Technology: access time linear in location (e.g.,Tape)
GK Spring 2004
CPS104 Lec23.27
Why do computer professionals need to know about RAM technology? u Processor performance is usually limited by memory latency and bandwidth. u Latency: The time it takes to access a word in memory. u Bandwidth: The average speed of access to memory (Words/Sec). u As IC densities increase, lots of memory will fit on processor chip
- Instruction cache - Data cache - Write buffer What makes RAM different from a bunch of flip-flops? u Density: RAM is much more dense u Speed: RAM access is slower than flip-flop (register) access.
CPS104 Lec23.28
GK Spring 2004
Technology Trends
Logic: DRAM: Disk: Capacity 2x in 3 years 4x in 3 years 4x in 3 years Speed 2x in 3 years 1.4x in 10 years 1.4x in 10 years
bit
bit
Write: 1. Drive bit lines (bit=1, bit=0) bit bit 2. Select row Read: 1. Precharge bit and bit to Vdd (set to 1) 2. Select row 3. Cell pulls one line low (pulls to 0) 4. Sense amp on column detects difference between bit and bit
GK Spring 2004
CPS104 Lec23.30
WrEn
A0 A1 A2 A3
Address Decoder
SRAM Cell
Word 1
SRAM Cell
:
SRAM Cell - Sense Amp +
:
SRAM Cell - Sense Amp +
:
SRAM Cell - Sense Amp +
:
Word 15
Dout 3
CPS104 Lec23.31
Dout 2
Dout 1
Dout 0
GK Spring 2004
WE_L OE_L
Write Enable is usually active low (WE_L) Din and Dout are combined to save pins: u A new control signal, output enable (OE_L) is needed u WE_L is asserted (Low), OE_L is disasserted (High)
D serves as the data input pin D is the data output pin Result is unknown. Dont do that!!!
CPS104 Lec23.32
GK Spring 2004
WE_L OE_L
Write Timing:
D A OE_L WE_L Write Hold Time Write Setup Time
CPS104 Lec23.33
Read Timing:
High Z Junk Junk Data Out Read Address Junk Data Out
Read Address
GK Spring 2004