summaryrefslogtreecommitdiff
path: root/7.md
blob: 3e14a6ee5d94d4db848eb6b090e5a8a29e790286 (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
[\<- Multiplexors](6.md)

---

# Shannon's expansion, FPGAs

## Shannon's expansion with a 2:1 mux

### Synthesizing with a mux

- Say we had a function
	- `F = !X1*X2*X3 + X1*X2 + X1*X3`
- We could re-write as
	- `F = !X1*(X2*X3) + X1*(X2+X3)`
- Note the use of X1 here and think of the concept of enabling
	- If `X1=0`, the `X2*X3` term is enabled
	- If `X1=1`, the `X2+X3` term is enabled
- The true and complement form of X1 is choosing which term to enable => mux

### Shannon's Expansion

- Any truth table can be broken into two sub-tables, with the sub-functions used as inputs to a mux
	- Any input can be used as the select
	- Write out the sub-tables if you need to

![diagram](7.1.png)

### Another example

- Say we chose to use X as the select in the example below
	- Z is easier to see; F0 and F1 would be f(Y,X)

![diagram](7.2.png)

---

## Synthesizing with a 4:1 mux

- Now we use 2 inputs as the select
- For a 2-input truth table, each of the data ports will be either a 1 or 0
	- Inputs are "tied" high or low
- What if we have 3 inputs?
	- Data ports are a function of the remaining input
	- Four possibilities:
		- True or inverted version of input 3, or tie high or low

### Example

![diagram](7.3.png)

---

## Analysis/synthesis revisited

- Whether a circuit is described by an equation or a schematic, it can be analyzed to generate the truth table
- The behavior specified by the truth table can then be synthesized into a completely different circuit structure
	- Including a set of muxes
	- If a circuit is a black box, and you just see the inputs and outputs, you may not know (or care) how it's synthesized

---

## FPGAs

- An array of programmable interconnects and logic blocks
- Note that we will not really be tested on this, it is mainly to demonstrate an example of the above topic

![diagram](7.4.png)

### Lookup Table

- Logic blocks are muxes with programmed inputs
- Inputs to the logic block are used as mux selects

![diagram](7.5.png)

### Example

- Implements `f = X1*X2 + !X2*X3`
	- Green crosses touch, black crosses do not

![diagram](7.6.png)

---

[Verilog basics ->](8.md)