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
1
vote
2 answers

ADC Analog to digital conversion

Can someone look at my code? I'm trying to get 8 LEDs to rotate as I rotate the potentiometer, but four LEDs stay on the whole time not rotating at all. #include /******************************************************** * xx/xx/xx - Put…
1
vote
1 answer

How to build a comparison operator (comparitor) in an arithmetic circuit

I am trying to convert a basic program into an arithmetic circuit. I am stuck on the step of converting the greater than operator into an arithmetic circuit. To be specific, I do not know how to convert the following into an arithmetic circuit…
1
vote
1 answer

How is Boolean Algebra efficient in practise?

Thanks for taking the time, just as a note, l understand the basics of Boolean Algebra. Although l understand how Boolean Algebra is a useful optimization technique in very small circuits, surely it would take far too long in a realistically-sized…
1
vote
1 answer

Does one need to have Xyce installed in Windows 10 to use PySpice? Or does PySpice already run with a "Xyce engine"?

I am very unfamiliar with these low level setup instructions for open source circuit simulators. Basically, I want to be able to simulate a not too terribly complex circuit in Xyce. I am running Windows 10 and the instructions to download Windows 10…
user P520
  • 317
  • 2
  • 10
1
vote
3 answers

What are the difference in delay times of the basic AND, OR, NOT, NAND, NOR, XOR, XNOR gates?

1-1 What are the difference in delay times of the basic logic gates? I found that NAND and NOR gates are preferred in digital circuit design for shorter delay time and that AND and OR gates might even be implemented with NOT and NAND/NOR gates.…
Chillax
  • 21
  • 6
1
vote
2 answers

How can I code 3-bit binary counter module based on state diagrams?

I want to build a module based on this state diagram. The code below is the module I wrote and the test bench.When you build this, you can face this error. ./3bit_c_sdiagram.v:1: syntax error I give up. How can I solve this syntax error? and If…
1
vote
1 answer

DP to find number of ways a binary boolean expression tree can evaluate to true

We have a circuit that is in a shape of a tree. The inputs are the leaf nodes, at the very bottom, and leaf nodes can either be joined by an AND gate or attached to a NOT gate. There is some root node that outputs a final value. I've been trying to…
hologram
  • 533
  • 2
  • 5
  • 21
1
vote
1 answer

How to print 'Hello world in python' through pressing a button connected to the terminal on a piface digital 2

I have recently purchased a 'Piface Digital 2' and have been able to create programs to light up the built in LED'S with the built in buttons (as by watching the tutorials). However now I have been trying to attach a external button via the…
user8868975
1
vote
1 answer

How to run ngspice from command line & suppress output to terminal?

I'm learning ngspice and would like to suppress the standard output on my terminal. I didn't see a corresponding option in the user manual and am wondering if I simply overlooked it.
Brian Piercy
  • 631
  • 1
  • 7
  • 22
1
vote
2 answers

4 input logic gate, but all inputs not present in final formula

I need to draw a logic circuit using this K map.. but how can I represent all the other inputs on the circuit? I get (not)B as the answer.. but how should I show A C and D in the circuit?
user7493531
1
vote
1 answer

Is it possible to implement a PID controller in Simscape (branch of Simulink)?

I am trying to implement a PID controller in a Simscape circuit model but the system doesn't seem to like my format. I am using the PID controller block from Simulink and implementing it within Simscape using the convert from source to Simulink…
1
vote
0 answers

Create 1-bit Comparator with mux

I want to make a 1-bit comparator with 2x1 mux or 4x1. I have made this 2x1. I am stuck in this situation. 1 bit comparator with 3 2x1 mux: 2x1 mux: I have to use only the 2x1 mux or 4x1, NOT gates as well as stable volt power (0 or 1). What do I…
nokotsos
  • 21
  • 1
  • 5
1
vote
0 answers

comparing two 3-bit numbers with a 2-bit output

I have two 3-bit numbers A2A1A0 and B2B1B0 and I have to compare them and generate a 2-bit output based on if A > B, A < B , and A = B. The only circuit I can use to implement this is a multiplexer. I've made a truth table; however, i'm not sure how…
whatthink12
  • 39
  • 1
  • 4
1
vote
1 answer

circuits using karnaugh's map technique

A combinational circuit is to be designed that counts the number of occurrences of 1 bits in a 4 bit input. However, an input 1111 is an invalid input for the circuit and output in such case will be 00. One valid input for such circuit may be 1110…
1
vote
1 answer

Draw a logical circuit python

I am trying to make a code that it will take as input a boolean expression like: " A && B || C" and it will draw the logical circuit as output. The programming language that i used is python. Can you suggest me any program or library that I can use…
David Vat
  • 21
  • 2