---
# System prepended metadata

title: SRAM model

---

# SRAM model

source: Week8 memory-technology p.4 ~ p.
[video link](https://www.youtube.com/watch?v=4S3tSiRqRi8&ab_channel=soclab)

## SRAM v.s. DRAM
![memory-technology-4](https://hackmd.io/_uploads/SJuSCy-VT.jpg)

### SRAM: used for cache
#### pros
* Static: 沒斷電資料就還在
* Faster than DRAM

#### cons
* 和DRAM比需要較多的transistor -> expensive

### DRAM: used for main memory or larger cache
#### pros
* Higher density thus cheaper

#### cons
* 1 transistor per bit
* Dynamic: 要一直充電

## SRAM Cell
Need 6 transistor for one bit data -> 兩個inverter迴受加上兩個nmos開關
![memory-technology-6](https://hackmd.io/_uploads/S1awAJ-4T.jpg)


## SRAM Read
note: BL = bit line, SL = select line
![memory-technology-7](https://hackmd.io/_uploads/rkqcCJWET.jpg)

1. 把BL和BL'都充到Vdd
2. 打開SL(充到Vdd)
3. 看是BL還是BL'掉到0就知道裡面的值

## SRAM Write
note: BL的capacitance要比裡面transistor的大
![memory-technology-8](https://hackmd.io/_uploads/H1Hs0J-N6.jpg)

1. 先把BL和BL'充到想要的值 (0和Vdd或Vdd和0)
2. 打開SL(充到Vdd)
3. 等M1到M4充完再斷開SL

![memory-technology-9](https://hackmd.io/_uploads/ByJ2Cy-46.jpg)

