About: Logical shift

An Entity of Type: military conflict, from Named Graph: http://dbpedia.org, within Data Space: dbpedia.org

In computer science, a logical shift is a bitwise operation that shifts all the bits of its operand. The two base variants are the logical left shift and the logical right shift. This is further modulated by the number of bit positions a given value shall be shifted, such as shift left by 1 or shift right by n. Unlike an arithmetic shift, a logical shift does not preserve a number's sign bit or distinguish a number's exponent from its significand (mantissa); every bit in the operand is simply moved a given number of bit positions, and the vacant bit-positions are filled, usually with zeros, and possibly ones (contrast with a circular shift).

Property Value
dbo:abstract
  • Unter einer logischen Verschiebung (engl. logical shift) versteht man in der Informatik einen bitweisen Operator, der alle Bits des Operanden verschiebt. Die logische im Gegensatz zur arithmetischen Verschiebung erhält weder das Vorzeichenbit noch unterscheidet sie zwischen dem Exponenten und der Mantisse einer Zahl. Jedes Bit des Operanden wird einfach um eine gegebene Positionsanzahl verschoben und die entstehenden Bit-Positionen werden, in der Regel mit Nullen, aufgefüllt. Eine logische Verschiebung wird oft genutzt, wenn der Operand als Sequenz von Bits und nicht als Zahl betrachtet wird. Logische Verschiebungen können ein sinnvoller und effizienter Weg sein, Multiplikationen oder Divisionen von vorzeichenlosen Integer-Zahlen (Ganzzahlen) zur zweiten Potenz durchzuführen. Eine Verschiebung nach links um n Bits bei einer vorzeichenlosen oder vorzeichenbehafteten binären Zahl hat den Effekt einer Multiplikation mit 2n. Verschieben nach rechts um n Bits bei einer vorzeichenlosen binären Zahl ist gleichbedeutend mit dem Dividieren durch 2n (und anschließendem Abrunden). Weil sich arithmetische Verschiebungen und logische Verschiebungen nach rechts unterscheiden, haben viele Programmiersprachen verschiedene Operatoren für sie. So ist der arithmetische Shift-Operator bei Java und JavaScript zum Beispiel >>; wohingegen der logische Rechtsshift >>> ist. Java allein hat nur einen Linksshift-Operator (<<), weil arithmetische und logische Verschiebung denselben Effekt haben. Die Sprache C wieder kennt nur einen Rechtsshift-Operator >>. Viele C-Compiler entscheiden die Art der Rechtsverschiebung danach, welcher Integer-Datentyp verschoben werden soll; oft werden vorzeichenbehaftete Ganzzahlen arithmetisch verschoben und vorzeichenlose logisch. (de)
  • In computer science, a logical shift is a bitwise operation that shifts all the bits of its operand. The two base variants are the logical left shift and the logical right shift. This is further modulated by the number of bit positions a given value shall be shifted, such as shift left by 1 or shift right by n. Unlike an arithmetic shift, a logical shift does not preserve a number's sign bit or distinguish a number's exponent from its significand (mantissa); every bit in the operand is simply moved a given number of bit positions, and the vacant bit-positions are filled, usually with zeros, and possibly ones (contrast with a circular shift). A logical shift is often used when its operand is being treated as a sequence of bits instead of as a number. Logical shifts can be useful as efficient ways to perform multiplication or division of unsigned integers by powers of two. Shifting left by n bits on a signed or unsigned binary number has the effect of multiplying it by 2n. Shifting right by n bits on an unsigned binary number has the effect of dividing it by 2n (rounding towards 0). Logical right shift differs from arithmetic right shift. Thus, many languages have different operators for them. For example, in Java and JavaScript, the logical right shift operator is >>>, but the arithmetic right shift operator is >>. (Java has only one left shift operator (<<), because left shift via logic and arithmetic have the same effect.) The programming languages C, C++, and Go, however, have only one right shift operator, >>. Most C and C++ implementations, and Go, choose which right shift to perform depending on the type of integer being shifted: signed integers are shifted using the arithmetic shift, and unsigned integers are shifted using the logical shift. All currently relevant C standards (ISO/IEC 9899:1999 to 2011) leave a definition gap for cases where the number of shifts is equal to or bigger than the number of bits in the operands in a way that the result is undefined. This helps allow C compilers to emit efficient code for various platforms by allowing direct use of the native shift instructions which have differing behavior. For example, shift-left-word in PowerPC chooses the more-intuitive behavior where shifting by the bit width or above gives zero, whereas SHL in x86 chooses to mask the shift amount to the lower bits to reduce the maximum execution time of the instructions, and as such a shift by the bit width doesn't change the value. Some languages, such as the .NET Framework and LLVM, also leave shifting by the bit width and above unspecified (.NET) or undefined (LLVM). Others choose to specify the behavior of their most common target platforms, such as C# which specifies the x86 behavior. (en)
  • 컴퓨팅에서 논리 시프트는 피연산자의 모든 비트를 이동하는 이다. 산술 시프트와 다르게, 논리 시프트는 수의 부호비트를 보존하지 않거나 가수로부터 수의 지수를 식별하지 않는다; 피연산자의 모든비트는 주어진 수의 비트위치로 단순히 이동하고, 비어있는 비트위치는 (와 비교해서) 일반적으로 0으로 채워진다. 논리 시프트는 피연산자가 숫자보다 비트의 수열로 처리될때도 사용된다. (ko)
  • Przesunięcie bitowe – operacja na liczbach w systemie dwójkowym polegająca na przesunięciu wszystkich cyfr binarnych o pozycji w lewo lub prawo. Jest to działanie powszechnie stosowane w elektronice i informatyce. Najczęściej przesunięcie wykorzystuje się do szybkiego mnożenia/dzielenia przez liczbę 2 i jej potęgi oraz do sekwencyjnego testowania wartości poszczególnych bitów. W cyfrowych układach elektronicznych przesunięcie bitowe realizowane jest przez rejestry przesuwające. W różnych językach programowania istnieją funkcje bądź operatory, realizujące przesunięcie: * w C/C++, PHP, Javie, Pythonie – >> (przesunięcie w prawo), << (przesunięcie w lewo); * w Pascalu – shr (przesunięcie w prawo), shl (przesunięcie w lewo). (pl)
dbo:thumbnail
dbo:wikiPageID
  • 1893663 (xsd:integer)
dbo:wikiPageInterLanguageLink
dbo:wikiPageLength
  • 6928 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID
  • 1121632710 (xsd:integer)
dbo:wikiPageWikiLink
dbp:wikiPageUsesTemplate
dcterms:subject
gold:hypernym
rdf:type
rdfs:comment
  • 컴퓨팅에서 논리 시프트는 피연산자의 모든 비트를 이동하는 이다. 산술 시프트와 다르게, 논리 시프트는 수의 부호비트를 보존하지 않거나 가수로부터 수의 지수를 식별하지 않는다; 피연산자의 모든비트는 주어진 수의 비트위치로 단순히 이동하고, 비어있는 비트위치는 (와 비교해서) 일반적으로 0으로 채워진다. 논리 시프트는 피연산자가 숫자보다 비트의 수열로 처리될때도 사용된다. (ko)
  • Unter einer logischen Verschiebung (engl. logical shift) versteht man in der Informatik einen bitweisen Operator, der alle Bits des Operanden verschiebt. Die logische im Gegensatz zur arithmetischen Verschiebung erhält weder das Vorzeichenbit noch unterscheidet sie zwischen dem Exponenten und der Mantisse einer Zahl. Jedes Bit des Operanden wird einfach um eine gegebene Positionsanzahl verschoben und die entstehenden Bit-Positionen werden, in der Regel mit Nullen, aufgefüllt. Eine logische Verschiebung wird oft genutzt, wenn der Operand als Sequenz von Bits und nicht als Zahl betrachtet wird. (de)
  • In computer science, a logical shift is a bitwise operation that shifts all the bits of its operand. The two base variants are the logical left shift and the logical right shift. This is further modulated by the number of bit positions a given value shall be shifted, such as shift left by 1 or shift right by n. Unlike an arithmetic shift, a logical shift does not preserve a number's sign bit or distinguish a number's exponent from its significand (mantissa); every bit in the operand is simply moved a given number of bit positions, and the vacant bit-positions are filled, usually with zeros, and possibly ones (contrast with a circular shift). (en)
  • Przesunięcie bitowe – operacja na liczbach w systemie dwójkowym polegająca na przesunięciu wszystkich cyfr binarnych o pozycji w lewo lub prawo. Jest to działanie powszechnie stosowane w elektronice i informatyce. Najczęściej przesunięcie wykorzystuje się do szybkiego mnożenia/dzielenia przez liczbę 2 i jej potęgi oraz do sekwencyjnego testowania wartości poszczególnych bitów. W cyfrowych układach elektronicznych przesunięcie bitowe realizowane jest przez rejestry przesuwające. W różnych językach programowania istnieją funkcje bądź operatory, realizujące przesunięcie: (pl)
rdfs:label
  • Logische Verschiebung (de)
  • Logical shift (en)
  • 논리 시프트 (ko)
  • Przesunięcie bitowe (pl)
  • Логічний зсув (uk)
owl:sameAs
prov:wasDerivedFrom
foaf:depiction
foaf:isPrimaryTopicOf
is dbo:wikiPageDisambiguates of
is dbo:wikiPageRedirects of
is dbo:wikiPageWikiLink of
is foaf:primaryTopic of
Powered by OpenLink Virtuoso    This material is Open Knowledge     W3C Semantic Web Technology     This material is Open Knowledge    Valid XHTML + RDFa
This content was extracted from Wikipedia and is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License