From WikiChip
Editing boolean algebra/choose function

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
{{ba title|Choose Function (Ch)}}{| class="wikitable" style="float: right;"
+
{| 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''') (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.
+
'''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.
  
 
:<math>
 
:<math>
\text{Ch}(x,y,z) =
+
f(x,y,z) =
 
\begin{cases}
 
\begin{cases}
y,  & \text{ if } x = 1 \\
+
y,  & \text{if $x$ = 1} \\[2ex]
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>
\text{Ch}(x,y,z) = (x \land y) \lor (\bar x \land z)
+
f(x,y,z) = (x \land y) \oplus (\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>
  

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)

Template used on this page: