Intellau_Celistic
5'3 KHHV Mentalcel
-
- Joined
- Aug 26, 2021
- Posts
- 166,468
ParadigmaticAnon Join Date: 2016-01-25 Post Count: 182 | #183519765Saturday, February 13, 2016 12:37 PM CST I have developed another explanation for the users on the sub-section. Suppose that we a machine containing six buttons. Each button can be successively activated/deactivated using a sequence of instructions. Each "button press" will reverse the button's current state. We can express this as a binary sequence of six bits. This will be our representation: 000111 In the above sequence for our machine, the first three buttons are deactivated. The last remaining three buttons are active. Naturally, since we are working directly with base-two, we can utilize logical operations to modify the behavior of the individual bits. Let us define a function "P", which will represent each unique button press. Imagine that function "P" accepts an input "positional value", and signals a state change to the bit of that position. This would be our notation to use the sequence(Assuming that lowercase "p" refers to the position within the address and uppercase "B" refers to the actual memory address itself): P(p) = ~B[p] The "~"(Or logical NOT) operator merely reverses the numerical value of the bit found. In non base-two context, this would reverse "true" to false, and "false" to true. Since base-two has only two valid digits, 0 and/or 1, this operator will likewise reverse 0 to 1 and 1 to 0. Since our machine has six button, the function will need to be executed exactly six times to affect every digit. Given that our original sequence was "000111", this is how it would be altered: P(1) = 1 P(2) = 1 P(3) = 1 P(4) = 0 P(5) = 0 P(6) = 0 Altogether, the new button sequence would be "111000." Notice how the values of both sets of halves of the button sequence was swapped. Consequently, the first three buttons are activated. The last remaining three buttons are not. |