Can Circuit Design Be Approached Like Algorithm Design in Computer Science?

  • Thread starter Thread starter dijkarte
  • Start date Start date
  • Tags Tags
    Electronics
Click For Summary
SUMMARY

This discussion explores the parallels between electronic circuit design and algorithm design in computer science. Participants agree that while both fields involve abstraction and integration of components, circuit design lacks the systematic methodologies found in algorithm development. Key challenges include generating custom waveforms and predicting circuit behavior, which are less straightforward than algorithmic processes. Recommended resources include "Communication Circuits: Analysis and Design" by Clarke and Hess and "Analysis and Design of Analog Integrated Circuits" by Gray, Hurst, Lewis, and Meyer for deeper insights into practical circuit design.

PREREQUISITES
  • Understanding of basic circuit components: BJT, FET, OpAmp
  • Familiarity with fundamental electrical principles: Ohm's Law (V=IR), Kirchhoff's Laws (KVL, KCL)
  • Knowledge of signal processing concepts: Fourier Transform, waveform generation
  • Experience with simulation tools: PSPICE for circuit analysis and design
NEXT STEPS
  • Research advanced circuit design techniques using "Communication Circuits: Analysis and Design" by Clarke and Hess
  • Explore filter design methodologies in "Analysis and Design of Analog Integrated Circuits" by Gray, Hurst, Lewis, and Meyer
  • Learn about circuit simulation algorithms and their applications in PSPICE
  • Investigate the use of Fourier Transform in waveform generation and signal processing
USEFUL FOR

Electronics students, circuit designers, and engineers seeking to bridge the gap between algorithmic thinking and practical circuit design methodologies.

  • #61
If I could go back in time, I would choose EE over CS major, and do the other one as a hobbyist. I have strong passion for both. Now I'm doing the opposite but it's all learning and has to be done properly.

My major problem is picking the right resource. And no offense, but the content and quality of the EE books for what we pay is much much more than an average CS book.
This makes me think 100 times before rushing on a book.
 
Engineering news on Phys.org
  • #62
psparky said:
I would think you need to learn the basics first to be able to design circuits...in my opinion.

Basics such as:
V=IR
P=IV
KVL (kirchoffs voltage law)
KCL (kirchoffs current law)
Voltage division
Current division
Reactance of capacitor and inductor
Phase shifting, bode plots, transfer functions, etc...

Without this stuff you will always be handcuffed I would think.
i want to help in electronics mcqs
 
  • #63
  • #64
Are you interested in "hobby" electronics or learning about them out of interest, as in how they are made, designed in practice, stuff like that? A really good, free book on Analog IC design is:

http://www.designinganalogchips.com/

This goes a lot into devices and circuits. For more board level stuff, there are a lot of free resources that are really good. You need to read some of the stuff out of Analog Devices.

The Linear Circuit Design Handbook from Analog Devices does a great job of the basics of board-level design. And it's free.

http://www.analog.com/library/analogDialogue/archives/43-09/linear_circuit_design_handbook.html

The field of electronics is extremely intuitive. Most of my work is based on intuition. The hard part is EARNING that intuition through math, experience, and hard study.
 
  • #65
cool links! thanks!

My passion to learn is more about acquiring professional/in-depth knowledge than learning as a hobby. I will have to think about some big projects later on, it's too early now.
 
  • #66
An interesting reading I found:

http://www.see.ed.ac.uk/~s0571365/Files/Articles/ISCAS06/docs/papers/3500.pdf

This is what I meant there's no well established science for analog design. It's very mathematical yeah, but it's not directly translated to a graph of electronic components.
 
Last edited by a moderator:
  • #67
dijkarte said:
An interesting reading I found:

http://www.see.ed.ac.uk/~s0571365/Files/Articles/ISCAS06/docs/papers/3500.pdf

This is what I meant there's no well established science for analog design. It's very mathematical yeah, but it's not directly translated to a graph of electronic components.

People have been talking about Analog Synthesis for a long, long time. Several startups caused a lot of buzz and then crashed and burned.

The issue is that digital design can be reduced to very, very simple mathematical constructs that can be dealt with exactly using Boolean algebra. Therefore, digital synthesis was developed in the 1980s and has been extremely successful, and is in fact the way the fast majority of digital circuits are designed.

Analog design is different. The design process is primarily concerned with weighing various tradeoffs and priorities. There are so many interacting variables it has not been possible so far to develop algorithms to describe the design process to automate it. This is an issue of the increased complexity of analog circuits compared with digital circuits. It is no way means there is not an established science. There is, and I use it daily.

As an analogy, let me ask you this:

It is currently impossible to input symptoms and health data into a computer and have it automatically synthesize a new, targeted drug. Does that mean pharmacology is not a science?

It is currently impossible to input a list of symptoms and health data into a computer and have it automatically produce a provably correct diagnosis. Does that mean medicine is not a science?

It is impossible to input a large amount of atmospheric data into an computer and have it automatically produce an accurate long-range weather forecast. Does that mean meteorology is not a science?

It is impossible to put a list of disease occurances into a computer and have it accurately predict the strain and magnitude of the flu a few years out. Does that mean epidemiology is not a science?

The vast majority of sciences are not developed to the point where we are complete masters. Digital design is an exception, not a rule.

I believe you are kind of getting ahead of yourself. You do not have enough basic electronics knowledge to make the kinds of evaluations and judgments you are trying to make. I suggest you focus on the basics at this point. I don't think investigating things like Analog Synthesis will give you much insight.
 
Last edited by a moderator:
  • #68
By synthesis, I don't mean automated computer-generated analog circuit designs.

I know analog synthesis is very advanced and many people in the field do it and they are very creative and innovative at it. TVs, Cellphones, and countless electric devices ...etc. are all examples of how analog design is a very well established science.

What I'm arguing about is that it's not a straightforward science that anyone can just learn and do. Maybe an average engineer can create some filters, simple circuits out of existing components, and with little tweaking maybe...going complex is something different and not simple. And I don't believe any university offers a course at the undergraduate level called "Analog Circuit Synthesis" and this is because there's no such thing yet. All what exists is a collection of best-practices, design-guides, rules and tips from the expertise in the field who have been practicing this magic for decades.

However, there's analysis. At universities we learn analysis, not synthesis. Synthesis is something we do using a kind of reverse engineering to an analysis of some approximation base model/circuit. And not done, we try and tweak, until it works.

As an analogy, someone learned computer science and programming. They can create programs, but can they solve any problem? There are many open problems or some that are unsolvable, and the only solution is either using greedy/approximation techniques or require direct input and tuning from the user. The problem is just mathematically complex to solve.

You do not have enough basic electronics knowledge to make the kinds of evaluations and judgments you are trying to make.

What judgement am I trying to make here? It's something obvious.
 
  • #69
Maybe the issue is that we don't agree what "synthesis" means. In my opinion, it is very similar to analysis. As a simple example, imagine you need to design a circuit to supply a constant power supply voltage to a motor, for example (this analog function is called voltage regulation). You would look in a book to see various regulator topologies, and learn about the various tradeoffs between them. Then, you would pick the one that most aligned with your goals and you would learn about it in more detail. Then you would calculate (based on various design equations) values of components, how much current capacity you need for your amplifier perhaps, how much tolerance you can accept on your passive components, that type of thing. I consider this synthesis.

If you find you cannot meet your objectives using a published circuit, what do you do? Well, you can try to learn exactly why you can't meet your specifications and then address those issues directly. You do that by applying your knowledge of the response of various electronic components so you can create a new topology that meets your objectives. This, I think, is what you mean by synthesis. Am I right? Or am I misunderstanding?

This is by necessity an iterative, messy, challenging problem. If you already have a proscribed procedure to synthesize a circuit to meet an arbitrary problem under arbitrary constraints, then there is no design! It's a solved problem.

All fields which are characterized by design are similar. Think about how an architect goes about designing a building based on various requirements and constraints. If there were a clear scientific way to get to the final answer, the method would be put into a computer and we would have no need for architects!
 
  • #70
I agree, this is what I meant by synthesis. However the example you gave about a power-supply design is more a composition (building from existing components, topologies and tweaking) process than synthesis (starting from scratch). Let me give an example to clarify more what I'm talking about. An engineer is required to design an IC that takes in an analog signal and produces a signal which is the inverse of the original signal's function.

i.e input f(x) = x^2 the result is g(x) = sqrt(x)

Starting from a scratch, using transistors, diodes, and passive elements, how would he/she approach such a problem?

Please note, this circuit probable invented 1000 years ago, I don't know nothing, so my example is just for illustration purpose only. :D
 
  • #71
Okay maybe this is something I should try as an assignment. :D

How do I do looping in circuits? For example apply the same circuit to signal n-times or t-time?
 
  • #72
dijkarte said:
I agree, this is what I meant by synthesis. However the example you gave about a power-supply design is more a composition (building from existing components, topologies and tweaking) process than synthesis (starting from scratch). Let me give an example to clarify more what I'm talking about. An engineer is required to design an IC that takes in an analog signal and produces a signal which is the inverse of the original signal's function.

i.e input f(x) = x^2 the result is g(x) = sqrt(x)

Starting from a scratch, using transistors, diodes, and passive elements, how would he/she approach such a problem?

Please note, this circuit probable invented 1000 years ago, I don't know nothing, so my example is just for illustration purpose only. :D

I think I understand. Well, in that case I would say 99% or more of what working analog design engineers do is composition. You only design something from scratch when you have no other choice. Traditionally, progress has been made incrementally with a breakthrough new topology or something only rarely.

To answer your example, it is impossible to do that in any general way using analog techniques. A more tractable question would be "How do you make a circuit that takes a square root". Honestly what an engineer would do first is search the literature and see if there are published circuits to do a square root. In fact there are. There are also very well known circuits to invert a signal. So I would create a first draft circuit combining these two blocks. Then I would see where it needs to be improved (for example, speed, power, etc) and then use my experience and knowledge to address those needs.

Now, since you asked about synthesis assuming I really wanted to design the example circuit from scratch here is what I would do.

First, I would start with a MOSFET since that is the key device in modern analog IC design. Then, I would ask myself, "what is the core operating equation of the MOSFET"? Since it's a square-law device, to first order the drain current is proportional to the square of the difference between the voltage at the gate and the voltage at the source when the device is operating in saturation. Then it would hit me, "well, by simple algebra, then, the voltage between the gate and the source of the MOSFET is proportional to the square root of the drain current!" So, now, I would have the core of a solution. Then, I would figure out what support circuits I need to ensure the MOSFET is biased in saturation under the expected operating conditions. If the input signal is a voltage, I would have to design a simple circuit to convert the voltage to current (I'd use a PMOS device in a common-drain configuration). Also, I would have to consider how to buffer the output signal such that it could drive whatever load was specified.

So, you see, even in the case where I designed the core of the circuit from scratch, there is still a lot of "composition". I'm sure you've heard the phrase "necessity is the mother of invention", one reason for this is why invent something when it already exists!

Incidentally, based on your definition, digital design would be considered "composition", since digital circuits are built using a small number of standard cells such as inverters, AND or OR gates and the like.
 
  • #73
dijkarte said:
Okay maybe this is something I should try as an assignment. :D

How do I do looping in circuits? For example apply the same circuit to signal n-times or t-time?

you would probably need to take a sampled-data approach. Look up "sample-and-hold".
 
  • #74
dijkarte said:
I agree, this is what I meant by synthesis. However the example you gave about a power-supply design is more a composition (building from existing components, topologies and tweaking) process than synthesis (starting from scratch). Let me give an example to clarify more what I'm talking about. An engineer is required to design an IC that takes in an analog signal and produces a signal which is the inverse of the original signal's function.

i.e input f(x) = x^2 the result is g(x) = sqrt(x)

Starting from a scratch, using transistors, diodes, and passive elements, how would he/she approach such a problem?

Please note, this circuit probable invented 1000 years ago, I don't know nothing, so my example is just for illustration purpose only. :D

I thought a bit about this issue and what you would really do in practice is design an IC that digitizes the signal then computes the inverse using known mathematical techniques. There would be a million specifications to be thought through before this circuit could be designed.
 
  • #75
I'm now thinking about applying a circuit to a signal multiple times. For example, I want to differentiate a signal f(t) using a differentiating amplifier. But I'm interested in finding nth derivative of the signal, and I don't want to hard wire a series of amp's. I just want to use the same amp.
 
  • #76
dijkarte said:
I'm now thinking about applying a circuit to a signal multiple times. For example, I want to differentiate a signal f(t) using a differentiating amplifier. But I'm interested in finding nth derivative of the signal, and I don't want to hard wire a series of amp's. I just want to use the same amp.

You're going to need a sample-and-hold (S/H) circuit. Here's the algorithm.

1. Sample the input
2. loops = order
3. do
4. Apply S/H output to the differentiator
5. Reset S/H
6. Sample the output of the differentiator with S/H
7. loops = loops - 1
8. until loops == 0
9. enddo

you're also going to need a clock to drive the S/H.

This is a slightly advanced design.
 
  • #77
Thanks :)

I see how it's complicated now. Where can I learn all these tricks, which electronic book?
 
  • #78
dijkarte said:
Thanks :)

I see how it's complicated now. Where can I learn all these tricks, which electronic book?

It will take a while to digest them all. The links I posted for the Analog Devices information and the Analog Chips book will go a long way.
 
  • #79
I read some article by an expert advising against Spice:

http://electronicdesign.com/article/analog-and-mixed-signal/what-s-all-this-spicey-stuff-anyhow-part-iii-5632

I'm not sure if it's Spice in particular or any circuit simulation software?

The way to go is do it in the lab and test a real circuit, but this is for a learner like me a very expensive approach since those test equipment are ridiculously over priced. A decent oscilloscope costs thousands.

I tried the OrCad PSpice and it's not bad except for the GUI which sucks. Usability from a software interface design perspective is below average.
 
Last edited by a moderator:
  • #80
dijkarte said:
I read some article by an expert advising against Spice:

http://electronicdesign.com/article/analog-and-mixed-signal/what-s-all-this-spicey-stuff-anyhow-part-iii-5632

I'm not sure if it's Spice in particular or any circuit simulation software?

The way to go is do it in the lab and test a real circuit, but this is for a learner like me a very expensive approach since those test equipment are ridiculously over priced. A decent oscilloscope costs thousands.

I tried the OrCad PSpice and it's not bad except for the GUI which sucks. Usability from a software interface design perspective is below average.

This is a well known article by Bob Pease. I knew him, he passed away last year. The article, however, is obsolete. SPICE has been developed continuously since then (he wrote it around 1990 I think) and all the issues he described have been largely dealt with. Even at the time Bob wrote this he held a highly minority viewpoint. SPICE is the gold standard for circuit simulation. It is impossible to test an integrated circuit idea in the lab before fabricating it, so SPICE has become a truly indispensable tool for design. Since you're interested in learning electronics, think of SPICE as an amazing, inexpensive learning laboratory.

I agree PSpice kinda sucks. Much better (and free!) is LTSpice from Linear Technology. Get it here: http://www.linear.com/designtools/software/
 
Last edited by a moderator:
  • #81
So there are different versions of GUI-based Spice all sit on top of the same base non-gui Spice code? Then using different versions does not affect the simulation result.
 
  • #82
No, SPICE is not "one program" anymore (hasn't been since the 60s.). It is more a way to approach solving linear differential equations. It turns out this is a good way to solve circuits too, since they can be described well as a large set of linear differential equations. The code underlying LTspice will be completely different from the code underneath Pspice. Assuming they are both correct implementations, you're right the simulation outputs should agree (particularly for the simple simulations you are going to run). The difference is how easy to use it is and how robust it is to non-ideal situations.

You have probably read about convergence issues in SPICE. The problem stems from difficulties in inverting ill-conditioned sparse matrices. Different versions of SPICE deal with it in different ways, with different levels of success. Commercial versions of SPICE (or SPICE-like simulators) such as HSPICE, Spectre, and Eldo can handle huge circuits without too many problems with convergence. My point is that SPICE is more a philosophical approach to circuit simulation than it is a relevant code base.
 
  • #83
IC. Spice is more like an open specification for a circuit simulation model.
 
  • #84
Yep. As far as I know the source code is in the public domain. Modern simulators use much for sophisticated techniques because they have to deal with circuits with millions of devices.
 
  • #85
dijkarte said:
I read some article by an expert advising against Spice:

http://electronicdesign.com/article/analog-and-mixed-signal/what-s-all-this-spicey-stuff-anyhow-part-iii-5632

I'm not sure if it's Spice in particular or any circuit simulation software?

The way to go is do it in the lab and test a real circuit, but this is for a learner like me a very expensive approach since those test equipment are ridiculously over priced. A decent oscilloscope costs thousands.

IMO circuit simulation software at the beginner level is great for letting you think you can handle a Superbike while physically you can only manage to pedal a tricycle. Software assisted design is great after you know how to do the same thing with a pencil, paper, vector board and wire jumpers but "electronics" is not engineering. Learning "electronics" is a physical act that requires real circuits. You seem to want to skip actual electronics and that's great if you never plan to actually build anything.

Buy some used or cheap equipment and a soldering iron.
 
Last edited by a moderator:
  • #86
IMO circuit simulation software at the beginner level is great for letting you think you can handle a Superbike while physically you can only manage to pedal a tricycle.

Then this is bad not great for beginners.

Software assisted design is great after you know how to do the same thing with a pencil, paper, vector board and wire jumpers but "electronics" is not engineering.

I think you are misunderstanding the purpose of circuit simulation software in learning.
Doing it on paper and and understand the fundamental concepts come first and are very essentials.

I see here 3 main uses at least for someone novice like me:

Verifying answers that I do on paper.

Try more complex circuits that doing it on paper will take very long trying to solve the math.

Develop a common sense of how circuits work by easily modifying a circuit and see the effect of this modification.

In short, to speed up the learning rather than skipping the essentials.

Like learning programming, it cannot be always on paper, must see things in action.

Buy some used or cheap equipment and a soldering iron.

I'm not sure if this is affordable to many. I would rather postpone this till I get the basics and then move to simple projects to implement.
 
  • #87
dijkarte said:
I see here 3 main uses at least for someone novice like me:

Verifying answers that I do on paper.

Try more complex circuits that doing it on paper will take very long trying to solve the math.

Develop a common sense of how circuits work by easily modifying a circuit and see the effect of this modification.

I'm not sure if this is affordable to many. I would rather postpone this till I get the basics and then move to simple projects to implement.

I think tactile and mechanical memories are very important while learning the basics of a skill that requires physical activity in a setting other than a school lab. Circuit simulation just like a calculator in math should be used when you are no longer learning basic circuits or the math at hand but need to speed up a mechanical process or optimization. The sad truth is guys with great math and simulation skills are a nickle a dozen these days and people with excellent troubleshooting and repair skills are treasures.
 
  • #88
Circuit simulation just like a calculator in math should be used when you are no longer learning basic circuits or the math at hand but need to speed up a mechanical process or optimization.

Your comparison here is not accurate. You know that in many fields that require physical training such as in aerospace, military, space missions, pilots require some decent training that can be made safe and efficient with simulation systems. These systems are a mix of mechanical and computer/software equipment through which they can experience things that could be dangerous to try in real. All simulation systems whether they are a mix of mechanical and software or pure software are all fit in one category to serve the same purpose.

However you example of the calculator more fits in the tools category, something different.
An CAD design program for architectural drawing is a better example of a software that is used for drafting vs. hand drawing. But there's no simulation. Take for instance someone designing a car engine, how would it be without using a simulation system? or even students will have to learn how to use these systems to study their designs in an efficient manner, much less cost, less time. And all of this can be done either after or while learning the basics.

Learning is different than what it was 1000s years ago. If you can get a sense of how things work while learning and see it in action in a virtual world better than postpone until you lose interest in the subject and probably drop out of the course.

Something similar to programming. I'm learning the basics, data structures and how to create linked list, hash tables, binary trees, some sorting techniques...etc. At the same time I can use libraries that provide these tools for me. I do it both ways and I learn both at the same time. I cannot say I'm a better programmer if I create my own data structures and algorithms every time I make a project, than someone who uses well-tested and very likely more efficient tools that help in speeding up the work.

So even calculators save us a lot of time, but they don't not make people less skilled engineers. :)
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 23 ·
Replies
23
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
Replies
2
Views
2K
Replies
2
Views
5K
Replies
29
Views
5K
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K