Comparing more than one bits?

R

Rob

Hi

I wann do a simpe comparison, to see if 6 bits of my bus have a certain
value. However, the codefragmet below does not work to my surpirse.
Anyone an idea what I am missing? must be simple, the error message says
no feasable entries for infix op: =

if ( clk = '1' and clk'event ) then
if (data_bus(31 downto 26)="100011") then
...


Thanks in advance,
R.
 
R

rickman

Hi

I wann do a simpe comparison, to see if 6 bits of my bus have a certain
value. However, the codefragmet below does not work to my surpirse.
Anyone an idea what I am missing? must be simple, the error message says
no feasable entries for infix op: =

if ( clk = '1' and clk'event ) then
if (data_bus(31 downto 26)="100011") then
...

Thanks in advance,
R.

How is data_bus declared? If it is std_logic_vector, this looks good
to me. The error message is saying that it can't find a version of
'=' that uses the two operand types and produces a boolean which is
required by the IF. Did you include the libraries?

Rick
 
R

Rob

How is data_bus declared? If it is std_logic_vector, this looks good
to me. The error message is saying that it can't find a version of
'=' that uses the two operand types and produces a boolean which is
required by the IF. Did you include the libraries?

It is declared as unsigned...so in this case I cant compare bitwise I
assume. But I could cast it to std_logic_vector, couldnt I?
 
R

rickman

It is declared as unsigned...so in this case I cant compare bitwise I
assume. But I could cast it to std_logic_vector, couldnt I?

I didn't think that was necessary. unsigned is compatible with string
literals. No?

Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,169
Messages
2,570,918
Members
47,458
Latest member
Chris#

Latest Threads

Top