summaryrefslogtreecommitdiff
path: root/24.md
blob: 1f31735993195d9f899d044146e1f780a1a89a52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
[\<- Decoders and register files](23.md)

---

# Tri-state buffers, RAM

## Tri-state buffer concept and usage for 2:1 mux

### Active outputs

- AND/OR/INV gates actively drive a 0 or 1
- We can't connect the outputs of two gates because they may want to drive different values
	- This would be bad (electrically):

![diagram](24.1.png)

### Tri-state Buffer/Driver

- When not enabled, it is no "driving" the output
- Allows connecting multiple outputs
	- As long as only one is ever enabled

![diagram](24.2.png)

- Z symbol reflects no active value on the wire (since when e=0, the wire becomes electrically disconnected)

### Muxing with tri-state buffers

- Usage of tri-state bufferis really a form of muxing
	- The input to the enabled buffer is selected to pass thru to the output
- A 2:1 mux using tri-state buffers:

![diagram](24.3.png)

---

## Using tri-state buffers for large, distributed muxes

### 1-hot buffer enables

- The key is that only 1 enable can be asserted at a time
- With four choices and 2 selects => decode

![diagram](24.4.png)

### A distributed mux

- There are four choices here, but we don't have to pull the four inputs into a localized circuit; the buffers can be "far" away

![diagram](24.5.png)

---

## The abstraction of memory

### Memory

- A large number of addressable locations
	- Just like a register file, but typically many order of magnitude larger
	- Also like a register file, the number of locations is independent of the data width
- The address is an encoded value specifying the desired location
- The structure of the memory may lead to multi-level decoding of the address

### Memory as an abstraction

- Systems with memory are usually fairly complex, so memory is typically represented as an abstraction
	- Data buses and control signals can differ
	- M address bits => 2^M locations

![diagram](24.6.png)

---

## An array of SRAM cells

### SRAM cell

- Same feedback loop as latch
	- By contrast, DRAM uses just a capacitor
- "Pass" transistors to read and write
	- Similar to tri-state buffer

![diagram](24.7.png)

### A 2x2 array of cells

- Typically connected in a regular pattern
	- Cells in a row share the same select line
	- Cells in a column share the same data line

![diagram](24.8.png)

### A block of SRAM

- Address goes thru row decoder (1-hot)

![diagram](24.9.png)

---

## Multi-level addressing of memory

### Two-level addressing

- For larger memory structures, it becomes inefficient to have just a single column of cells
- Consider an array of 1024 addressable locations, each of which is just 1-bit of data
	- 32 rows of 32 columns yields 1024 bits
	- Break 10-bit addresses into 5 bits for selecting the rows, and 5 bits to select the column
	- Similar to hotel room numbers
		- Row is like the floor, column is like the room

### A Memory Chip (1Kx4bit)

- Each sub-array stores one of the 4 bits

![diagram](24.10.png)

### More on address decoding

- Previous example showed break down into rows and columns
- Some memory chips are banked
	- Subset of address bits used to select bank
- In general, full address can be broken down into fields that enumerate/select an instance of a structure
	- E.g., 4 banks \* 128 rows \* 16 columns
	- How many address bits for each and in total?
	- Deconstruct address 0x14B7