ra4king / CircuitSim

Basic Circuit Simulator
https://ra4king.github.io/CircuitSim
BSD 3-Clause "New" or "Revised" License
76 stars 27 forks source link

Add components for power and ground #75

Closed ausbin closed 2 years ago

ausbin commented 2 years ago

Using constants has always bothered me a little bit for building circuits with transistors because it feels wrong, so add components for the power and ground symbols in Patt & Patel. They look like this:

image

The same circuit looks like this in Patt & Patel 3rd ed:

image

I need to check with @pulkitgupta1217, @tmconte, and @sameer-s (and of course Mr. @ra4king) for thoughts on this. This is just my opinion and done for fun, curious what y'all think

pulkitgupta1217 commented 2 years ago

I definitely agree there should be explicit elements for vdd and ground, whether they are unique components or just cosmetic changes to existing constants doesn't really matter to me. Only suggestion I have is to use the traditional circuit symbol for ground like the picture below

Power-symbols

sameer-s commented 2 years ago

I feel that in 2110 a lot of students are more comfortable / used to thinking in 1s and 0s rather than in more electronics terms so I'm not sure how many of them would actually use these components. However, it could still be helpful at least because a lot of students get really confused with constant pins vs. input pins and so it might be nice to have a more visually distinct option for examples and such when appropriate.

That being said, I definitely think they should be new components if added, mostly because it would be very confusing to (for example) have a "ground" component connected as the carry-in for an adder, although it would be technically correct.

ausbin commented 2 years ago

I definitely agree there should be explicit elements for vdd and ground, whether they are unique components or just cosmetic changes to existing constants doesn't really matter to me. Only suggestion I have is to use the traditional circuit symbol for ground like the picture below

Power-symbols

For what it's worth, I sent the following picture to Dr. Conte and asked which he liked best:

three-transistors-walk-into-a-bar

along with the corresponding textbook diagram:

MicrosoftTeams-image (3)

He replied:

I draw it like the textbook and like that way better than the 1, 0 thing on the left

I emailed Caleb but he hasn't replied yet, understandably

ausbin commented 2 years ago

Thanks for those catches, is this better?

ra4king commented 2 years ago

I'm not a huge fan of the "T" and triangle shape but if this is what Conte wants...

ausbin commented 2 years ago

I'm not a huge fan of the "T" and triangle shape but if this is what Conte wants...

@ra4king I don't think you have the same obligation to obey Patt & Patel that he does, if that makes sense. In my opinion, the appearance of the component could differ between vanilla CircuitSim and 2110 CircuitSim, even if the size & port locations don't. (If we want to go that route, I can make the PRs in the right places to avoid tormenting the TAs)

For ground, do you like this symbol more? (I have that written up already)

image

And for power, were you thinking something like this?

image

This would match what Logisim does: http://www.cburch.com/logisim/docs/2.7/en/html/libs/wiring/const01.html

ra4king commented 1 year ago

No it's ok, I googled a bit on this subject and the current ground symbol is fine. Let's add "VDD" to the power symbol?