Operations on the bits

Introduction

In the data-processing languages, for example C++, Java etc one finds operations known as: “bit by bit”. the Computer to make this type of calculation, between two entireties, must convert the entireties towards the binary system, make the operations bit by bit, then to turn over the result to the system of the departure. The objective of this article is to find methods of calculating, without passing to the binary system, and to prolong towards the unit \ mathbb {R}

Operation conjunction (and) on the bits

The conjunction (and) between two entireties has and B, is represented: a \wedge b. In measurement or the logical operations on the proposals are homogeneous on the operations between the finished units: for example, there is a relation between the conjunction and the intersection between two finished units.

To present the entireties as a whole finished

All Integer can be connected to a finished unit, whose elements are entireties: example for 15:
there is 15 = 2^0 + 2^1 + 2^2 + 2^3 \, exhibitors forming a fini.
unit Thus for 15 the unit is: \ left \ {0; 1; 2; 3 \ right \} and for 8 the unit is: \ left \ {3 \ right \} (8 = 2^3 \, ), therefore the intersection enters the unit \ left \ {0; 1; 2; 3 \ right \} and \ left \ {3 \ right \} is \ left \ {3 \ right \} . thus 15 \ wedge 8 = 8

Properties

for all has, B and N whole one a:
  1. a \ wedge B = B \ wedge a
  2. a \ wedge 0 = 0
  3. 2^n.a \ wedge 2^n.b =2^n (has \ wedge b)
  4. if a \ wedge B = 0 then n \ wedge (a+b) = (\ wedge N has) + (B \ wedge N)
  5. if E (\ frac {has} {2^n}) is even, then one a has \ wedge 2^n = 0
  6. if E (\ frac {has} {2^n}) is odd, then one a has \ wedge 2^n = 2^n
  7. if has \ not= b one has 2^a \ wedge 2^b=0

Operation disjunction (or) on the bits

Disjunction between two entireties, is an entirety associated with a unit which is the union of the two units which are associated with these two nombres.
Disjunction (or) between two entireties has and B, is represented: a \vee b.
example:
15 \ vee 8 = 15

Properties

for all has, B and N whole one a:
  1. a \ vee B = B \ vee a
  2. a \ vee 0 = a
  3. 2^n.a \ vee 2^n.b =2^n (has \ vee b)

Operations on the bits in \ mathbb {Z}

Negation

Definition

The negation of entireties relative is:
\ forall has \ in \ mathbb {Z} one has \ sim a=- (a+1)

conjunction and disjunction in \ mathbb {Z}

To calculate the operations conjonction and disjonction, one uses proriétés the suivantes

Properties

for all has, B and N whole relative one a:
  1. if a \ wedge B = 0 then n \ wedge (a+b) = (has \ wedge N) + (B \ wedge N)
  2. \ sim (has \ wedge b) = (\ sim has \ vee \ sim b) (De Morgan)
  3. \ sim (has \ vee b) = (\ sim has \ wedge \ sim b) (De Morgan)
  4. (has \ vee b) \ wedge N = (has \ wedge N) \ vee (B \ wedge N) and (has \ wedge b) \ vee N = (\ vee N has) \ wedge (B \ vee N)

conjunction and disjunction in \ mathbb {Q}

Euclidean division in the binary system

For all couple, has and B in \ mathbb {NR} ^2 there exists only one couple in \ mathbb {NR} ^2. it is true in all the systèmes.
Thus one can make a division on the binary system, if R is the remainder of a division, multiply R by 10 is in fact division:
example: The divistion {59 \ over 7} =8,428571,
is in decimal system, for the binary system, the same operations are made, and one finds:
{111011 \ over 111} =1000,011, therefore one can make the operations conjunction and disjunction for the rational numbers.

Random links:Arruazu | Spellforce: The Order off Dawn | Concert for the tolerance | EA Sports Big | Archdiocese of Aparecida | Wiley_Ford,_la_Virginie_Occidentale