Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

How to read bits from input in VHDL?

Hi guys..

Can anyone tell me how to read bits from a signal? Let's say I have 16 bits input signal and it's called signal A. How do I read the first 4 bits of the input signal and compare it with signal B which is also 4 bits? Is this possible?

Thanks.

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks Tricky. It worked. =)

    But how about if I want to read only 1 bit? Say, there's 01010101 and I want to read the 4th bit.

    Thanks.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    assuming A is declared something like:

    A : in std_logic_vector(7 downto 0);

    op <= A(3);