From WikiChip
Difference between revisions of "boolean algebra/choose function"
< boolean algebra

(Created page with "{| class="wikitable" style="float: right;" ! colspan="3" | Inputs !! Outputs |- ! X !! Y !! Z !! Q |- | 0 || X || 0 || 0 |- | 0 || X || 1 || 1 |-...")
 
m
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
{| class="wikitable" style="float: right;"
+
{{ba title|Choose Function (Ch)}}{| class="wikitable" style="float: right;"
 
! colspan="3" | Inputs !! Outputs
 
! colspan="3" | Inputs !! Outputs
 
|-
 
|-
Line 12: Line 12:
 
| 1 || 1 || [[don't care|X]] || 1
 
| 1 || 1 || [[don't care|X]] || 1
 
|}
 
|}
'''Choose function''' (or '''Ch Function''') is a [[Boolean function]] that represents a [[multiplexer|2:1 MUX]]. The choose function is frequently found in various [[cryptographic hash function]]s.
+
'''Choose function''' (or '''Ch Function''') (sometimes '''if-then-else''' or '''ITE''') is a [[Boolean function]] that represents a [[multiplexer|2:1 MUX]]. The choose function is frequently found in various [[cryptographic hash function]]s.
  
 
:<math>
 
:<math>
f(x,y,z) =
+
\text{Ch}(x,y,z) =
 
\begin{cases}
 
\begin{cases}
y,  & \text{if $x$ = 1} \\[2ex]
+
y,  & \text{ if } x = 1 \\
z, & \text{if $x$ = 0}
+
z, & \text{ if } x = 0
 
\end{cases}
 
\end{cases}
 
</math>
 
</math>
Line 24: Line 24:
  
 
Which can be implemented as:
 
Which can be implemented as:
<math>
+
::<math>
f(x,y,z) = (x \land y) \oplus (\bar x \land z)
+
\text{Ch}(x,y,z) = (x \land y) \lor (\bar x \land z)
 +
</math>
 +
The xor version is sometimes more commonly in field such as [[cryptography]].
 +
::<math>
 +
\text{Ch}(x,y,z) = (x \land y) \oplus (\bar x \land z)
 
</math>
 
</math>
  

Latest revision as of 21:07, 15 December 2015

Inputs Outputs
X Y Z Q
0 X 0 0
0 X 1 1
1 0 X 0
1 1 X 1

Choose function (or Ch Function) (sometimes if-then-else or ITE) is a Boolean function that represents a 2:1 MUX. The choose function is frequently found in various cryptographic hash functions.

Equation Ch left-parenthesis x comma y comma z right-parenthesis equals StartLayout Enlarged left-brace 1st Row 1st Column y comma 2nd Column if x equals 1 2nd Row 1st Column z comma 2nd Column if x equals 0 EndLayout


Which can be implemented as:

Equation Ch left-parenthesis x comma y comma z right-parenthesis equals left-parenthesis x logical-and y right-parenthesis logical-or left-parenthesis x overbar logical-and z right-parenthesis

The xor version is sometimes more commonly in field such as cryptography.

Equation Ch left-parenthesis x comma y comma z right-parenthesis equals left-parenthesis x logical-and y right-parenthesis circled-plus left-parenthesis x overbar logical-and z right-parenthesis

See also[edit]