T
Takuon Soho
Guest
I wanted to output a 1 or 0 signal
based on bit number 2 of a 4 bit counter.
i.e. if bit 2 is high, set the line high
and if it is low, set the line low.
Using the below code
where my_counter is a subtype of integer (4 bit counter).
i.e.
subtype counter_ty is integer range 0 to 15; -- 4 bit counter,
variable my_counter : counter_ty := 0;
-- Next line compiles but will not sythesize
some_signal <= conv_std_logic_vector(my_counter, 4)(2);
The code compiles OK but refuses to synthesize
with the message something like "complex indexes not supported".
How can I get at the bit 2 of the counter so as to output
a hi or low signal?? It looks like you cannot directly
index the bit of an integer i.e. some_integer(2);
Thanks
Tak
based on bit number 2 of a 4 bit counter.
i.e. if bit 2 is high, set the line high
and if it is low, set the line low.
Using the below code
where my_counter is a subtype of integer (4 bit counter).
i.e.
subtype counter_ty is integer range 0 to 15; -- 4 bit counter,
variable my_counter : counter_ty := 0;
-- Next line compiles but will not sythesize
some_signal <= conv_std_logic_vector(my_counter, 4)(2);
The code compiles OK but refuses to synthesize
with the message something like "complex indexes not supported".
How can I get at the bit 2 of the counter so as to output
a hi or low signal?? It looks like you cannot directly
index the bit of an integer i.e. some_integer(2);
Thanks
Tak