From WikiChip
Difference between revisions of "boolean algebra/choose function"
m |
|||
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> | ||
− | + | \text{Ch}(x,y,z) = | |
\begin{cases} | \begin{cases} | ||
y, & \text{ if } x = 1 \\ | y, & \text{ if } x = 1 \\ | ||
Line 24: | Line 24: | ||
Which can be implemented as: | Which can be implemented as: | ||
− | <math> | + | ::<math> |
− | + | \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> | ||
Revision as of 21:06, 10 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.
Which can be implemented as:
The xor version is sometimes more commonly in field such as cryptography.
See also
- rotate left (ROL)
- rotate right (ROR)
- parity function (PAR)
- majority function (MAJ)