Questions tagged [circuit]

In a programming context, a circuit usually refers to a combination of logical operators to achieve a desired response. Use this tag to ask about basic logical implementations and loops you can't get your head around.

In a programming context, a circuit usually refers to a combination of logical operators to achieve a desired response. This could be implemented in hardware (see: electronic/electrical engineering) but in software the key issue is the logic.

Use this tag to ask about basic logical implementations and loops you can't get your head around.

Logical operators include AND, OR, NOT, NAND and NOR gates, and judicious combinations of these can be used to construct just about any possible structures.

303 questions
2
votes
0 answers

Implementing an analog circuit simulator using nettype'ed nets

For electrical net simulation in SV, I'd like to implement a trapezoidal integration method using companion models for caps and inductors. [http://circsimproj.blogspot.nl/2009/07/companion-models.html] Some simulation tool vendors provide a SV…
bardo
  • 390
  • 1
  • 9
2
votes
1 answer

Matlab program for calculate logical circuit outputs

I had to calculate every output on this logical circuit, and i dont have any experience with electronic. So, i searched for the meaning of the symbols and i build my program on Matlab. Somebody can look and help me if i did it wrong or pointing a…
2
votes
3 answers

Universal shift arithmetic right in VHDL

I am designing universal shift arithmetic operator. Is there a better way to achieve it besides using the 32bit multiplexer (decoder) in a way presented bellow? ENTITY isra IS PORT ( clk: in std_logic; rst: in std_logic; di: in…
name
  • 5,095
  • 5
  • 27
  • 36
2
votes
2 answers

Can't get simple Bit Sequence Recognizer circuit to work (FSM)

This is a simple exercise for a Hardware course that I am taking. We are required to use Altera Quartus II and ModelSim to test the implementation; tools that I've never used before, so I might be missing something, and my explanations, lacking. The…
David
  • 447
  • 3
  • 15
2
votes
1 answer

How to add a hand-layout custom circuit as a new std cell and refer to it in verilog?

We have a critical circuit at the heart of our implementation, which is the speed limiter for the entire design. It consists of just a couple dozen gates. We have implemented a custom transistor level circuit for this function by hand, done a…
seanhalle
  • 973
  • 7
  • 27
2
votes
3 answers

Need help on selecting items in simple database in python

I'm trying to write a circuit schematic drawing tool in Python. I'm creating a simple database based on dictionaries which holds all the components and their properties. I'm also trying to create a simple query language where you can select, for…
michael
2
votes
1 answer

How to start lighting up at 45 degree in aurduino flex sensor?

I want to make the led strips gradually lights up as the flex sensor bends. But I want the led strips start to light up when the flex sensor is 45 degree. And I want the led strips to be off before 45 degree. Here is my code which is in…
2
votes
2 answers

When should I use reg instead of wire?

I'm confused about reg and wire when I was doing my homework. I could not understand differences between reg and wire exactly. Can you explain shortly? Also, I wonder that what will happen when I use output q instead of output reg q?
Marc Blume
  • 79
  • 1
  • 2
  • 8
2
votes
0 answers

Find all cycles of graph using the cycle bases (fast python implementation)

For a huge graph I need an efficient implementation for Python to find all the cycles/circuits in the graph. Currently I am using the package networkx function cycle_basis, which "returns a list of cycles which form a basis for cycles of G. A basis…
PeterHeuz
  • 390
  • 1
  • 4
  • 17
2
votes
1 answer

Desigining a datapath to sum the greatest two of three inputs

I need to implement a datapath for the following problem: "Design a combinational logic device that will take as input three unsigned numbers x, y, and z, and output the sum of the largest of the two. You may use any of our combinational datapath…
GenericUser01
  • 337
  • 3
  • 11
  • 27
2
votes
2 answers

Is there a programming language for designing and web publishing electronic circuits?

there are good languages to publish math contents on the web. But, is there any such language for electronic circuits diagrams. Which can help you design circuit diagrams, save in several formats [.pdf,.ps, .djvu etc] and publish on the web? By,…
user268157
2
votes
1 answer

Any NP to SAT. How to do that and prove that it is possible?

Let's start here: It is said that all NP problems can be reduced to SAT(boolean satisfiability problem). To be more accurate to Circuit SAT, because all decision problems like NP should end up with answer Yes or No. But now, if I have a random NP…
2
votes
1 answer

Half Adder and Full Adder logic?

I'm Having trouble getting my half adder and full adder tests to pass, and I'm wondering whats wrong with my logic in the FullAdder() and HalfAdder() methods? None of my tests seem to be passing for some reason... Heres The code: # All wires…
Doug Barta
  • 161
  • 2
  • 15
2
votes
2 answers

Overflow and carry flag

The context I read in a textbook that... An addition and subtraction cannot cause overflow. To quote, "An overflow cannot occur after an addition if one number is positive and the other negative, since adding a positive number to a negative number…
2
votes
2 answers

How to define a primitive device in Proteus?

I'm trying to make my own full adder and some other devices as a sub-circuit in "Proteus" and use them several times in a bigger circuit. The problem is when you copy a sub-circuit you need to rename all of its inner parts, otherwise, the parts with…
AmirAhmad
  • 153
  • 3
  • 12