1. Combinational vs. Sequential Circuits
Definition – Combinational Circuit
A combinational circuit is made of logic gates whose outputs at any time depend only on the present inputs. It is fully specified by a set of Boolean functions.
It has inputs, outputs, and switching functions, each mapping the input combinations to one output.
flowchart LR I["m Boolean inputs"] --> C["Combinational<br/>logic circuit"] --> O["n Boolean outputs"]
Definition – Sequential Circuit
A sequential circuit adds storage elements (memory). Its outputs depend on the inputs and the stored state — which depends on past inputs — so its behaviour is described by a time sequence of inputs and internal states.
| Combinational | Sequential | |
|---|---|---|
| Memory | none | storage elements |
| Output depends on | present inputs | present inputs + past inputs (state) |
| Specified by | Boolean functions / truth table | sequence of inputs and states |
2. Functional Blocks
Designers reuse a few standard circuits as building blocks: decoders, encoders, multiplexers, code converters, arithmetic circuits. They are common in real designs, simplify the design process, and support hierarchy and replication.
Rudimentary Functions of One Variable
| Function | Name | Implementation | ||
|---|---|---|---|---|
| 0 | 0 | value fixing | tie to ground | |
| 1 | 1 | value fixing | tie to / | |
| 0 | 1 | transferring | wire | |
| 1 | 0 | inverting | inverter |
Enabling Functions
- Enabling lets an input pass through to the output.
- Disabling blocks it and replaces it with a fixed value.
| EN | (disabled → 0) | (disabled → 1) | |
|---|---|---|---|
| 0 | – | 0 | 1 |
| 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
3. Decoders
Definition – Decoding
Decoding converts an -bit input code into an -bit output code, with , such that each valid input gives a unique output. An -to--line decoder typically has inputs and outputs; the output whose index equals the input code is 1 and all others are 0 (one-hot code). In other words, a decoder generates the minterms of its inputs.
1-to-2-Line Decoder
| 0 | 1 | 0 |
| 1 | 0 | 1 |
, .
2-to-4-Line Decoder
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 |
when : , , , .
It is made of two 1-to-2-line decoders (the inverters) and 4 AND gates:
Decoder Expansion
Larger decoders are built from smaller ones by splitting the inputs as evenly as possible and ANDing every output of one with every output of the other:
| Decoder | Built from | Output ANDs |
|---|---|---|
| 3-to-8 | 2-to-4 + 1-to-2 | 8 |
| 4-to-16 | 2-to-4 + 2-to-4 | 16 |
| 6-to-64 | 3-to-8 + 3-to-8 | 64 () |
| 7-to-128 | 4-to-16 + 3-to-8 | 128 |
flowchart LR A0["A0"] --> D24["2-to-4 decoder<br/>(A1,A0)"] A1["A1"] --> D24 A2["A2"] --> D12["1-to-2 decoder<br/>(A2)"] D24 -->|"4 minterms"| G["8 two-input ANDs"] D12 -->|"A2', A2"| G G --> O["D0 … D7"]
Implementing Functions with a Decoder + OR
Since a decoder produces all minterms and every function is a sum of minterms, OR the decoder outputs of the function’s minterms.
Example –
⚠️ “Is this a good idea?” — a 4-to-16 decoder (16 four-input ANDs) to use only 6 outputs is wasteful. A K-map gives : three 3-input ANDs and one OR. Decoder + OR pays off when several functions share the same decoder.
Decoder with Enable
Add an enable input EN to every output AND. When EN = 0 all outputs are 0; when EN = 1 the decoder works normally.
| EN | ||||||
|---|---|---|---|---|---|---|
| 0 | X | X | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 0 | 1 |
(X = 0 or 1; a row with two X stands for four input combinations.)
Viewed differently, the value of EN is routed to one of the four outputs selected by — the circuit is then a demultiplexer.
Example – Enable Used for Expansion
A 3-to-8 decoder from two 2-to-4 decoders with enable: enables one decoder (through an inverter) and the other directly; go to both. For : the upper decoder is enabled with input 00 → , all others 0.
flowchart LR A2["A2"] -->|"A2'"| E0["2-to-4 (EN)<br/>→ D0–D3"] A2 -->|"A2"| E1["2-to-4 (EN)<br/>→ D4–D7"] A10["A1 A0"] --> E0 A10 --> E1
4. Encoders
Definition – Encoding
Encoding is the opposite of decoding: an -bit input code → an -bit output code (). An encoder has (or fewer) inputs and outputs; typically it converts a one-hot input into the binary index of the active line.
Example 1 – 8-to-3 Binary Encoder
Inputs (one-hot), outputs = binary index of the 1. E.g. → .
Each output bit ORs the inputs whose index has a 1 in that bit:
Example 2 – Decimal-to-BCD Encoder
Inputs (one-hot), outputs (BCD). Rule: appears in if bit of is 1.
⚠️ A plain encoder gives garbage if more than one input is 1 (e.g. and → ), and gives the same output as “no input”. The priority encoder fixes both problems.
Priority Encoder
Accepts any input combination: among the active inputs it encodes the highest-priority one (most significant here). An extra output (valid) = 1 when at least one input is 1.
Example – 5-Input Priority Encoder ( highest)
| # minterms | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| 1 | 0 | 0 | 0 | 0 | 0 | X | X | X | 0 |
| 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
| 2 | 0 | 0 | 0 | 1 | X | 0 | 0 | 1 | 1 |
| 4 | 0 | 0 | 1 | X | X | 0 | 1 | 0 | 1 |
| 8 | 0 | 1 | X | X | X | 0 | 1 | 1 | 1 |
| 16 | 1 | X | X | X | X | 1 | 0 | 0 | 1 |
Input X’s mean 0 or 1, so each row is a product term; the rows cover all minterms. Reading the equations directly from the table:
(The simplified forms use .)
5. Multiplexers
Definition – Multiplexer (MUX)
A multiplexer selects one of several information inputs and routes it to a single output. It has:
- selection inputs ,
- information inputs ,
- one output : when .
2-to-1-Line MUX
Structure: a 1-to-2-line decoder (the inverter) + 2 enabling circuits (ANDs) + a 2-input OR. The ANDs and the OR together form a 2 × 2 AND-OR. In general:
4-to-1-Line MUX
| 0 | 0 | |
| 0 | 1 | |
| 1 | 0 | |
| 1 | 1 |
Width Expansion (Quad MUX)
To select whole buses instead of single bits, use several AND-OR sections in parallel sharing one decoder. A quad 2-to-1 MUX selects a 4-bit bus from source A or source B; a 4-to-1 quad MUX selects one of four 4-bit vectors.
6. Implementing Functions with Multiplexers
Approach 1 – Variables with a -to-1 MUX
The decoder inside the MUX generates the minterms of the select inputs; each information input decides whether minterm reaches the OR (value fixing: attaches it, removes it).
Design:
- Write the truth table, inputs in counting order.
- Connect the function’s variables to (in order).
- Value-fix each to the function’s value on row (0 or 1; either for a don’t-care).
- For outputs, use an -wide MUX (or MUXes).
Example – 3-Bit Gray → Binary Converter
Rearranged in counting order of the Gray input :
| (Gray) | (binary) |
|---|---|
| 000 | 000 |
| 001 | 111 |
| 010 | 011 |
| 011 | 100 |
| 100 | 001 |
| 101 | 110 |
| 110 | 010 |
| 111 | 101 |
directly. and use two 8-to-1 MUXes with on :
⚠️ In the slide’s first (unsorted) conversion table, the last row reads “001 → 101”; it should be 001 → 111, as in the sorted table. (In this example is the most significant Gray bit, which is why .)
Approach 2 – Variables with a -to-1 MUX + One Inverter
Design:
- Truth table in counting order.
- Using the first variables, group the rows in pairs (the pair differs only in the last variable).
- For each pair, express the output as a rudimentary function of the last variable: , , or .
- Feed those rudimentary functions to the information inputs, with the first variables on the selects.
Example – Gray → Binary Again
| : | : | |||
|---|---|---|---|---|
| 00 | 0, 0 | 1, 1 | ||
| 01 | 1, 1 | 0, 0 | ||
| 10 | 0, 1 | 1, 0 | ||
| 11 | 1, 0 | 0, 1 |
Two 4-to-1 MUXes + one inverter instead of two 8-to-1 MUXes — about half the cost. More generally, a function of many variables is split into sub-functions of a subset of variables, and the MUX selects among them.
Example – with a 4-to-1 MUX
| rows () | ||
|---|---|---|
| 00 | , | |
| 01 | , | |
| 10 | , | |
| 11 | , |
Example – with an 8-to-1 MUX
| 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 | |
|---|---|---|---|---|---|---|---|---|
| minterms () | 0, 1 | 2, 3 | 4, 5 | 6, 7 | 8, 9 | 10, 11 | 12, 13 | 14, 15 |
| 0 | 0 | 1 | 1 |
Exercises: none assigned separately — the worked examples (decoder + OR for ; Gray→binary with Approaches 1 and 2; ; ) are the practice set.