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
4
votes
3 answers

How do I convert a number to two's complement in verilog?

I am trying to design a 4-bit adder subtracter in verilog. This is only the second thing I have ever written in verilog, and I don't know all the correct syntax yet. This is the module I have so far: module Question3(carryin, X, Y, Z, S, carryout,…
Zachary Wright
  • 23,480
  • 10
  • 42
  • 56
4
votes
2 answers

How to recursively check for attributes in an object?

I've been working a circuit simulator, kind of like Minecraft's red-stone, but in 2d. So far, I have power sources and wires. The power sources give power to the wire, which will later be used to power other components. The problem I am facing is…
Sam Tubb
  • 945
  • 3
  • 19
  • 40
4
votes
6 answers

Simple serial AVR programmer for beginner

What is the cheap and good way to make a serial (RS232) programmer for AVR atMega and atTiny? There are several circuits in the Internet, but which one is better? I'd like to be able to program my controller from Linux and Windows using some…
Andrew T
  • 5,549
  • 7
  • 43
  • 55
4
votes
2 answers

Fast accessing elements of Compressed Sparse Row (CSR) sparse matrix

I want to test some of the newer sparse linear solvers and I want to know if there is a fast way of filling in the matrix. The format I'm interested is CSR (http://goo.gl/hLXYd). Let's say the matrix, in CSR format, is given by: values(num non-zero…
electrique
  • 431
  • 6
  • 18
3
votes
1 answer

Pedersen circom/circomlibjs inconsistency?

As a unit test for a larger use case, I am checking that indeed the pedersen hash I am doing in the frontend aligns with the expected hash done through a circom circuit. I am using a simple assert in the circuit and generating a witness and am…
TIZ
  • 131
  • 8
3
votes
2 answers

How to represent combinational circuits in code

I'm writing a python program that does some operations on combinational circuits like comparing for equality to other circuits, merging gates, counting gates, counting connections, finding fanout gates,... Right now im representing the combinational…
David Peters
  • 90
  • 1
  • 6
3
votes
2 answers

"error: no matching function for call to" constructor errror

im trying to construct a circuit simulator and running into some erros with inherritance. I think im just confused because ive been staring at it for too long, so would appreciate some help. error message: prep_3.cpp: In constructor…
user7679831
3
votes
1 answer

How is the NAND gate implemented? (Conceptually)

I am trying to find the lowest level of things that you just can't implement because they are too low level. So it seems that all computation can be constructed from the NAND gate. From the truth table it is easy to "implement" in…
Lance
  • 75,200
  • 93
  • 289
  • 503
3
votes
6 answers

Use USB to activate MOSFET/Relay

I am working on a personal project involving sending simple signals from my computer to a circuit via USB. Basically I am using the USB signal as the gate signal for a MOSFET which will in turn activate a relay to turn on/off various AC peripherals.…
FlyingStreudel
  • 4,434
  • 4
  • 33
  • 55
3
votes
1 answer

How can I do modeling in reverse by parsing a C program and turning it in to a circuit diagram to be displayed

How can I do modeling in reverse by parsing a C program and turning it in to a circuit diagram to be displayed. Example Except this is psedocode.
Paul
  • 198
  • 1
  • 9
  • 22
3
votes
1 answer

Circuitmaker - define board size manually

Been testing out Circuitmaker for a few days now. Since I am a forme EAGLE user, I have quite a hard time figuring certain basic functions out. The most important one to me is the board size definition. Is it possible to define the board size just…
3
votes
2 answers

Boolean expression simplification

I am trying to simplify a Boolean expression with exactly 39 inputs, and about 500 million - 800million terms (as in that many and/not/or statements). A perfect simplification is not needed, but a good one would be nice. I am aware of the K-maps ,…
user761996
  • 83
  • 1
  • 8
3
votes
1 answer

Cannot retrieve data from ECG - Arduino

Hi StackOverflow community, For the past couple of weeks, I have not been able to find a solution to my problem. My problem is that I cannot retrieve the data from my homemade ECG that I created from Arduino. I am a total amateur at this, but I'm…
3
votes
3 answers

How to read multiple Analog sensor

I am using Arduino UNO board. I have 24 analog channel which gives me 0~5v analog out put. Now my problem is I have only 5 analog channel. I wanted to read value from each channel for every 2 min and then switch to other channel. Can anyone suggest…
AMPS
  • 319
  • 3
  • 11
3
votes
1 answer

Boolean equation from circuit

Could someone please help me understand what the boolean equation performed by this circuit would be?
petrov
  • 1,085
  • 3
  • 12
  • 13
1
2
3
20 21