Login  Register

How do you derive logical true or false in practice?

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

How do you derive logical true or false in practice?

frdschott
1 post
This post was updated on Apr 21, 2021; 10:23am.
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
| More
Print post
Permalink

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

WBahn
Administrator
1551 posts
This post was updated on Apr 21, 2021; 5:00pm.
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.