Questions tagged [truthtable]

A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra, boolean functions, and propositional calculus—to compute the functional values of logical expressions on each of their functional arguments, that is, on each combination of values taken by their logical variables.

In particular, truth tables can be used to tell whether a propositional expression is true for all legitimate input values, that is, logically valid.

Practically, a truth table is composed of one column for each input variable (for example, A and B), and one final column for all of the possible results of the logical operation that the table is meant to represent (for example, A XOR B). Each row of the truth table therefore contains one possible configuration of the input variables (for instance, A=true B=false), and the result of the operation for those values.

210 questions
4
votes
1 answer

Solving logical expressions in Java with minimum iterations

I'm working on solving the logical expressions in Java comprising of AND, OR, and NOT operators. The program has to output if the input was TRUE for any Boolean values of the variables included. I've done it successfully but it is not efficient…
4
votes
5 answers

Generating all possible true/false combinations

I want to create an array of all possible combinations of three variables that can either be true or false (i.e. 8 possible combinations). I am trying to create the cube in the top left corner at this image So the output should be something…
mortensen
  • 1,167
  • 2
  • 13
  • 23
4
votes
3 answers

Making truthtables in python

I'm having some trouble doing some homework related to making truthtables in Python. I've tried going to Office Hours, but they don't know anything so I gotta ask you guys. Here's the question: -- In this problem, you will implement functions for…
Aleksander
  • 2,735
  • 5
  • 34
  • 57
4
votes
4 answers

Function with don't-care inputs

How can I implement a VHDL function which has "don't care" inputs and have the "don't cares" be directly represented? Exercise 4.8-2a of Free Range VHDL asks me to: ...write VHDL models that implement these functions using...selected signal…
Wayne Conrad
  • 103,207
  • 26
  • 155
  • 191
4
votes
3 answers

Create Reduced Ordered Binary Decision Diagram (ROBDD) from truth table

Is there a software package (preferable an application, not library) that creates Reduced Ordered Binary Decision Diagrams (ROBDDs) from a given truth table (in some text format)?
tomash
  • 687
  • 1
  • 6
  • 17
3
votes
2 answers

Access to nth bit without a conditional statement

So I have a bit sequence: 1010 1 is the MSB. My function needs to return an integer of 0 if an odd bit is 0 or a 1 if its a 1. I cannot use any for loops or anything of that nature to see if I need to return a 0 or 1. Does anyone have any…
David
  • 175
  • 1
  • 4
  • 8
3
votes
3 answers

tool for testing logic expressions

can anyone recommend software (preferably for mac) or a web based tool, that can be used to evaluate logic expressions? For example I would like to be able to quickly test whether two expressions like: $a = 'foo'; $b = 'bar'; $c = 'foo'; ( !(($a ==…
mikkelbreum
  • 3,021
  • 9
  • 38
  • 41
3
votes
2 answers

How to tell if there is fault in the truth table?

In my digital design and computer architecture class.Our teacher gave a truth table for which we had to construct a K-map and minimize it to find the boolean expression But some of the students quickly identified that there were mistakes in the…
3
votes
4 answers

Truth table for the zebra puzzle

I'm reading "Computer Science distilled" book and I've faced a trouble. Author suggests to solve Einstein's "Zebra puzzle" through truth table, but I can't figure out how. I can't find starting conditions and variables. Do you have any ideas of the…
Igor
  • 198
  • 1
  • 11
3
votes
0 answers

Constructing truth table headings in boolean logic with Java

I am working on a small project to construct truth table based on an infix boolean logic expressions. Example: A ∧ (B ∨ C) I am able to convert this to postfix: ABC∨∧ and thus am able to construct the expression into a binary tree (can convert the…
alistaircol
  • 1,433
  • 12
  • 22
3
votes
4 answers

Truth table array

I'm stuck on how to begin coding this. I want to be able to do the following. It's a classic flipping the coin problem If I flip twice the out comes are: T T T F F T F F I want to be able to create an array with one result at a time. To…
Ceelos
  • 1,116
  • 2
  • 14
  • 35
3
votes
1 answer

Basic identities of logical expressions and deriving logical expressions from truth table?

I was wondering what a basic identity of a logical expression is and how to get it. I looked on google but couldn't find anything about it. Say, for example I have a logical expression ~(~(P ^ ~(P ^ Q)) ^ ~(Q ^ ~(P ^ Q))) Below is the result I got…
2
votes
2 answers

Can high numbers of causal conditions produce errors in QCA analysis?

I am trying to run a QCA analysis of some crisp and some fuzzy sets. I have 50 variables (causes) that I am interested in using to produce a truth table. In doing this work, I've run into different errors when using superSubset() and minimize().…
jlcohoon
  • 31
  • 4
2
votes
4 answers

Find the Simplified Sum of Products of a Boolean expression

Just having some problems with a simple simplification. I am doing a simplification for the majority decoder with 3 inputs A, B and C. Its output Y assumes 1 if 2 or all 3 inputs assume 1. Y assumes 0 otherwise. Select its correct switching function…
Jake Pillandfall
  • 31
  • 1
  • 3
  • 5
2
votes
1 answer

How to scan through user input and cut it into chunks in c++?

I'm making a program to evaluate conditional proposition (~ or and -> <->). As the users input propositional variables and truth values (true, false) ,and proposition; the program will go through the inputs and return the truth value for the whole…
1
2
3
13 14