The 2024 Developer Survey results are live! See the results

# Questions tagged [logic-gates]

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

37 questions
Filter by
Sorted by
Tagged with
774 views

### Evaluate Ternary Logic

Objective Given an expression involving ternary values, evaluate it into a ternary value. Ternary Values The three truth values in question are the values of Haskell's ...
• 6,219
1k views

### Implement the Conjunction of a Three-Valued Logic

Your task, should you choose to accept it, is to take two input values $a$ and $b$, where $a$ and $b$ are in the set $\{T, U, F\}$, and compute and output their logical conjunction in a ...
• 1,623
2k views

### Implement a very simple ALU using only NAND gates

Note: This challenge was inspired by Joe Z's many excellent questions surrounding NAND golfing. Description Your goal in this challenge, should you choose to accept it, is to implement a very simple ...
• 1,623
1k views

### Counting universal n-ary logic gates

Background A classical logic gate is an idealized electronic device implementing a Boolean function, i.e. one that takes a certain number of Boolean inputs and outputs a Boolean. We only consider two-...
• 78k
437 views

### Build the stove controller (physically)

Challenge Build the Wheat Wizard's stove using 2-input NAND gates. The solution with the fewest NAND gates wins. Externally, it works in the following way: (the first line is added from the original ...
• 78k
3k views

### What logic gates work given the input?

Introduction Logic gates! Everyone knows them, everyone loves them (unless you're starting to learn them). Take two booleans, compare them, get a single boolean in return. ...
3k views

### Evaluating Logic Gates

Logic gates are functions which perform basic logic operations. In this problem, we will account for the following 6 logic gates: AND, ...
• 22.8k
8k views

### Church Booleans

Church booleans A Church boolean is a function that returns x for true and y for false where ...
865 views

### Densely packed decimal (DPD) to decimal, with logic gates

Inspired by recent popularity of nandgame on TNB, and my own previous challenge. Background Densely packed decimal (DPD) is a way to efficiently store decimal digits in binary. It stores three ...
• 78k
2k 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 <...
• 1,184
411 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
203 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. ...
• 111
2k 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 <...
• 2,115
2k views

### Draw the XNOR digital timing diagram

Below is a (schematic) Digital timing diagram, for the XNOR logic gate. ...
• 8,496
642 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 ...
• 2,103
395 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 ...
• 89.8k
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 ...
• 89.8k
18k 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 ...
• 49.9k
587 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 ...
• 49.9k
673 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 can ...
1k 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 ...
• 808
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: ...
• 89.8k
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 ...
• 89.8k
1k 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 ...
• 35k
7k 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 ...
• 72.3k
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 ...
• 197k
1k 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 ...
• 35k
873 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, ...
• 35k
2k 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 ...
• 35k
1k 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 ...
• 35k
5k 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 ...
• 379
4k 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: ...
• 914
1k views

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 ...
522 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 ...
• 8,109
13k 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 ...
• 35k
985 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 ...
• 35k