Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - What are Weak Unknown, Weak Zero and Weak 1?

 
Thread Tools Search this Thread
Old 01-24-2005, 03:04 AM   #1
Default What are Weak Unknown, Weak Zero and Weak 1?


Hi,

In the textbook it says open source is an example of Weak Zero. If an
nfet has an open source, how can the output be zero? A pulldown network
should have the source connected to the ground, is it right? Can anybody
explain these concepts for me?

Kuan


Kuan Zhou
  Reply With Quote
Old 01-24-2005, 12:57 PM   #2
Paul Uiterlinden
 
Posts: n/a
Default Re: What are Weak Unknown, Weak Zero and Weak 1?
Kuan Zhou wrote:
> Hi,
>
> In the textbook it says open source is an example of Weak Zero. If an
> nfet has an open source, how can the output be zero? A pulldown network
> should have the source connected to the ground, is it right? Can anybody
> explain these concepts for me?


In VHDL, all variables and signals are initialized by default to their
so called most left value. This is the left value of the definition of
the type used in variable of signal declaration. Examples:

VARIABLE int : integer; --> -2147483648
SIGNAL bool : boolean; --> false
SIGNAL nat : natural; --> 0
SIGNAL sl : std_logic; --> 'U'

The declaration of the std_ulogic type is:
TYPE std_ulogic IS ( 'U', -- Uninitialized
'X', -- Forcing Unknown
'0', -- Forcing 0
'1', -- Forcing 1
'Z', -- High Impedance
'W', -- Weak Unknown
'L', -- Weak 0
'H', -- Weak 1
'-' -- Don't care
);

The left value of this type is 'U', hence the default initial value is
'U'. The same principle applies to all other types and sub-types.

Now, when you are talking about a weak zero, then you are talking about
value 'L'. It is just a value, the "weakness" only comes into play when
multiple drivers act on a single signal. In that case, a resolution
function is called, and it is determined what the resulting value of the
signal will be. For type std_logic, the following table is used:

CONSTANT resolution_table : stdlogic_table := (
-- ---------------------------------------------------------
-- | U X 0 1 Z W L H - | |
-- ---------------------------------------------------------
( 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U', 'U' ), -- | U |
( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ), -- | X |
( 'U', 'X', '0', 'X', '0', '0', '0', '0', 'X' ), -- | 0 |
( 'U', 'X', 'X', '1', '1', '1', '1', '1', 'X' ), -- | 1 |
( 'U', 'X', '0', '1', 'Z', 'W', 'L', 'H', 'X' ), -- | Z |
( 'U', 'X', '0', '1', 'W', 'W', 'W', 'W', 'X' ), -- | W |
( 'U', 'X', '0', '1', 'L', 'W', 'L', 'W', 'X' ), -- | L |
( 'U', 'X', '0', '1', 'H', 'W', 'W', 'H', 'X' ), -- | H |
( 'U', 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X' ) -- | - |
);

'U', 'X', '-', '0', and '1' are strong values, 'Z', 'W', 'L' and 'H' are
weak values. Strong values win from weak values, so for example a '1'
and a 'L' result in a '1'.

Now, if you want to model a signal with a pull-down, all you have to do
is to have a concurrent signal assignment (an assignment outside a
process) with the value 'L'. So for example:

sig <= 'L';

Any strong value from another driver will override this value.

Note that if you have constructs like

IF sig = '0' THEN
...
END IF;

you should adapt these to

IF sig = '0' OR sig = 'L' THEN

or even better:

IF to_x01(sig) = '0' THEN


Recapitulation: if you want to model a pull-down (or pull-up), you need
a signal assignment with value 'L' (or 'H'). Also be aware of the fact
that 'L' is not equal to '0'.

Paul


Paul Uiterlinden
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46