bit vs std_logic ?

S

Squidge

Can anyone tell me any disadvantages of using 'std_logic' over the builtin
type 'bit'? I'm still learning VHDL, and the books and tutorials I've read
all use 'bit' and 'bit_vector', but I find 'std_logic' and
'std_logic_vector' much more flexible. For example, when creating a
prescaler for an input clock, I normally like to use a simple counter and
assign the clock pin to one of the bits of the counter. I can't work out
how to use a bit_vector as a counter without errors stating that
bit_vector's don't support the '+' operator.

So, can std_logic suitably replace the 'bit' operator, or are there places
where 'bit' would be more suitable ? (flexibility, speed reasons, etc)
 
J

jandc

std_logic models all four states '1', '0', 'X', 'Z' while bit takes
only '0'and '1'.
to be more exact: std_logic models all 9 states: '1', '0', 'X', 'Z',
'U', '-', 'L', 'H', 'W'
 

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

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top