How do you derive logical true or false in practice?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How do you derive logical true or false in practice?

frdschott
This post was updated on .
While I managed to figure out the Inc16 chip:

CHIP Inc16 {
    IN in[16];
    OUT out[16];
    PARTS:
    Add16(a[0]=true, b=in, out=out);
}

I am confused as to where do constant, logical 1's or 0's come from. Is this a silly question?

Excerpt from Appendix A:

> The constants true and false may also be used as buses, in which case the required width is
deduced implicitly from the context of the connection.

Where do they come from? They are obviously not produced out of thin air lol. How are they derived in practice?

I suppose they come directly from the voltage source, so let's say that for a 16-bit number, maybe I extend 16 conductive lines from the voltage and that's how I get my 1's? What about constant 0's? Are they just empty inputs in practice?
Reply | Threaded
Open this post in threaded view
|

Re: How do you derive logical true or false in practice?

WBahn
Administrator
This post was updated on .
In the real world a logic HI (which is usually, but not always, the same as a logic True -- there's what is called "positive logic" and "negative logic") is obtained by tying the input directly (or via a pullup resistor or transistor) to the positive supply voltage, while a logic LO is obtained by tying the input (again, often through a pulldown device) to the negative supply voltage (often called 'ground' or 'common').

In CMOS technology, which is the dominant technology today, you do NOT leave inputs floating. This can result in the internal devices becoming indeterminate and turning on both the pull-hi and the pull-lo outputs at the same time, resulting in high currents that can quickly destroy the chip. In the older TTL logic, an unconnected input was actually pulled HI internally by the nature of how the circuit was implemented, though it's generally considered poor design practice to rely on this as unconnected inputs act like noise antennas and if there's enough electrical noise in the vicinity it can overcome the weak pullup action and cause erratic behavior.