1 / 40

Memory

Memory. See: P&H Appendix C.8, C.9. Announcements. HW1 due today HW2 available later today HW2 due in one week and a half Work alone Use your resources FAQ, class notes, book, Sections, office hours, newsgroup, CSUGLab Make sure you

dane
Download Presentation

Memory

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Memory See: P&H Appendix C.8, C.9

  2. Announcements HW1 due today HW2 available later today • HW2 due in one week and a half • Work alone • Use your resources • FAQ, class notes, book, Sections, office hours, newsgroup, CSUGLab • Make sure you • Registered for class, can access CMS, have a Section, and have a project partner • Check online syllabus/schedule, review slides and lecture notes, Office Hours, early homework and programming assignments

  3. Announcements • Prelims: Evening of Thursday, March 10 and April 28th • Late Policy • 1) Each person has a total of four “slip days” • 2) For projects, slip days are deducted from all partners • 3) 10% deducted per day late after slip days are exhausted

  4. Critical Path • Which operation is the critical path? • A) AND • B) OR • C) ADD/SUB • D) LT

  5. Critical Path • What is the length of the critical path (in gates)? • A) 3 • B) 5 • C) 7 • D) 9

  6. Critical Path • What is the length of the critical path for a 32-bit ALU (in gates)? • A) 9 • B) 32 • C) 64 • D) 69

  7. Multiplexor

  8. Multiplexor

  9. Goals for today Review • SR Latches, D Latches, D Flip Flips, and Registers Memory • Register Files • Tri-state devices • SRAM (Static RAM—random access memory) • DRAM (Dynamic RAM)

  10. Bistable Devices • Stable and unstable equilibria? A Simple Device A B

  11. Bistable Devices • In stable state, A = B • How do we change the state? • Stable and unstable equilibria? A Simple Device A B 1 0 0 1 A B A B

  12. SR Latch Q R S Q

  13. SR Latch • Set-Reset (SR) Latch • Stores a value Q and its complement Q Q S R Q

  14. SR Latch • Set-Reset (SR) Latch • Stores a value Q and its complement Q S Q R Q Q S R Q

  15. Unclocked D Latch • Data (D) Latch D S Q R Q

  16. Unclocked D Latch • Data (D) Latch D S Q R Q Data Latch • Easier to use than an SR latch • No possibility of entering an undefined state When D changes, Q changes • … immediately (after a delay of 2 Ors and 2 NOTs) Need to control when the output changes

  17. D Latch with Clock D S Q R Q clk Level Sensitive D Latch Clock high: set/reset (according to D) Clock low: keep state (ignore D)

  18. D Latch with Clock D S Q R Q clk

  19. D Latch with Clock D S Q R Q clk clk D Q

  20. Edge-Triggered D Flip-Flop • D Flip-Flop • Edge-Triggered • Data is captured when clock is high • Outputs change only on falling edges D D Q D Q Q F L Q L Q clk Q c c clk D F Q

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

  22. Voting Machine 3 LED dec mux +1 mux 32 32 32 ... 32 reg reg reg reg E E E E decoder (3-to-8) detect enc 3

  23. Goals for today Review • SR Latches, D Latches, D Flip Flips, and Registers Memory • Register Files • Tri-state devices • SRAM (Static RAM—random access memory) • DRAM (Dynamic RAM)

  24. Register File • Register File • N read/write registers • Indexed by register number • Implementation: • D flip flops to store bits • Decoder for each write port • Mux for each read port Dual-Read-PortSingle-Write-Port 32 x 32 Register File QA 32 DW 32 QB 32 W RW RA RB 1 5 5 5

  25. Register File • Register File • N read/write registers • Indexed by register number • Implementation: • D flip flops to store bits • Decoder for each write port • Mux for each read port Dual-Read-PortSingle-Write-Port 32 x 32 Register File QA 32 DW 32 QB 32 W RW RA RB 1 5 5 5

  26. Register File • Register File • N read/write registers • Indexed by register number • Implementation: • D flip flops to store bits • Decoder for each write port • Mux for each read port Dual-Read-PortSingle-Write-Port 32 x 32 Register File QA 32 DW 32 QB 32 W RW RA RB 1 5 5 5

  27. Tradeoffs • Register File tradeoffs + Very fast (a few gate delays for both read and write) + Adding extra ports is straightforward – Doesn’t scale

  28. Building Large Memories • Need a shared bus (or shared bit line) • Many FFs/outputs/etc. connected to single wire • Only one output drives the bus at a time

  29. Tri-State Devices Tri-State Buffers E E Vdd D Q D D Q Gnd

  30. Shared Bus D0 S0 D1 S1 D2 S2 D3 S3 D1023 S1023 shared line

  31. SRAM • Static RAM (SRAM) • Essentially just SR Latches + tri-states buffers

  32. SRAM Chip

  33. SRAM Chip row decoder A21-10 CSR/W column selector, sense amp, and I/O circuits A9-0 Shared Data Bus

  34. SRAM Cell • Typical SRAM Cell bit line word line B B • Each cell stores one bit, and requires 4 – 8 transistors (6 is typical) • Read: • pre-charge B and B to Vdd/2 • pull word line high • cell pulls B or B low, sense amp detects voltage difference • Write: • pull word line high • drive B and B to flip cell

  35. SRAM Modules and Arrays R/W 1M x 4SRAM 1M x 4SRAM 1M x 4SRAM 1M x 4SRAM A21-0 CS msb lsb CS Bank 2 CS Bank 3 CS Bank 4

  36. SRAM Summary • SRAM • A few transistors (~6) per cell • Used for working memory(caches) • But for even higher density…

  37. Dynamic RAM: DRAM bit line • Dynamic-RAM (DRAM) • Data values require constant refresh word line Capacitor Gnd

  38. DRAM vs. SRAM • Single transistor vs. many gates • Denser, cheaper ($30/1GB vs. $30/2MB) • But more complicated, and has analog sensing • Also needs refresh • Read and write back… • …every few milliseconds • Organized in 2D grid, so can do rows at a time • Chip can do refresh internally • Hence… slower and energy inefficient

  39. Memory • Register File tradeoffs + Very fast (a few gate delays for both read and write) + Adding extra ports is straightforward – Expensive, doesn’t scale – Volatile • Volatile Memory alternatives: SRAM, DRAM, … – Slower + Cheaper, and scales well – Volatile Non-Volatile Memory (NV-RAM): Flash, EEPROM, … + Scales well – Limited lifetime; degrades after 100000 to 1M writes

  40. Summary • We now have enough building blocks to build machines that can perform non-trivial computational tasks • Register File: Tens of words of working memory • SRAM: Millions of words of working memory • DRAM: Billions of words of working memory • NVRAM: long term storage (usb fob, solid state disks, BIOS, …)

More Related