HDLbits

Hardware Language/Vectors

Vectors

Multi-bit signals, part-selects, and concatenation.

  1. 1

    Vectors

    Connect a three-bit input to a vector output and expose its individual bits as scalar outputs.

    easy
  2. 2

    8-bit Vector Bit Reversal

    Reverse the bit order of an 8-bit vector using the concatenation operator.

    medium
  3. 3

    Byte Select from a 32-bit Word

    Extract one of four bytes from a 32-bit word using part-select (bit-slicing) syntax.

    medium
  4. 4

    Concatenation and Replication

    Build a 32-bit word from four bytes and an 8-bit pattern from a repeated 2-bit value using concatenation and replication.

    medium
  5. 5

    Sign Extension

    Sign-extend an 8-bit two's-complement value to 16 bits using the replication operator.

    medium
  6. 6

    Four-Input Gates

    Combine four four-bit inputs using bitwise AND, OR, and XOR.

    easy
  7. 7

    Vector Bitwise and Logical Operators

    For two 3-bit inputs, produce their bitwise OR, their logical OR (one bit indicating whether either vector is nonzero), and both bitwise inverses concatenated with `not b` in the upper three bits.

    easy
  8. 8

    Vector Part Select

    Select the low and high byte from a 16-bit input.

    easy
  9. 9

    Vector Reversal

    Reverse the bit order of an eight-bit vector.

    easy
  10. 10

    Vector Concatenation and Splitting

    Concatenate six 5-bit inputs in the order `a` through `f`, append two low-order 1 bits, then split the resulting 32-bit vector into outputs `w`, `x`, `y`, and `z` from most significant to least significant.

    easy
  11. 11

    Replication Operator

    Fill an eight-bit vector with eight copies of a one-bit input.

    easy
  12. 12

    Vectors in More Detail

    Rearrange vector slices to exchange the high and low nibbles.

    easy
  13. 13

    More Replication: Pairwise Equality

    Compare every ordered pair of the five input bits. For each pair, set the corresponding output bit to 1 when the two input bits are equal. The 25 comparisons are arranged as five copies of `a`, then five copies of `b`, through five copies of `e`, compared against five repeats of `a & b & c & d & e`.

    easy