What is Bitwise operation?

An operation that treats an integer as a sequence of binary bits and applies AND, OR, exclusive OR (XOR) or NOT to each bit, or shifts the bits left or right. It is used to extract or set particular bits, to count 1 bits, and to multiply or divide by powers of 2.

Japanese name: ビット演算

Bitwise operation appears in 2 practice questions across 2 topics, including Logic circuits, Programming Basics (Pseudocode Tracing).

Field: Programming Basics (Pseudocode Tracing)

Try it: questions about Bitwise operation

When is the output of a 2-input OR gate 0?

  1. AWhen the two inputs differ
  2. BWhen both inputs are 0
  3. CWhen both inputs are 1
Show answer and explanation

Answer: B. When both inputs are 0

An OR gate (logical disjunction) outputs 1 if at least one input is 1; it outputs 0 only when every input is 0. It behaves like switches in parallel, used for control that acts if any condition holds—for example, combining several interrupt requests, or setting bits in bitwise operations (x OR 0x80 sets the top bit).

Bitwise operation in the explanations

Questions that mention Bitwise operation (2)

  1. When is the output of a 2-input OR gate 0?
  2. ∧ is bitwise AND. What is the value of c after the following program runs?

Books on Programming Basics (Pseudocode Tracing) Ad

As an Amazon Associate I earn from qualifying purchases.

Semiconductor, Electronics and Computing Calculators

Related terms

Interrupt Argument Array Control structure Integer division Modulo operation Object-oriented programming Off-by-one error Pseudocode Return value

Back to the glossary