Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

what is the diffirence between bit and std_logic In vhdl?

Status
Not open for further replies.

ymq8328

Member level 3
Joined
May 26, 2005
Messages
57
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,847
std_logic in vhdl

what is the diffirence between bit and std_logic In vhdl?
 

vhdl std_logic resolve

bit type can only represent : '0' or '1'

while type std_logic can represent things like :
'U', -- Uninitialized
'X', -- Forcing Unknown
'0', -- Forcing 0
'1', -- Forcing 1
'Z', -- High Impedance
'L', -- Weak 0
'H', -- Weak 1
'-' -- Don't care
 

std_logic *.pdf

I see. but why people prefer std_logic to bit,
 

vhdl resolve std_logic

std_logic is resolved when there are multiple drivers to a signal!
Whrereas in same situation bit generates ERROR!
 

Re: what is the diffirence between bit and std_logic In vhd

Hi,
go through this pdf. You will understand.

Best Regards,
 

Re: what is the diffirence between bit and std_logic In vhd

std_logic can help u in optimization process while sysnthesis in some situation if u used the dont-care . also std_logic give u more high-impedance value where u cant get with bit.
 

Re: what is the diffirence between bit and std_logic In vhd

ymq8328,

but why people prefer std_logic to bit,

It depends.

For ALU and data path components such as registers, adders and multipliers, bit is good enough.

For bus, FSM control signals and intermodule signals, designers prefer to use std_logic to resolve logical issues.

As someone already said, std_logic offers 8 representations instead of ideal ones from bit.

You try to think about this scenerio,
"If you drive a logic over a bus or a lengthy wire, do you expect ideal 1's and 0's?"
This is why std_logic comes into the picture to resolve issues like this.
 

Re: what is the diffirence between bit and std_logic In vhd

ymq8328 said:
I see. but why people prefer std_logic to bit,

You will definetly need to use std_logic in case you want to things like high impedance which is common with buses for example .. u may also need to express don't care and unchanged .. these things can't be expressed if using bit type instead.
 

I am a newbie in this field . I wiil use std_logic all the time, is this a good choice?
 

Re: what is the diffirence between bit and std_logic In vhd

Not a good choice if you have to describe arithmetic and logical components like a multiplier.

Check "natural", "integer", "unsigned" and "signed" types. What do you think these types are introduced instead of std_logic for computation?

After you have checked these types, you might be able to answer yourself if using std_logic all the time is a good or bad choice for you.
 

I have the same experience of ymq8328. But multiplier is a digital circuit, Does "natural", "integer", "unsigned" and "signed" have any role in this circuit?
 

Re: what is the diffirence between bit and std_logic In vhd

First of all, these different types make writing, reading and understanding VHDL easier. I know it looks easier to use only one type "std_logic_vector" but the more complex a design gets with signed, unsigned, ranges and floating point the easier these differant types get.
 

Re: what is the diffirence between bit and std_logic In vhd

bit type has only two values: '0' or '1'

std_logic can have any value amongst :
'U', -- Uninitialized
'X', -- Forcing Unknown
'0', -- Forcing 0
'1', -- Forcing 1
'Z', -- High Impedance
'L', -- Weak 0
'H', -- Weak 1
'-' -- Don't care

these represnt different drive strenghts/resolved values
 

i think verilog is better than vhdl, why you try verilog?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top