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
1 answer

Need help to figure out how the CLB of a FPGA is built (on this drawing)

there is a drawing of a configurable logic block(CLB) of a FPGA I am trying to figure out: (source: eet.com) So, my questions are: 1. What is the green rectangle and what does it do? 2. What is DIN (C2) and EC (C4)? Is EC the same as CE (clock…
genau
  • 184
  • 1
  • 5
  • 16
2
votes
1 answer

Frequency divisor in verilog

i need a frequency divider in verilog, and i made the code below. It works, but i want to know if is the best solution, thanks! module frquency_divider_by2 ( clk ,clk3 ); output clk3 ; reg clk2, clk3 ; input clk ; wire clk ; initial clk2 =…
2
votes
1 answer

Create Prolog Vocabulary

I am quite new to prolog, and I have some basic questions... I don't know if "vocabulary" is the right world in English, but I need to create one to describe an electronic circuit. My problem is, how do I create these functions and how I use the "="…
Diedre
  • 515
  • 4
  • 21
2
votes
1 answer

Matlab Undefined function or method 'C' for input arguments of type 'double'

function simps() A=[0,0]; B=[0,0]; set_param('circuit/LINE2','Capacitance',num2str(C(1))) sim('circuit') B=[Real,Reactive]; A=[A;B]; end C is a matrix. It contains 10 variables. Like 1,10,50,100 random.It is in uF. circuit…
Moz
  • 192
  • 1
  • 11
2
votes
2 answers

Make a simple circuit to dissipate power in VHDL

I'm looking for ideas on something simple to write that I can use to measure power. I just need it to make sure that my power measurement is working. I'm using Xilinx ISE 14.1 on a Virtex-6. I'd like a simple circuit to write and to synthesize. So…
Stuart
  • 1,733
  • 4
  • 21
  • 34
2
votes
1 answer

Race conditions

I'm currently stuck trying to understand two things related to race conditions. Issue 1: I have been presented with the following question: We consider the digital circuit and the value of its inputs a, and b as given below. For all logic gates, we…
methuselah
  • 12,766
  • 47
  • 165
  • 315
2
votes
1 answer

Recommend a Java Graphics API for this application idea

I want to make a tool for creating FSM control circuit simulations. NB! not the ALU part. Can anyone recommend a good Java API with as much functionality already available as possible? Itll basically be something like a graphical modelling language…
ollo
  • 926
  • 1
  • 14
  • 33
1
vote
1 answer

How to make synchronous counter that counts 3,5,7,0 and repeats?

How to make synchronous counter that counts 3,5,7,0 and repeats? I'm assuming I'll need three T-flip-flops?
user1090944
  • 445
  • 1
  • 8
  • 16
1
vote
1 answer

Mathematical division in circuitry?

(Is this the right site for this question?) I've recently been looking into circuits, specifically the one's used to preform mathematical functions such as adding, subtracting, multiplication, and dividing. I got a book from the library about…
master565
  • 805
  • 1
  • 11
  • 27
1
vote
2 answers

What's the point of OR-gate?

If you want to have 1 as an output if either of two inputs are 1, why don you need an IC gate when you can just connect two wires and have one output from them?
NoobDev4iPhone
  • 5,531
  • 10
  • 33
  • 33
1
vote
2 answers

VHDL - Undefined behavior in my key detection

I am designing a shift key detector.I wrote a test bench. The test showed that my implementation was incorrect. Here is the simulation in ModelSim. The red line indicated UNDEFINED. This behavior only occurred twice. What puzzled me is: why is…
CppLearner
  • 16,273
  • 32
  • 108
  • 163
1
vote
1 answer

PySpice: Simulate circuit with capacitor with defined initial condition

with PySpice I'm trying to simulate the discharging behavior of a capacitor with a defined initial condition in a circuit. This is a simplified example: import PySpice.Logging.Logging as Logging logger = Logging.setup_logging() import…
JKB
  • 11
  • 1
1
vote
1 answer

How to run a loop with unknown number of iterations in Circom?

I have the following circuit in Circom cicuit compiler: pragma circom 2.0.0; template MAIN() { signal len; len <== 32; for (k = 0; k < maplen; k++) { // do something } } component main = MAIN(); I'm getting an…
Ilia Sidorenko
  • 2,157
  • 3
  • 26
  • 30
1
vote
1 answer

How to use & (AND) operator in a signal in Circom

I'm trying to use & operator on a signal and get another signal in Circom circuit compiler language like so: pragma circom 2.0.0; template MAIN() { signal input a; signal output x; signal v; v <== 168; x <== v &…
Ilia Sidorenko
  • 2,157
  • 3
  • 26
  • 30
1
vote
1 answer

How to pass function argument by reference in Circom?

How to pass function argument by reference in the circom circuit language? I'm trying to do the following: pragma circom 2.0.0; function increment(foo) { foo++; } template MyTemplate() { signal input a; signal output b; var foo; …
Ilia Sidorenko
  • 2,157
  • 3
  • 26
  • 30