Code: Select all
var or;
var and;
var xor;
var binary = document.getElementById("binary").value;
var binarytwo = document.getElementById("binarytwo").value;
function truefalse(){
if (binary == 1 && binarytwo == 1){
document.getElementById("and").innerHTML = "1 or TRUE"
}else{
document.getElementById("and").innerHTML = "0 or FALSE"
}
if (binary == 1 || binarytwo == 1){
document.getElementById("or").innerHTML = "1 or TRUE"
}if else (binary == 1 || binarytwo == 0){
document.getElementById("or").innerHTML = "1 or TRUE"
}if else (binary == 0 || binarytwo == 1){
document.getElementById("or").innerHTML = "1 or TRUE"
}else{
document.getElementById("or").innerHTML = "0 or FALSE"
}
}< /code>
Logic Gates
Write two Binary Values
Type a 0 or 1 here
Type a 0 or 1 here
"Click Here to get the Statements"
OR Statement
AND Statement
XOR Statement
Mobile version