Skip to content

Combinational Logic Elements

Combinational logic circuits produce outputs based only on current inputs. They do not have memory.


alt text

  • Converts binary input into maximum of m = 2n or less unique output lines.
  • Common types: 2-to-4, 3-to-8 decoders.
  • Example: Used in memory address decoding.

alt text alt text

alt text

  • Each minterm → one AND gate
  • Large decoders → need many-input ANDs (not practical)
  • Use small decoders → build big decoder (hierarchical)
  • Final AND gates → only 2 inputs
  • ANDs implement minterms

Example:-alt text

alt text

Implementing logic functions using a decoder

Section titled “Implementing logic functions using a decoder”

alt text

alt text Opposite of Decoding:

  • m-bit input → n-bit output (n ≤ m ≤ 2ⁿ)
  • Input: one-hot (only one 1)

alt text

8-to-3 line encoder (octal-to-binary encoder)

Section titled “8-to-3 line encoder (octal-to-binary encoder)”

alt text

alt text

alt text

  • Positional encoder alt text

alt text

  • Selects one of many input lines and forwards it to a single output.
  • Controlled using select lines.

alt text

alt text

Difference between Multiplexer, Decoder, and Encoder

Section titled “Difference between Multiplexer, Decoder, and Encoder”
FeatureMultiplexer (MUX)DecoderEncoder
PurposeSelects one input to pass to outputConverts binary input to 1-hot outputConverts 1-hot input to binary output
InputsMultiple data inputs, select linesn input lines2ⁿ input lines
OutputsSingle output2ⁿ output linesn output lines
Control SignalsSelect linesInput acts as selectNo select; active input only
DirectionMany → 1n → 2ⁿ2ⁿ → n
Example UseData routingAddress decodingPriority coding

alt text

alt text

Tri-state Buffer:

  • 2 logic levels (0,1), 3 output levels (0,1, High-Z)
  • EN=0 → High-Z (acts like open circuit)
  • Used to isolate output from bus
  • Allows multiple devices to share same bus
  • Common in data buses (e.g., computer peripherals)

alt text

alt text

  • allowing only one set of data to pass either a logic “1” or logic “0” output state onto the bus
  • all the other tri-state outputs connected to the same bus lines are disabled by being placed in their high impedance Hi-Z state.

There are four types of tri-state buffers:

    1. Active High tri-state buffer
    1. Active high inverting tri-state buffer
    1. Active Low tri-state buffer
    1. Active low inverting tri-state buffer

alt text

  • Compares two binary numbers.

alt text

  1. Equality Comparator

    • Single output
    • Output HIGH if A = B, else LOW
  2. Magnitude Comparator

    • Three outputs:
      • A < B
      • A = B
      • A > B

alt text

  1. Designing alt text

  2. Realizing alt text

alt text

  • Do binary addition
  • Inputs: two or more binary numbers
  • Outputs: SUM and CARRY (Cout)

alt text

Full Adder: Adds three bits (including carry-in).

Section titled “Full Adder: Adds three bits (including carry-in).”
  • Has an additional input bit C in to represent a carry-in bit coming from a previous addition step alt text alt text

Full adder implementation with half adders

Section titled “Full adder implementation with half adders”

alt text

  • Uses n full adders connected in series
  • Carry ripples from LSB to MSB (right to left)

alt text

  • Disadvantage: output will not be valid until any carry-input has “rippled” through every full adder in the chain

alt text

  • Speeds up addition by computing carries in parallel
  • No need to wait for ripple from LSB to MSB
  • At each bit:
    1. Generate carry (from xi and yi)
    2. Propagate carry (pass carry-in to carry-out)

alt text

  • 3 levels of delay:
    1. Generate & propagate signals
    2. Carry lookahead (sum-of-products)
  • Faster than ripple carry due to parallel carry logic
  • A – B = A + 2’s complement of B
  • 2’s complement: B’ + 1
  • Circuit: Adder + inverters on B inputs
  • Set input carry C0 = 1

alt text

  • Happens when result > range of bits
  • Common in signed binary addition/subtraction
  • Detected when:
    • Two positives → negative result
    • Two negatives → positive result
  • Example alt text
  • Perform arithmetic and logical operations.
  • Core component of a CPU.

alt text

  • Basic ALU Architecture alt text

  • Memory-based way to implement logic
  • Store outputs for all input combinations
  • Inputs = address, output = stored value
  • No need for logic gates
  • Can be cascaded for complex functions

alt text

alt text

  1. PLDs: Used in FPGAs/CPLDs to build custom logic
  2. Speed: Precomputed outputs → faster than gate-based logic
  3. Simplifies complex functions → fewer gates
  4. Function approximation → for math/nonlinear functions