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

Implement a function using Boolean Circuit

I need to implement some multi-variable function in a Boolean Circuit; what tools do we have in order to automatically convert some arithmetics into a boolean circuit? For instance, part of the formula I want to implement is the operator max(a,b)…
Bush
  • 2,433
  • 5
  • 34
  • 57
0
votes
1 answer

Truth tables representing boolean equations

Please see the attached photo of a question I am confused on. Please do note I am not looking for the answer, but maybe a sense of direction of how I can solve this please! I do not know how to solve this and would like to know how please.
h_s
  • 1
0
votes
1 answer

Why bitshift when evaluating truth tables as binary numbers?

The last answer in this question shows that a binary truth table can be represented as a binary number: 0 0 0 | 1 0 0 1 | 1 0 1 0 | 0 0 1 1 | 0 1 0 0 | 1 1 0 1 | 0 1 1 0 | 1 1 1 1 | 0 Can be represented by 01010011. The entries in the…
Josh M.
  • 387
  • 4
  • 13
0
votes
2 answers

Splitting a string based on specific characters

I will try to describe my problem as well as I can. I am trying to write a program that will handle equations like: F = (X∨A) ↔ (X∨B) ( (X OR A) is equivalent to (X OR B) )! I have to solve it by 'X', or to better say, write disjunctive and/or…
spamserv
  • 165
  • 3
  • 15
0
votes
2 answers

Circuit design that outputs square of binary input

So for my digital logic course, we were asked to design a combinational circuit with 3 inputs, and an output that generates the square of the binary input. I assume she means the inputs are 3 bit binary numbers 0-7. In describing the solution, she…
Matt
  • 17
  • 1
  • 1
  • 2
0
votes
1 answer

Is it possible in Python to write a sort of truth table to simplify the writing of if statements?

Let's say I'm trying to print out the orientation of a tablet device using its accelerometer that provides acceleration measurements in the horizontal and vertical directions of the display of the device. I know that such a printout could be done…
d3pd
  • 7,935
  • 24
  • 76
  • 127
0
votes
1 answer

Create a dynamic truth table with few fixed variables

I have an expression like below: TXTXFX I need to create different combinations by replacing X by "T" and "F". The expression might change based on the input. I am using python to do it using lengthy for loops. (not yet achieved it) Could you please…
0
votes
0 answers

Java Truth Table Stack - Pop only returning last calculated value?

I'm having trouble phrasing my question correctly, so bear with me. It may be better to give an example. Here's what I get when I run for P&Q&R PQR: TTT = T FFF = F TTF = F FFT = T TFF = F FTT = T TFT = T FTF = F It's just looking at R and taking…
Link2999
  • 5
  • 4
0
votes
1 answer

Reading logical operators expression for truth table C++

I am trying to write a code that will take an expression that is formatted similar to (((p∨q)∧((q→r)⊕(p∧r)))↔(r∧q))→(p∨r) and it needs to print out the truth table for it which looks something like p q r (p V q) (q→r) etc... until it gets to…
Duncan
  • 719
  • 1
  • 6
  • 7
0
votes
0 answers

Selecting first failure from truth table c#

I have a datatable with 4 columns of data, the first with limit values and the next 3 with the maximum values (of a different table). I need to run a truth table that will find the first value which fails limval > maxval. Then I need to output the…
0
votes
2 answers

Is my truth table for this Logic Circuit correct?

How would I make a truth table for this Logic Circuit My attempt: I think the logic expression would be along the lines of: Z= −(−(A∧B)∨−(A∧B)∧−(B∧C))∧(−(A∧B)∧−(B∨C))
Linus Gill
  • 53
  • 1
  • 1
  • 7
0
votes
1 answer

Truth Table For Switching Functions

Can someone explain how these concept works? I have 1 question. But I don't know have any ideas on constructing the truth table. f(A,B,C) = AB + A’C The answer given was ABC + ABC' + A'BC + A'B'C And i have no idea how it get there. :-(
Beta Tracks
  • 263
  • 2
  • 5
  • 14
0
votes
2 answers

Fuzzy Qualitative comparative analysis

Let’s suppose I have the following data frame: mydata <- data.frame(cond1=c(0.9,0.6,0.9,0.5,0.2,0.2,0.9,0.7,0.1,0.1,0.6), cond2=c(0.7,0.7,0.2,0.9,0.9,0.2,0.2,0.9,0.3,0.4,0.9), …
perevales
  • 81
  • 1
  • 6
0
votes
2 answers

Creating dictionary dynamically in Python

I have this list and number: list = ['B','C'] The outcome that I need for my table is: B C Prob 0 0 x 0 1 x 1 0 x 1 1 x How can I build this truth table (there can be more vairables, not only 3) and assign a number to…
The Condor
  • 1,034
  • 4
  • 16
  • 44
0
votes
4 answers

How do I modify this truth table so that it uses and displays 1's and 0's rather than true and false

How do I modify this truth table so that it uses and displays 1's and 0's rather than true and false. public class Table { public static void main(String args[]){ boolean p,q; System.out.println("P\tQ\tAND\tOR\tXOR\tNOT"); …