memory
play

Memory Prof. Hakim Weatherspoon CS 3410 Computer Science Cornell - PowerPoint PPT Presentation

Memory Prof. Hakim Weatherspoon CS 3410 Computer Science Cornell University [Weatherspoon, Bala, Bracy, and Sirer] Announcements Level Up (optional enrichment) Teaches CS students tools and skills needed in their coursework as well


  1. Memory Prof. Hakim Weatherspoon CS 3410 Computer Science Cornell University [Weatherspoon, Bala, Bracy, and Sirer]

  2. Announcements • Level Up (optional enrichment) • Teaches CS students tools and skills needed in their coursework as well as their career, such as Git, Bash Programming, study strategies, ethics in CS, and even applying to graduate school. • Thursdays at 7-8pm in 310 Gates Hall, starting this week • http://www.cs.cornell.edu/courses/cs3110/2019sp/levelup/ 2

  3. Announcements Make sure you are • Registered for class, can access CMS • Have a Section you can go to. • Lab Sections are required. • “Make up” lab sections only Friday 11:40am or 1:25pm • Bring laptop to Labs • Project partners are required for projects starting w/ project 2 • Project partners will be assigned (from the same lab section, if possible) 3

  4. Announcements • Make sure to go to your Lab Section this week • Completed Proj1 due Friday, Feb 15th • Note, a Design Document is due when you submit Proj1 final circuit • Work alone BUT use your resources • Lab Section, Piazza.com, Office Hours • Class notes, book, Sections, CSUGLab 4

  5. Announcements Check online syllabus/schedule • http://www.cs.cornell.edu/Courses/CS3410/2019sp/schedule • Slides and Reading for lectures • Office Hours • Pictures of all TAs • Project and Reading Assignments • Dates to keep in Mind • Prelims: Tue Mar 5th and Thur May 2nd • Proj 1: Due next Friday, Feb 15th • Proj3: Due before Spring break • Final Project: May 16th Schedule is subject to change 5

  6. Goals for today Memory • CPU: Register Files (i.e. Memory w/in the CPU) • Scaling Memory: Tri-state devices • Cache: SRAM (Static RAM—random access memory • Memory: DRAM (Dynamic RAM) 6

  7. Last time: How do we store one bit D Q D Flip Flop stores 1 bit clk 7

  8. Goal for today How do we store results from ALU computations? 8

  9. Big Picture: Building a Processor inst memory register alu file +4 +4 addr =? PC d out d in control cmp offset memory target new imm pc extend A Single cycle processor 9

  10. Big Picture: Building a Processor inst memory register alu file +4 +4 addr =? PC d out d in control cmp offset memory target new imm pc extend A Single cycle processor 10

  11. Goal for today How do we store results from ALU computations? How do we use stored results in subsequent operations? Register File How does a Register File work? How do we design it? 11

  12. Register File Register File • N read/write registers Q A 32 • Indexed by D W Dual-Read-Port 32 register number Single-Write-Port Q B 32 32 x 32 Register File W R W R A R B 1 5 5 5 12

  13. Register File Recall: Register D0 • D flip-flops in parallel • shared clock D1 • extra clocked inputs: write_enable, reset, … D2 D3 4-bit 4 4 reg clk clk 13

  14. Register File Recall: Register D0 • D flip-flops in parallel • shared clock D1 • extra clocked inputs: write_enable, reset, … D2 D3 32-bit 32 32 reg clk clk 14

  15. Register File Register File 32 D Reg 0 • N read/write registers Reg 1 • Indexed by …. 5-to-32 register number decoder Reg 30 Reg 31 addix1, x0, 10 5R W W 00001 How to write to one register in the register file? 15

  16. Aside: 3-to-8 decoder truth table & circuit i2 i1 i0 o0 o1 o2 o3 o4 o5 o6o7 3-to-8 0 0 0 … decoder 0 0 1 001 0 1 0 3 R W 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 16

  17. Register File Register File 32 Reg 0 • N read/write registers Reg 1 32 M • Indexed by …. …. Q A U register number Reg 30 X Reg 31 add x1, x0, x5 M 32 How to read from two …. Q B U registers? X 5 5 R A R B 17

  18. Register File 32 Register File D 32 • N read/write registers Reg 0 Reg 1 32 M • Indexed by …. …. Q A 5-to-32 U register number decoder Reg 30 X Reg 31 Implementation: M • D flip flops to store 32 …. U Q B bits X • Decoder for each write port • Mux for each read 5 5 5 port R A W R W R B 18

  19. Register File Register File • N read/write registers Q A 32 • Indexed by D W Dual-Read-Port 32 register number Single-Write-Port Q B 32 32 x 32 Register File Implementation: W R W R A R B • D flip flops to store bits • Decoder for each write port 1 5 5 5 • Mux for each read port 19

  20. Register File Register File What happens if same • N read/write registers register read and • Indexed by written during same register number clock cycle? Implementation: • D flip flops to store bits • Decoder for each write port • Mux for each read port 20

  21. Tradeoffs 8-to-1 mux a Register File tradeoffs b + Very fast (a few gate delays for both read and write) c + Adding extra ports is d straightforward – Doesn’t scale e e.g. 32Mb register file with f 32 bit registers Need 32x 1M-to-1 multiplexor g and 32x 20-to-1M decoder h How many logic gates/transistors? s 2 s 1 s 0 21

  22. Takeway Register files are very fast storage (only a few gate delays), but does not scale to large memory sizes. 22

  23. Goals for today Memory • CPU: Register Files (i.e. Memory w/in the CPU) • Scaling Memory: Tri-state devices • Cache: SRAM (Static RAM—random access memory) • Memory: DRAM (Dynamic RAM) 23

  24. Next Goal How do we scale/build larger memories? 24

  25. Building Large Memories Need a shared bus (or shared bit line) • Many FlipFlops/outputs/etc. connected to single wire • Only one output drives the bus at a time D 0 S 0 D 1 S 1 D 2 S 2 D 3 S 3 D 1023 S 1023 shared line • How do we build such a device? 25

  26. Tri-State Devices Tri-State Buffers • If enabled (E=1), then Q = D • Otherwise, Q is not connected (z = high impedance) E D Q E D Q 0 0 z 0 1 z 1 0 0 1 1 1 26

  27. Tri-State Devices Tri-State Buffers • If enabled (E=1), then Q = D • Otherwise, Q is not connected (z = high impedance) E V supply D Q D Q E D Q 0 0 z 0 1 z Gnd 1 0 0 1 1 1 27

  28. Tri-State Devices Tri-State Buffers • If enabled (E=1), then Q = D • Otherwise, Q is not connected (z = high impedance) E V supply E D Q D D Q E D Q 0 0 z 0 1 z Gnd 1 0 0 1 1 1 28

  29. Tri-State Devices Tri-State Buffers • If enabled (E=1), then Q = D • Otherwise, Q is not connected (z = high impedance) E V supply E D Q 0 1 off D Q E D Q z 0 0 off 0 0 z 0 1 z A B OR NOR A B AND NAND Gnd 1 0 0 0 0 0 1 0 0 0 1 0 1 1 0 0 1 0 1 1 1 1 1 0 1 0 1 0 0 1 29 1 1 1 0 1 1 1 0

  30. Tri-State Devices Tri-State Buffers • If enabled (E=1), then Q = D • Otherwise, Q is not connected (z = high impedance) E V supply E D Q 1 1 off D 0 0 Q E D Q 0 1 1 on 0 0 z 0 0 1 z A B OR NOR A B AND NAND Gnd 1 0 0 0 0 0 1 0 0 0 1 0 1 1 0 0 1 0 1 1 1 1 1 0 1 0 1 0 0 1 30 1 1 1 0 1 1 1 0

  31. Tri-State Devices Tri-State Buffers • If enabled (E=1), then Q = D • Otherwise, Q is not connected (z = high impedance) E V supply E D Q 1 0 on D 1 1 Q E D Q 1 1 0 off 0 0 z 1 0 1 z A B OR NOR A B AND NAND Gnd 1 0 0 0 0 0 1 0 0 0 1 0 1 1 0 0 1 0 1 1 1 1 1 0 1 0 1 0 0 1 31 1 1 1 0 1 1 1 0

  32. Shared Bus D 0 S 0 D 1 S 1 D 2 S 2 D 3 S 3 D 1023 S 1023 shared line 32

  33. Takeway Register files are very fast storage (only a few gate delays), but does not scale to large memory sizes. Tri-state Buffers allow scaling since multiple registers can be connected to a single output, while only one register actually drives the output. 33

  34. Goals for today Memory • CPU: Register Files (i.e. Memory w/in the CPU) • Scaling Memory: Tri-state devices • Cache: SRAM (Static RAM—random access memory) • Memory: DRAM (Dynamic RAM) 34

  35. Next Goal How do we build large memories? Use similar designs as Tri-state Buffers to connect multiple registers to output line. Only one register will drive output line. 35

  36. Memory • Storage Cells + bus • Inputs: Address, Data (for writes) • Outputs: Data (for reads) • Also need R/W signal (not shown) N Address N address bits  2 N words total • M data bits  each word M bits • M Data 36

  37. Memory • Storage Cells + bus • Decoder selects a word line • R/W selector determines access type • Word line is then coupled to the data lines Data Address Decoder R/W 37

  38. Memory • Storage Cells + bus • Decoder selects a word line • R/W selector determines access type • Word line is then coupled to the data lines 22 Address Memory 8 8 4M x 8 D in D out Chip Select Write Enable Output Enable 38

  39. Memory D in [1] D in [2] E.g. How do we design D Q D Q a 4 x 2 Memory Module? enable enable 0 (i.e. 4 word lines that are D Q D Q 2-to-4 decoder each 2 bits wide)? enable enable 1 4 x 2 SRAM D Q D Q Address enable enable 2 D Q D Q enable enable 3 Write Enable Output Enable D out [1] D out [2] 39

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend