HDLbits
Browse Problems

Circuits/Combinational Logic

Combinational Logic

Gates, muxes, arithmetic, Karnaugh maps.

  1. 1

    Wire

    Connect a one-bit input directly to an output.

    easy
  2. 2

    2-to-1 Multiplexer (Gate-Level)

    Build a 2-to-1 multiplexer using only basic AND/OR/NOT gates instead of a behavioral assign statement.

    easy
  3. 3

    Ground

    Drive an output permanently low.

    easy
  4. 4

    4-to-1 Multiplexer

    Select one of four single-bit inputs with a 2-bit select signal.

    easy
  5. 5

    BCD to 7-Segment Display Decoder

    Decode a 4-bit BCD digit into the seven segment-drive signals of a 7-segment display.

    medium
  6. 6

    NOR

    Implement a two-input NOR gate.

    easy
  7. 7

    Another Gate

    Combine XOR and OR logic in one combinational expression.

    easy
  8. 8

    4-bit Priority Encoder

    Report the bit position of the highest set bit in a 4-bit input, with a valid flag for all-zero input.

    medium
  9. 9

    K-Map Simplification: Prime BCD Digit Detector

    Use a Karnaugh map with don't-cares to derive a minimal two-term sum-of-products circuit for a prime BCD digit detector.

    medium
  10. 10

    Two Gates

    Connect two logic gates through an intermediate signal.

    easy
  11. 11

    8-bit Magnitude Comparator

    Compare two 8-bit unsigned values and report equal, greater-than, and less-than as three one-hot flags.

    easy
  12. 12

    More Logic Gates

    Build independent NAND and NOR outputs.

    easy
  13. 13

    7420 Chip

    Model two independent four-input NAND gates.

    easy
  14. 14

    4-bit Barrel Shifter (Rotate Left)

    Rotate a 4-bit value left by a variable amount using a combinational barrel shifter.

    medium
  15. 15

    Two-Bit Equality

    Compare two two-bit values for equality.

    easy
  16. 16

    Simple Circuit A

    Implement a three-input function with an OR stage feeding an AND stage.

    easy
  17. 17

    Simple Circuit B

    Implement a sum-of-products Boolean function.

    easy
  18. 18

    Combine Two Circuits

    Combine two independently computed Boolean terms.

    medium
  19. 19

    Ring or Vibrate?

    Choose whether a phone rings or vibrates when a call arrives.

    easy
  20. 20

    Thermostat

    Drive heater and cooler controls from temperature and enable signals.

    easy
  21. 21

    3-Bit Population Count

    Count the one bits in a three-bit input.

    medium
  22. 22

    2-to-1 Bus Multiplexer

    Select one of two eight-bit buses.

    easy
  23. 23

    9-to-1 Multiplexer

    Select one of nine bits with a four-bit selector.

    medium
  24. 24

    256-to-1 Multiplexer

    Select one bit from a 256-bit input using an eight-bit index.

    medium
  25. 25

    256-to-1 4-Bit Multiplexer

    Select one four-bit word from 256 packed choices.

    hard
  26. 26

    3-Bit Binary Adder

    Add two three-bit unsigned numbers and expose the carry bit.

    easy
  27. 27

    32-Bit Adder

    Add two 32-bit unsigned operands with a carry-preserving result.

    medium
  28. 28

    Signed Addition Overflow

    Add signed bytes and flag when the mathematical result exceeds the signed range.

    medium
  29. 29

    100-Bit Binary Adder

    Add two 100-bit operands and preserve the final carry.

    medium
  30. 30

    4-Digit BCD Adder

    Add two four-digit packed BCD values with decimal carry propagation.

    hard
  31. 31

    3-Variable Karnaugh Map

    Implement a three-variable Boolean function from its minterms.

    medium
  32. 32

    4-Variable Karnaugh Map A

    Minimize a four-variable function with five asserted minterms.

    medium
  33. 33

    4-Variable Karnaugh Map B

    Minimize a second four-variable function.

    medium
  34. 34

    4-Variable Karnaugh Map C

    Minimize a four-variable function with eight asserted minterms.

    medium
  35. 35

    Minimum SOP and POS Forms

    Express a Boolean function in equivalent minimized SOP and POS forms.

    hard
  36. 36

    K-Map Function with a Multiplexer

    Implement a small Boolean function suitable for a mux-based realization.

    medium
  37. 37

    Truth Tables

    Translate two three-input truth tables into combinational logic.

    easy
  38. 38

    Even Longer Vectors

    Apply a bitwise operation across two 64-bit buses.

    easy
  39. 39

    Karnaugh Map Circuit

    Reduce a four-variable function to a compact expression.

    medium