Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [logic-gates]

A challenge either involving using logic-gates as the coding language or outputting logic gates.

13
votes
15answers
1k views

Logic Gates Manually

Make a program that simulates the basic logic gates. Input: An all-caps word followed by 2 1 digit binary numbers, separated by spaces, such as OR 1 0. The gates <...
5
votes
0answers
258 views

What is the simplest reversible circuit that computes conjugacy of transpositions?

Reversible computation refers to computation in which little or no information is deleted. Reversible computation a major component of quantum computation, and reversible computation is potentially ...
1
vote
0answers
141 views

3-inverter with two NOT gates [closed]

Introduction I recently came across an oral exam where the candidates were asked to find a logical circuit than can negate 3 inputs A,B,C using only two NOT gates. ...
16
votes
2answers
410 views

Gerrymandering with Logic Gates

The majority function is a boolean function which takes three boolean inputs and returns the most common. For instance if maj(x,y,z) is the majority function and <...
12
votes
7answers
1k views

Draw the XNOR digital timing diagram

Below is a (schematic) Digital timing diagram, for the XNOR logic gate. ...
9
votes
2answers
405 views

The logical quine

The challenge Simply write a program that outputs its own source code. Nothing more than a regular quine. The problem We don't have a computer so we have to run the program on a programmable logic ...
17
votes
2answers
305 views

Given a truth table, output a Stackylogic program that satisfies it

Stackylogic is a programming language I made up in a previous challenge: Run Stackylogic. Read that post for full details and examples, but here is how it works paraphrased: Stackylogic takes ...
44
votes
11answers
2k views

Run Stackylogic

Stackylogic is a logic-based programming language I made up that take in 0's and 1's for input and outputs a single ...
62
votes
77answers
10k views

Golf all the 16 logic gates with 2 inputs and 1 output!

For example, the gate A and B is a logic gate with 2 inputs and 1 output. There are exactly 16 of them, because: each logic gate takes two inputs, which can be ...
8
votes
9answers
375 views

Create a Boolean parser (continued)

Continuation of this challenge because the author is gone and the question is closed. What you need to do is create a Boolean parser. Boolean expressions, in case you haven't heard of them yet, have ...
12
votes
4answers
434 views

Build a 4-vertex Connectedness Tester using NAND gates

A connected graph is a graph that contains a path between any two vertices. Challenge Build a [2-input NAND-gate] circuit that determines whether a 4-vertex graph is connected. (A gate's 2 inputs ...
13
votes
9answers
988 views

Truth Tables: Your great-grandfather's computer

If you remember back to your schooling years, you might remember learning about Truth Tables. They seemed boring, but they are basis for logic and (some would argue) all computing... Problem Your ...
15
votes
5answers
2k views

Express all 16 boolean functions with the less than operator

There are 16 distinct boolean functions for two binary variables, A and B: ...
33
votes
6answers
1k views

Grid Based Digital Logic (Duodyadic Tiles)

Duodyadic tiles are kinds of square function blocks that take two inputs, one from their top side and one from their left side, and have two outputs, one on their right side and one on their bottom ...
7
votes
2answers
870 views

Create a universal two-dimensional cellular automaton cell using two-way universal logic processors

In Conway's Game of Life, a cell is in a state of either on or off, depending on the on-and-off state of the eight cells surrounding it. We can simulate this using a logic gate network with some sort ...
8
votes
4answers
3k views

Drive a hexadecimal 7-segment display using NAND logic gates

The ubiquitous 7-segment numerical display can unambiguously display all 16 hexadecimal digits as show in this wikipedia .gif Entries for this challenge will create a circuit diagram using NAND logic ...
36
votes
1answer
2k views

Domino Circuits

Scoreboard Here are the raw scores (i.e. domino counts) for VisualMelon's submission. I'll turn these into the normalised scores described below, when more answers come in. The existing solution can ...
9
votes
1answer
796 views

Build an EBCDIC converter using NAND logic gates

In this question, a mapping is defined between EBCDIC and a superset of ISO-8859-1. Your task is to build a network of two-input NAND gates that will take eight inputs ...
13
votes
1answer
544 views

Build a minifloat adding machine using NAND logic gates

A minifloat is a binary representation of a floating-point number that has very few bits. The minifloat in this question will be defined as an 6-bit number m, ...
11
votes
2answers
1k views

Build a bit-counting comparator using NAND logic gates

A bit-counting comparator (BCC) is a logic circuit that takes some number of counting inputs A1, A2, A3, ..., An as well as inputs ...
8
votes
3answers
733 views

Build a 2-way universal logic processor using NAND logic gates

A 2-way universal logic processor (2ULP) is a network of logic gates that takes two input wires A and B, as well as four other ...
12
votes
3answers
3k views

building circuit for divisibility by 3

A boolean circuit in TCS is basically a DAG consisting of And, Or, Not gates, and by what is known is "functional completeness" they can compute all possible functions. eg this is the basic principle ...
9
votes
8answers
2k views

A simple logic gate calculator

Your mission, if you choose to accept it, is to construct a simple truth evaluator for the following logical operators: ...
11
votes
2answers
935 views

Implement superoptimizer for addition

The task is to write code that can find small logical formulae for sums of bits. The overall challenge is for your code to find the smallest possible propositional logical formula to check if the sum ...
3
votes
1answer
474 views

More fun with gates: Karnaugh simplification

Take a classic Boolean function with 4 variables, and perform a Karnaugh simplification (you can use any other method of Boolean algebra to arrive to the simplest form). The catch is: the result has ...
18
votes
2answers
6k views

Build a multiplying machine using NAND logic gates

Based on my previous question of the same type, Build an adding machine using NAND logic gates, this time you're being asked to multiply instead of add. Build a diagram of (two-wire) NAND logic gates ...
4
votes
3answers
672 views

Build a NAND gate using multiple NAND gates

A question that had popped up in my head once - how many NAND gates would it take to build a larger, "meta-NAND" gate? Your task is to build a black-box circuit that takes two input wires ...
6
votes
1answer
2k views

Build an adding machine using NAND logic gates

This is "programming" at its most fundamental. Build a diagram of (two-wire) NAND logic gates that will take the input wires A1, ...