E21 Digital Logic Design Lecture #4
Questions: HW/Lab
Medium-Scale Integration Digital Circuits
-
Adder: half and full (w/carry in)
-
Truth Table
-
Karnaugh Map
-
Logic diagram
-
Ripple Adders: combine full-adders putting the carry out to the carry in of the next one.
-
Carry-lookahead circuits: ripple adders are slow, we can calculate the individual carry-ins directly.
-
gi is the carry-generate function and pi is the carry propagate function
-
There is a carry into the next position if x and y are 1, or if either x or y are one and there is a carry.
-
ci+1 = gi + pici
-
Copy this equation for the next three carry terms, increasing i by 1 for each term.
-
If we substitute equations, then we get direct expressions for each carry term.
-
Going beyond 4 is not useful, as the delay in the carry lookahead begins to equal the ripple propagation.
Adders are sometimes made by linking together multiple 4-bit adders.
-
Can also use two levels of CLA generation and create the c4, c8, c12, and c16 carries from the g and p values.
-
CL adders grow logarithmically in delay, while ripple adders grow linearly.
Buses and the 3-state buffer
-
3-state buffers, or tristate drivers, have three states: 0, 1, Z.
-
Z is a high impedance state, which essentially disconnects that gate from its output.
-
A 3-state buffer has two inputs: D (value) and E (enable output).
-
Whenever E is 1, the output of the circuit is D. Otherwise, the output is Z.
-
A Bus is a set of wires connecting two or more components.
-
Only one device should be driving the bus at any one time.
Decoder
-
A decoder is one way to guarantee that only one source is driving a bus at any given time.
-
A decoder takes n inputs, and has 2n outputs, only one of which is driven active.
-
Using a decoder, we can select the device that should be driving the bus.
Priority Encoder
-
An encoder takes 2n inputs and outputs n bits indicating the input line with the highest
priority that is high.
-
Example: 4 to 2 priority encoder.
-
Useful in computer architecture on an interrupt request line.
Multplexer
-
The bus controller function for the decoder actually makes up a multiplexer (MUX).
-
A multiplexer has 2n input lines, n address lines, and one output line.
-
The address indicates which line drives the output.
-
We can also use a multiplexer to drive the input to a bus directly.
-
A MUX will often have an enable input as well as the addresses (enables a 3-state buffer).
Demultiplexer
-
The demultiplexer is a multiplexer in reverse.
-
It's like a decoder except that, instead of holding the selected line high, the selected line mirrors
the single input line.
-
We can put a MUX and a DEMUX at two ends of a bus and control who is sending and receiving.
Magnitude Comparators (Mano example)
-
Algorithmically, start with the most significant bit and work down.
-
If the MS bits are equal, then check the next MS bits. If they're equal, check the next ones.
-
The check for equal is the inverse of the XOR function.
-
Outputs are AB, and A=B.
Shifter and rotator
-
Rotate or shift an arbitrary amount.
-
Can use selectors, or DEMUXs to build shifters and rotators.
Arithmetic logic unit
-
Heart of a computer.
-
Select a function: add, rotate, shift, invert, OR, AND, XOR, and so on.
-
Logic can get pretty complex.
Using MSI circuits for "Random Logic"
-
Is a truth table close to a standard MSI function?
-
Building ROMs using a decoder
-
Using ROMs to implement random logic functions
-
PLAs: Programmable Logic Arrays
-
PROM/EPROM/EEPROM